{"openapi":"3.1.0","info":{"title":"Retryx API","version":"1.0.0","description":"Reliable webhook delivery, replay and observability. **No webhook left behind.**\n\nDelivery is at-least-once: use `Idempotency-Key` (stable per delivery) to deduplicate. Outgoing requests are signed — see the developer docs."},"servers":[{"url":"https://retryx.io"}],"tags":[{"name":"Ingestion"},{"name":"Billing"},{"name":"Projects"},{"name":"Endpoints"},{"name":"Destinations"},{"name":"Events"},{"name":"Deliveries"},{"name":"Replays"},{"name":"Analytics"},{"name":"API keys"},{"name":"Search"},{"name":"Notifications"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Organization API key (`rx_…`). Scopes limit what it may do."},"session":{"type":"apiKey","in":"cookie","name":"rx_session","description":"Browser session. Mutations also need an `X-CSRF-Token` header."},"endpointToken":{"type":"http","scheme":"bearer","description":"Ingestion endpoint token (`rxe_…`), unless the endpoint verifies a provider signature."}},"schemas":{"IngestResult":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["accepted"]},"deliveries":{"type":"integer"}},"required":["id","status","deliveries"]},{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["duplicate"]}},"required":["id","status"]},{"type":"object","properties":{"status":{"type":"string","enum":["filtered"]}},"required":["status"]}]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"requestId":{"type":"string"}},"required":["code","message","requestId"]}},"required":["error"]},"Project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"environment":{"type":"string","enum":["DEVELOPMENT","STAGING","PRODUCTION"]},"archivedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","environment","archivedAt","createdAt"]},"Ok":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"Endpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"active":{"type":"boolean"},"ingestUrl":{"type":"string","format":"uri"},"tokenPrefix":{"type":"string"},"eventTypeFilter":{"type":"array","items":{"type":"string"}},"rateLimitPerMin":{"type":["integer","null"]},"maxBodyBytes":{"type":["integer","null"]},"dedupWindowSec":{"type":"integer"},"destinationIds":{"type":"array","items":{"type":"string","format":"uuid"}},"source":{"type":["object","null"],"properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"verification":{"type":"string","enum":["configured","none"]}},"required":["id","type","verification"]}},"required":["id","projectId","name","active","ingestUrl","tokenPrefix","eventTypeFilter","rateLimitPerMin","maxBodyBytes","dedupWindowSec","source"]},"Destination":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"active":{"type":"boolean"},"paused":{"type":"boolean"},"health":{"type":"string","enum":["UNKNOWN","HEALTHY","DEGRADED","DOWN"]},"timeoutMs":{"type":"integer"},"maxConcurrency":{"type":"integer"},"rateLimitPerSec":{"type":["integer","null"]},"followRedirects":{"type":"boolean"},"headers":{"type":["object","null"],"additionalProperties":{"type":"string","enum":["[hidden]"]},"description":"Header names only; values are never returned."},"failoverDestinationId":{"type":["string","null"],"format":"uuid"},"rotation":{"type":["object","null"],"properties":{"previousSecretValidUntil":{"type":"string","format":"date-time"}},"required":["previousSecretValidUntil"]}},"required":["id","projectId","name","url","active","paused","health","timeoutMs","maxConcurrency","rateLimitPerSec","followRedirects","headers","failoverDestinationId","rotation"]},"Event":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"endpointId":{"type":"string","format":"uuid"},"eventType":{"type":["string","null"]},"sourceEventId":{"type":["string","null"]},"payloadSize":{"type":"integer"},"receivedAt":{"type":"string","format":"date-time"},"isTest":{"type":"boolean"},"deliverySummary":{"type":"object","properties":{"status":{"type":"string","enum":["SUCCEEDED","FAILED","PENDING","PARTIAL","NO_DESTINATIONS"]},"deliveries":{"type":"integer"},"attempts":{"type":"integer"},"lastStatusCode":{"type":["integer","null"]},"lastError":{"type":["string","null"]}},"required":["status","deliveries","attempts","lastStatusCode","lastError"]}},"required":["id","projectId","endpointId","eventType","sourceEventId","payloadSize","receivedAt","isTest","deliverySummary"]},"EventPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["data","nextCursor"]},"DeliveryStatus":{"type":"string","enum":["PENDING","SCHEDULED","IN_PROGRESS","SUCCEEDED","FAILED","DEAD_LETTERED","CANCELLED"]},"DeliveryAttempt":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"attemptNumber":{"type":"integer"},"startedAt":{"type":"string","format":"date-time"},"durationMs":{"type":["integer","null"]},"statusCode":{"type":["integer","null"]},"error":{"type":["string","null"]},"responseBody":{"type":["string","null"]},"resolvedIp":{"type":["string","null"]}},"required":["id","attemptNumber","startedAt","durationMs","statusCode","error","responseBody","resolvedIp"]},"Delivery":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"destinationId":{"type":"string","format":"uuid"},"status":{"$ref":"#/components/schemas/DeliveryStatus"},"attemptCount":{"type":"integer"},"maxAttempts":{"type":"integer"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"lastStatusCode":{"type":["integer","null"]},"lastError":{"type":["string","null"]},"replayOperationId":{"type":["string","null"],"format":"uuid"},"originalDeliveryId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","eventId","destinationId","status","attemptCount","maxAttempts","nextAttemptAt","lastStatusCode","lastError","replayOperationId","originalDeliveryId","createdAt"]},"EventDetail":{"allOf":[{"$ref":"#/components/schemas/Event"},{"type":"object","properties":{"headers":{"type":"object","additionalProperties":{"type":"string"}},"payload":{"type":"object","properties":{"expired":{"type":"boolean"},"body":{"type":["string","null"]},"json":{}},"required":["expired","body"]},"deliveries":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Delivery"},{"type":"object","properties":{"attempts":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryAttempt"}}},"required":["attempts"]}]}}},"required":["headers","payload","deliveries"]}]},"DeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Delivery"}},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["data","nextCursor"]},"ReplayOperation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["SINGLE","BULK","TIME_RANGE","SCHEDULED"]},"status":{"type":"string","enum":["SCHEDULED","RUNNING","COMPLETED","FAILED","CANCELLED"]},"createdCount":{"type":"integer"},"scheduledFor":{"type":["string","null"],"format":"date-time"},"reason":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","kind","status","createdCount","scheduledFor","reason","createdAt","completedAt"]},"ReplayPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReplayOperation"}},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["data","nextCursor"]},"AnalyticsOverview":{"type":"object","properties":{"eventsReceived":{"type":"integer"},"deliveries":{"type":"object","properties":{"succeeded":{"type":"integer"},"failed":{"type":"integer"},"pending":{"type":"integer"},"cancelled":{"type":"integer"},"total":{"type":"integer"}},"required":["succeeded","failed","pending","cancelled","total"]},"attempts":{"type":"integer"},"retries":{"type":"integer"},"avgLatencyMs":{"type":["integer","null"]},"p95LatencyMs":{"type":["integer","null"]},"successRate":{"type":["number","null"]},"usage":{"type":"object","properties":{"eventsThisMonth":{"type":"integer"}},"required":["eventsThisMonth"]}},"required":["eventsReceived","deliveries","attempts","retries","avgLatencyMs","p95LatencyMs","successRate","usage"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","name","prefix","scopes","lastUsedAt","expiresAt","revokedAt","createdAt"]},"Notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"readAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","title","body","readAt","createdAt"]},"NotificationPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"nextCursor":{"type":["string","null"],"format":"uuid"}},"required":["data","nextCursor"]},"Plan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"monthlyPriceCents":{"type":"integer"},"annualPriceCents":{"type":["integer","null"]},"includedEvents":{"type":"integer"},"overLimit":{"type":"string","enum":["BLOCK","SOFT_OVERAGE","NOTIFY_ONLY"]},"overagePer1kCents":{"type":["integer","null"]},"trialDays":{"type":"integer"},"isCustom":{"type":"boolean"},"features":{"type":"object","additionalProperties":{}}},"required":["code","name","monthlyPriceCents","annualPriceCents","includedEvents","overLimit","overagePer1kCents","trialDays","isCustom","features"]},"UsageSummary":{"type":"object","properties":{"plan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]},"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"used":{"type":"integer"},"limit":{"type":"integer"},"remaining":{"type":"integer"},"percent":{"type":"number"},"behavior":{"type":"string","enum":["BLOCK","SOFT_OVERAGE","NOTIFY_ONLY"]},"overageUnits":{"type":"integer"},"estimatedOverageCents":{"type":"integer"},"breakdown":{"type":"object","additionalProperties":{}}},"required":["plan","period","used","limit","remaining","percent","behavior","overageUnits","estimatedOverageCents","breakdown"]}},"parameters":{}},"paths":{"/v1/ingest/{endpointId}":{"post":{"tags":["Ingestion"],"summary":"Send a webhook to Retryx","description":"Accepts any content type; the raw bytes are stored and forwarded unchanged. `202` is returned only after the event is durably committed. Duplicates (same source event id within the dedup window) return `200 {status:\"duplicate\"}`. Limits return `413`/`429` with `Retry-After`.","security":[{"endpointToken":[]},{}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/projects":{"post":{"tags":["Projects"],"summary":"Create a project","description":"API key scope: `projects:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"environment":{"type":"string","enum":["DEVELOPMENT","STAGING","PRODUCTION"],"default":"DEVELOPMENT"}},"required":["name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Projects"],"summary":"List projects","description":"API key scope: `projects:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/projects/{projectId}":{"get":{"tags":["Projects"],"summary":"Get a project","description":"API key scope: `projects:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Projects"],"summary":"Update a project","description":"API key scope: `projects:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"environment":{"type":"string","enum":["DEVELOPMENT","STAGING","PRODUCTION"],"default":"DEVELOPMENT"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Projects"],"summary":"Archive a project","description":"Archiving deactivates its endpoints. History is retained.\n\nAPI key scope: `projects:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/endpoints":{"post":{"tags":["Endpoints"],"summary":"Create an ingestion endpoint","description":"The `token` is returned once and never again.\n\nAPI key scope: `endpoints:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":80},"source":{"type":"object","properties":{"type":{"type":"string","enum":["STRIPE","GITHUB","SHOPIFY","CUSTOM","GENERIC_SIGNED"]},"secret":{"type":"string","minLength":8,"maxLength":500},"config":{"anyOf":[{"type":"object","properties":{"header":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"algorithm":{"type":"string","enum":["sha1","sha256","sha512"],"default":"sha256"},"encoding":{"type":"string","enum":["hex","base64"],"default":"hex"},"prefix":{"type":"string","maxLength":32},"timestampHeader":{"type":"string","pattern":"^[A-Za-z0-9-]{1,64}$"},"toleranceSec":{"type":"integer","minimum":1,"maximum":86400},"signTimestamp":{"type":"boolean"}},"required":["header"]},{"type":"object","properties":{"toleranceSec":{"type":"integer","minimum":1,"maximum":86400}},"required":["toleranceSec"]}]}},"required":["type"]},"destinationIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"default":[]},"eventTypeFilter":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":100,"default":[]},"jsonSchema":{"type":["object","null"],"additionalProperties":{}},"customHeaders":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":2000}},"rateLimitPerMin":{"type":["integer","null"],"minimum":1,"maximum":100000},"maxBodyBytes":{"type":["integer","null"],"minimum":1,"maximum":5242880},"retryPolicy":{"type":["object","null"],"properties":{"maxAttempts":{"type":"integer","minimum":1,"maximum":30,"default":8},"baseDelaySec":{"type":"number","minimum":1,"maximum":3600,"default":30},"factor":{"type":"number","minimum":1,"maximum":10,"default":2},"maxDelaySec":{"type":"number","minimum":1,"maximum":86400,"default":21600},"schedule":{"type":"array","items":{"type":"number","minimum":1,"maximum":86400},"maxItems":30}}},"dedupWindowSec":{"type":"integer","minimum":0,"maximum":2592000,"default":86400},"active":{"type":"boolean","default":true}},"required":["projectId","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Endpoint"},{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Endpoints"],"summary":"List endpoints","description":"API key scope: `endpoints:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Endpoint"}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/endpoints/{endpointId}":{"get":{"tags":["Endpoints"],"summary":"Get an endpoint","description":"API key scope: `endpoints:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Endpoint"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Endpoints"],"summary":"Update an endpoint","description":"API key scope: `endpoints:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"destinationIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"default":[]},"eventTypeFilter":{"type":"array","items":{"type":"string","maxLength":255},"maxItems":100,"default":[]},"jsonSchema":{"type":["object","null"],"additionalProperties":{}},"customHeaders":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":2000}},"rateLimitPerMin":{"type":["integer","null"],"minimum":1,"maximum":100000},"maxBodyBytes":{"type":["integer","null"],"minimum":1,"maximum":5242880},"retryPolicy":{"type":["object","null"],"properties":{"maxAttempts":{"type":"integer","minimum":1,"maximum":30,"default":8},"baseDelaySec":{"type":"number","minimum":1,"maximum":3600,"default":30},"factor":{"type":"number","minimum":1,"maximum":10,"default":2},"maxDelaySec":{"type":"number","minimum":1,"maximum":86400,"default":21600},"schedule":{"type":"array","items":{"type":"number","minimum":1,"maximum":86400},"maxItems":30}}},"dedupWindowSec":{"type":"integer","minimum":0,"maximum":2592000,"default":86400},"active":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Endpoint"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Endpoints"],"summary":"Deactivate an endpoint","description":"API key scope: `endpoints:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/endpoints/{endpointId}/rotate-token":{"post":{"tags":["Endpoints"],"summary":"Rotate the endpoint token","description":"The previous token stops working immediately.\n\nAPI key scope: `endpoints:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/endpoints/{endpointId}/test":{"post":{"tags":["Endpoints"],"summary":"Send a test event","description":"Runs the real pipeline. Not billed. Limited to 10 per minute per organization.\n\nAPI key scope: `endpoints:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"endpointId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"payload":{"type":"object","additionalProperties":{}},"eventType":{"type":"string"}}}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestResult"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/destinations":{"post":{"tags":["Destinations"],"summary":"Create a destination","description":"URLs are validated (HTTPS, no private/loopback/metadata addresses) when saved and again at every delivery. `signingSecret` is shown once.\n\nAPI key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2000},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":2000}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":30000,"default":10000},"maxConcurrency":{"type":"integer","minimum":1,"maximum":50,"default":5},"rateLimitPerSec":{"type":["integer","null"],"minimum":1,"maximum":1000},"followRedirects":{"type":"boolean","default":false},"transform":{"type":["object","null"],"properties":{"pick":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100},"omit":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100},"rename":{"type":"object","additionalProperties":{"type":"string","maxLength":200}},"set":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"null"}]}},"wrap":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,63}$"}},"additionalProperties":false},"failoverDestinationId":{"type":["string","null"],"format":"uuid"},"retryPolicy":{"type":["object","null"],"properties":{"maxAttempts":{"type":"integer","minimum":1,"maximum":30,"default":8},"baseDelaySec":{"type":"number","minimum":1,"maximum":3600,"default":30},"factor":{"type":"number","minimum":1,"maximum":10,"default":2},"maxDelaySec":{"type":"number","minimum":1,"maximum":86400,"default":21600},"schedule":{"type":"array","items":{"type":"number","minimum":1,"maximum":86400},"maxItems":30}}},"active":{"type":"boolean","default":true}},"required":["projectId","name","url"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Destination"},{"type":"object","properties":{"signingSecret":{"type":"string"}},"required":["signingSecret"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Destinations"],"summary":"List destinations","description":"API key scope: `destinations:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"projectId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Destination"}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/destinations/{destinationId}":{"get":{"tags":["Destinations"],"summary":"Get a destination","description":"API key scope: `destinations:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Destinations"],"summary":"Update a destination","description":"API key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2000},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":2000}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":30000,"default":10000},"maxConcurrency":{"type":"integer","minimum":1,"maximum":50,"default":5},"rateLimitPerSec":{"type":["integer","null"],"minimum":1,"maximum":1000},"followRedirects":{"type":"boolean","default":false},"transform":{"type":["object","null"],"properties":{"pick":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100},"omit":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":100},"rename":{"type":"object","additionalProperties":{"type":"string","maxLength":200}},"set":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"null"}]}},"wrap":{"type":"string","pattern":"^[A-Za-z_][A-Za-z0-9_]{0,63}$"}},"additionalProperties":false},"failoverDestinationId":{"type":["string","null"],"format":"uuid"},"retryPolicy":{"type":["object","null"],"properties":{"maxAttempts":{"type":"integer","minimum":1,"maximum":30,"default":8},"baseDelaySec":{"type":"number","minimum":1,"maximum":3600,"default":30},"factor":{"type":"number","minimum":1,"maximum":10,"default":2},"maxDelaySec":{"type":"number","minimum":1,"maximum":86400,"default":21600},"schedule":{"type":"array","items":{"type":"number","minimum":1,"maximum":86400},"maxItems":30}}},"active":{"type":"boolean","default":true},"paused":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Destinations"],"summary":"Delete a destination","description":"API key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/destinations/{destinationId}/pause":{"post":{"tags":["Destinations"],"summary":"Pause deliveries","description":"Events keep being accepted and queued; nothing is sent until resumed.\n\nAPI key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"paused":{"type":"boolean"}},"required":["id","paused"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/destinations/{destinationId}/resume":{"post":{"tags":["Destinations"],"summary":"Resume deliveries","description":"API key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"paused":{"type":"boolean"}},"required":["id","paused"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/destinations/{destinationId}/rotate-secret":{"post":{"tags":["Destinations"],"summary":"Rotate the signing secret","description":"During the overlap window every request carries two `v1` signatures, so receivers can switch without downtime.\n\nAPI key scope: `destinations:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"destinationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"overlapHours":{"type":"number","minimum":0,"maximum":168,"default":24}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"signingSecret":{"type":"string"},"previousSecretValidUntil":{"type":["string","null"],"format":"date-time"}},"required":["signingSecret","previousSecretValidUntil"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/events":{"get":{"tags":["Events"],"summary":"List events","description":"Newest first; cursor pagination.\n\nAPI key scope: `events:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"endpointId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"destinationId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"eventType","in":"query"},{"schema":{"$ref":"#/components/schemas/DeliveryStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/events/{eventId}":{"get":{"tags":["Events"],"summary":"Get an event with payload, deliveries and attempts","description":"API key scope: `events:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"eventId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetail"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/deliveries":{"get":{"tags":["Deliveries"],"summary":"List deliveries","description":"API key scope: `deliveries:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"$ref":"#/components/schemas/DeliveryStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"destinationId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"eventId","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/deliveries/{deliveryId}":{"get":{"tags":["Deliveries"],"summary":"Get a delivery with all attempts","description":"API key scope: `deliveries:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"deliveryId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Delivery"},{"type":"object","properties":{"attempts":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryAttempt"}}},"required":["attempts"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/deliveries/{deliveryId}/retry":{"post":{"tags":["Deliveries"],"summary":"Retry a finished delivery","description":"Creates a single-delivery replay: the original stays as history and a new linked delivery is created.\n\nAPI key scope: `deliveries:retry`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"deliveryId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayOperation"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/replays":{"post":{"tags":["Replays"],"summary":"Replay events","description":"Bulk, time-range, only-failed or scheduled. Never overwrites history; every replay is an auditable operation.\n\nAPI key scope: `replays:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["SINGLE","BULK","TIME_RANGE","SCHEDULED"]},"eventIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":5000},"deliveryIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":5000},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"projectId":{"type":"string","format":"uuid"},"endpointId":{"type":"string","format":"uuid"},"destinationId":{"type":"string","format":"uuid"},"onlyFailed":{"type":"boolean"},"scheduledFor":{"type":"string","format":"date-time"},"reason":{"type":"string","maxLength":500}},"required":["kind"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayOperation"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Replays"],"summary":"List replay operations","description":"API key scope: `deliveries:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/replays/{replayId}":{"get":{"tags":["Replays"],"summary":"Get a replay operation","description":"API key scope: `deliveries:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"replayId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ReplayOperation"},{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"destinationId":{"type":"string","format":"uuid"},"originalDeliveryId":{"type":["string","null"],"format":"uuid"},"status":{"$ref":"#/components/schemas/DeliveryStatus"}},"required":["id","eventId","destinationId","originalDeliveryId","status"]}}},"required":["deliveries"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/replays/{replayId}/cancel":{"post":{"tags":["Replays"],"summary":"Cancel a scheduled replay","description":"API key scope: `replays:write`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"replayId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Delivery metrics for a period","description":"API key scope: `analytics:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","enum":["1h","24h","7d","30d"]},"required":false,"name":"range","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOverview"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/analytics/timeseries":{"get":{"tags":["Analytics"],"summary":"Zero-filled time series","description":"API key scope: `analytics:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","enum":["1h","24h","7d","30d"]},"required":false,"name":"range","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"unit":{"type":"string","enum":["hour","day"]},"points":{"type":"array","items":{"type":"object","properties":{"t":{"type":"string","format":"date-time"},"events":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"avgLatencyMs":{"type":["integer","null"]}},"required":["t","events","succeeded","failed","avgLatencyMs"]}}},"required":["unit","points"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/analytics/problem-destinations":{"get":{"tags":["Analytics"],"summary":"Destinations with the most failed attempts","description":"API key scope: `analytics:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","enum":["1h","24h","7d","30d"]},"required":false,"name":"range","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"host":{"type":"string"},"health":{"type":"string"},"failedAttempts":{"type":"integer"},"totalAttempts":{"type":"integer"},"failureRate":{"type":"number"}},"required":["id","name","host","health","failedAttempts","totalAttempts","failureRate"]}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/api-keys":{"post":{"tags":["API keys"],"summary":"Create an API key","description":"Scopes: events:read, events:write, deliveries:read, deliveries:retry, replays:write, projects:read, projects:write, endpoints:read, endpoints:write, destinations:read, destinations:write, analytics:read, usage:read. The key is shown once; only a hash is stored.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"scopes":{"type":"array","items":{"type":"string","enum":["events:read","events:write","deliveries:read","deliveries:retry","replays:write","projects:read","projects:write","endpoints:read","endpoints:write","destinations:read","destinations:write","analytics:read","usage:read"]},"minItems":1,"maxItems":13},"expiresInDays":{"type":"integer","minimum":1,"maximum":730}},"required":["name","scopes"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string"}},"required":["key"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["API keys"],"summary":"List API keys","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["keys"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/api-keys/{keyId}":{"delete":{"tags":["API keys"],"summary":"Revoke an API key","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"keyId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/api-keys/{keyId}/rotate":{"post":{"tags":["API keys"],"summary":"Rotate an API key","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"keyId","in":"path"}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string"}},"required":["key"]}]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/key":{"get":{"tags":["API keys"],"summary":"Identify the calling API key","description":"API key scope: `usage:read`.","security":[{"apiKey":[]},{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","format":"uuid"},"keyId":{"type":"string","format":"uuid"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["organizationId","keyId","scopes"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/search":{"get":{"tags":["Search"],"summary":"Global search","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"q","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"projects":{"type":"array","items":{}},"endpoints":{"type":"array","items":{}},"destinations":{"type":"array","items":{}},"events":{"type":"array","items":{}}},"required":["projects","endpoints","destinations","events"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications":{"get":{"tags":["Notifications"],"summary":"List your notifications","security":[{"session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"unread","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPage"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/unread-count":{"get":{"tags":["Notifications"],"summary":"Unread count","security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/read-all":{"post":{"tags":["Notifications"],"summary":"Mark all read","security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer"}},"required":["updated"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/{id}/read":{"post":{"tags":["Notifications"],"summary":"Mark one read","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notifications/preferences":{"get":{"tags":["Notifications"],"summary":"Get notification preferences","security":[{"session":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"inApp":{"type":"boolean"},"email":{"type":"boolean"},"threshold":{"type":["number","null"]}},"required":["type","label","inApp","email","threshold"]}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Notifications"],"summary":"Update notification preferences","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"inApp":{"type":"boolean"},"email":{"type":"boolean"},"threshold":{"type":["integer","null"]}},"required":["type","inApp","email"]}}},"required":["preferences"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/plans":{"get":{"tags":["Billing"],"summary":"List public plans","description":"Live plan data (the pricing page is rendered from this).","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"billingEnabled":{"type":"boolean"}},"required":["data","billingEnabled"]}}}}}}},"/v1/orgs/{orgId}/usage":{"get":{"tags":["Billing"],"summary":"Usage and remaining quota for the current period","description":"Computed server-side from the append-only usage ledger. Billable unit: accepted events (after de-duplication); retries and test events are not billed.\n\nAPI key scope: `usage:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing":{"get":{"tags":["Billing"],"summary":"Billing overview: plan, status, renewal, usage","description":"API key scope: `usage:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"stripeConfigured":{"type":"boolean"},"quota":{"type":"object","additionalProperties":{}},"subscription":{"type":"object","additionalProperties":{}},"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}}},"required":["stripeConfigured","quota","subscription","plans"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/usage-series":{"get":{"tags":["Billing"],"summary":"Daily usage in the current period","description":"API key scope: `usage:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}},"required":["start","end"]},"limit":{"type":"integer"},"points":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"events":{"type":"integer"},"cumulative":{"type":"integer"}},"required":["date","events","cumulative"]}}},"required":["period","limit","points"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/invoices":{"get":{"tags":["Billing"],"summary":"Invoice history","description":"API key scope: `usage:read`.","security":[{"apiKey":[]},{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"},"amountDueCents":{"type":"integer"},"amountPaidCents":{"type":"integer"},"currency":{"type":"string"},"hostedUrl":{"type":["string","null"]},"pdfUrl":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","amountDueCents","amountPaidCents","currency","hostedUrl","pdfUrl","createdAt"]}}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/checkout":{"post":{"tags":["Billing"],"summary":"Start a Stripe Checkout session for a plan","description":"Requires the billing:manage permission (Owner, Billing Manager). Trial applies on a first subscription. Promotion codes are accepted at checkout.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planCode":{"type":"string"},"interval":{"type":"string","enum":["month","year"],"default":"month"}},"required":["planCode"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/portal":{"post":{"tags":["Billing"],"summary":"Open the Stripe customer portal (payment methods, invoices)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/change-plan":{"post":{"tags":["Billing"],"summary":"Upgrade/downgrade an existing subscription (prorated)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"planCode":{"type":"string"},"interval":{"type":"string","enum":["month","year"],"default":"month"}},"required":["planCode"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/cancel":{"post":{"tags":["Billing"],"summary":"Cancel at the end of the current period","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{orgId}/billing/resume":{"post":{"tags":["Billing"],"summary":"Undo a pending cancellation","security":[{"session":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden / missing scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (also returned for resources of other organizations)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/stripe/webhook":{"post":{"tags":["Billing"],"summary":"Stripe webhook receiver","description":"Verifies the Stripe-Signature over the raw body (5 minute tolerance), stores the event id, and processes idempotently by re-fetching Stripe state. Intended for Stripe only.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"received":{"type":"boolean","enum":[true]},"outcome":{"type":"string","enum":["processed","duplicate","ignored"]}},"required":["received","outcome"]}}}}}}},"/v1/platform/status":{"get":{"tags":["Billing"],"summary":"Public platform state","description":"Registration, maintenance and announcement state used by the web app. Contains no secrets.","security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"registrationEnabled":{"type":"boolean"},"maintenance":{"type":"boolean"},"announcement":{"type":["object","null"],"properties":{"level":{"type":"string"},"message":{"type":"string"}},"required":["level","message"]},"flags":{"type":"object","additionalProperties":{"type":"boolean"}},"billingEnabled":{"type":"boolean"},"emailVerificationRequired":{"type":"boolean"}},"required":["registrationEnabled","maintenance","announcement","flags","billingEnabled","emailVerificationRequired"]}}}}}}},"/v1/contact":{"post":{"tags":["Billing"],"summary":"Send a message to the Retryx team (contact form)","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email"},"company":{"type":"string"},"message":{"type":"string","minLength":10}},"required":["name","email","message"]}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}}}}}},"webhooks":{}}