{"openapi":"3.1.0","info":{"title":"Hookstead API","version":"local","description":"Manage sources, destinations, events and deliveries. Authenticate with an API key (`Authorization: Bearer hw_live_…`, created in Settings → API keys), or a signed-in browser session. Errors are `application/problem+json` with a stable `code`."},"servers":[{"url":"https://hookstead.dev/api/v1"}],"security":[{"apiKey":[]},{"session":[]}],"tags":[{"name":"Account"},{"name":"Organizations"},{"name":"Workspaces"},{"name":"Billing"},{"name":"Sources"},{"name":"Destinations"},{"name":"Connections"},{"name":"Events"},{"name":"Deliveries"},{"name":"Monitoring"}],"paths":{"/me":{"get":{"operationId":"get_me","tags":["Account"],"summary":"Who am I","description":"**Minimum role:** VIEWER.","responses":{"200":{"description":"The caller: a user, or an API key with its organization and role.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/organizations":{"get":{"operationId":"get_organizations","tags":["Organizations"],"summary":"List my organizations","description":"**Minimum role:** VIEWER.","responses":{"200":{"description":"Organizations the caller belongs to, with their role.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_organizations","tags":["Organizations"],"summary":"Create an organization","description":"The caller becomes OWNER; a default `production` workspace is created.\n\n**Minimum role:** VIEWER.\n\nSigned-in users only (not API keys).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$"}},"required":["name","slug"]}}}},"responses":{"201":{"description":"The organization.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}},"security":[{"session":[]}]}},"/organizations/{orgId}":{"get":{"operationId":"get_organizations_by_orgId","tags":["Organizations"],"summary":"Get an organization","description":"**Minimum role:** VIEWER.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"responses":{"200":{"description":"The organization and the caller's role.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"patch":{"operationId":"patch_organizations_by_orgId","tags":["Organizations"],"summary":"Rename or change the URL of an organization","description":"**Minimum role:** ADMIN.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$"}}}}}},"responses":{"200":{"description":"The updated organization.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/organizations/{orgId}/members":{"get":{"operationId":"get_organizations_by_orgId_members","tags":["Organizations"],"summary":"List members","description":"**Minimum role:** VIEWER.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"responses":{"200":{"description":"Members with their roles.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/organizations/{orgId}/workspaces":{"get":{"operationId":"get_organizations_by_orgId_workspaces","tags":["Workspaces"],"summary":"List workspaces","description":"**Minimum role:** VIEWER.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"responses":{"200":{"description":"Workspaces of the organization.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_organizations_by_orgId_workspaces","tags":["Workspaces"],"summary":"Create a workspace","description":"Counts toward the plan's workspace limit (`403 plan_limit_reached`).\n\n**Minimum role:** ADMIN.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$"}},"required":["name","slug"]}}}},"responses":{"201":{"description":"The workspace.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}":{"get":{"operationId":"get_workspaces_by_wsId","tags":["Workspaces"],"summary":"Get a workspace","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"200":{"description":"The workspace.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"patch":{"operationId":"patch_workspaces_by_wsId","tags":["Workspaces"],"summary":"Update a workspace","description":"**Minimum role:** ADMIN.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"slug":{"type":"string","minLength":2,"maxLength":48,"pattern":"^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$"}}}}}},"responses":{"200":{"description":"The updated workspace.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"delete":{"operationId":"delete_workspaces_by_wsId","tags":["Workspaces"],"summary":"Delete a workspace and everything in it","description":"**Minimum role:** ADMIN.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/organizations/{orgId}/billing":{"get":{"operationId":"get_organizations_by_orgId_billing","tags":["Billing"],"summary":"Plan, usage and limits","description":"Usage counts ingested events plus replayed deliveries in the current UTC month.\n\n**Minimum role:** VIEWER.","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"responses":{"200":{"description":"`{billingEnabled, plan, status, currentPeriodEnd, cancelAtPeriodEnd, entitledPlan, entitledUntil, graceEndsAt, usage, limits}`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/organizations/{orgId}/billing/checkout":{"post":{"operationId":"post_organizations_by_orgId_billing_checkout","tags":["Billing"],"summary":"Start Stripe Checkout for a paid plan","description":"Return URLs are fixed on the server. `409` if a subscription exists (use the portal).\n\n**Minimum role:** OWNER.\n\nSigned-in users only (not API keys).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Same key + same body returns the stored response; kept 24 h."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["PRO","TEAM"]},"interval":{"default":"month","type":"string","enum":["month","year"]}},"required":["plan"]}}}},"responses":{"200":{"description":"`{url}`: redirect the user there.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}},"security":[{"session":[]}]}},"/organizations/{orgId}/billing/portal":{"post":{"operationId":"post_organizations_by_orgId_billing_portal","tags":["Billing"],"summary":"Open the Stripe customer portal","description":"**Minimum role:** OWNER.\n\nSigned-in users only (not API keys).","parameters":[{"name":"orgId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Organization id"}],"responses":{"200":{"description":"`{url}`: redirect the user there.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}},"security":[{"session":[]}]}},"/workspaces/{wsId}/sources":{"get":{"operationId":"get_workspaces_by_wsId_sources","tags":["Sources"],"summary":"List sources","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"200":{"description":"Sources with their ingest URLs. Secrets are never returned (`hasSecret`).","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_workspaces_by_wsId_sources","tags":["Sources"],"summary":"Create a source","description":"Senders POST webhooks to the returned `ingestUrl`. Plan limits apply.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"provider":{"default":null,"anyOf":[{"type":"string","enum":["stripe","lemonsqueezy","quickbooks","paypal","shopify","github","gitlab","linear","dockerhub","vercel","aws-sns","hubspot","openai","clerk","supabase","standard-webhooks","custom"]},{"type":"null"}]},"authType":{"default":"NONE","type":"string","enum":["NONE","HMAC_SHA256","STRIPE","GITHUB","SHOPIFY","STANDARD_WEBHOOKS","BASIC_AUTH","HEADER_TOKEN","VERCEL","HUBSPOT","AWS_SNS","PAYPAL"]},"authConfig":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authSecret":{"type":"string","maxLength":1024},"allowedMethods":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]}},"maxBodyBytes":{"type":"integer","minimum":1024,"maximum":9007199254740991},"dedupeStrategy":{"anyOf":[{"anyOf":[{"type":"object","properties":{"header":{"type":"string","pattern":"^[a-z0-9!#$%&'*+.^_`|~-]{1,100}$"}},"required":["header"],"additionalProperties":false},{"type":"object","properties":{"jsonPath":{"type":"string"}},"required":["jsonPath"],"additionalProperties":false}]},{"type":"null"}]},"dedupeWindowSec":{"default":604800,"type":"integer","minimum":60,"maximum":2592000},"redactionRules":{"default":{"headers":[],"keys":[]},"type":"object","properties":{"headers":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-.*]+$"}},"keys":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-.*]+$"}}},"additionalProperties":false},"responseStatus":{"default":202,"anyOf":[{"type":"number","const":200},{"type":"number","const":201},{"type":"number","const":202},{"type":"number","const":204}]}},"required":["name"]}}}},"responses":{"201":{"description":"The source, with its ingest URL.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/sources/{sourceId}":{"get":{"operationId":"get_workspaces_by_wsId_sources_by_sourceId","tags":["Sources"],"summary":"Get a source","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"sourceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Source id"}],"responses":{"200":{"description":"The source.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"patch":{"operationId":"patch_workspaces_by_wsId_sources_by_sourceId","tags":["Sources"],"summary":"Update a source","description":"Changing `authType`, `authConfig`, `authSecret` or `redactionRules` needs ADMIN.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"sourceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Source id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"provider":{"anyOf":[{"type":"string","enum":["stripe","lemonsqueezy","quickbooks","paypal","shopify","github","gitlab","linear","dockerhub","vercel","aws-sns","hubspot","openai","clerk","supabase","standard-webhooks","custom"]},{"type":"null"}]},"authType":{"type":"string","enum":["NONE","HMAC_SHA256","STRIPE","GITHUB","SHOPIFY","STANDARD_WEBHOOKS","BASIC_AUTH","HEADER_TOKEN","VERCEL","HUBSPOT","AWS_SNS","PAYPAL"]},"authConfig":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"authSecret":{"type":"string","maxLength":1024},"allowedMethods":{"minItems":1,"maxItems":6,"type":"array","items":{"type":"string","enum":["GET","HEAD","POST","PUT","PATCH","DELETE"]}},"maxBodyBytes":{"type":"integer","minimum":1024,"maximum":9007199254740991},"dedupeStrategy":{"anyOf":[{"anyOf":[{"type":"object","properties":{"header":{"type":"string","pattern":"^[a-z0-9!#$%&'*+.^_`|~-]{1,100}$"}},"required":["header"],"additionalProperties":false},{"type":"object","properties":{"jsonPath":{"type":"string"}},"required":["jsonPath"],"additionalProperties":false}]},{"type":"null"}]},"dedupeWindowSec":{"type":"integer","minimum":60,"maximum":2592000},"redactionRules":{"type":"object","properties":{"headers":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-.*]+$"}},"keys":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_\\-.*]+$"}}},"additionalProperties":false},"responseStatus":{"anyOf":[{"type":"number","const":200},{"type":"number","const":201},{"type":"number","const":202},{"type":"number","const":204}]},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The updated source.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"delete":{"operationId":"delete_workspaces_by_wsId_sources_by_sourceId","tags":["Sources"],"summary":"Delete a source","description":"Its ingest URL stops working immediately.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"sourceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Source id"}],"responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/sources/{sourceId}/rotate-token":{"post":{"operationId":"post_workspaces_by_wsId_sources_by_sourceId_rotate_token","tags":["Sources"],"summary":"Rotate the ingest URL","description":"The old URL returns 404 immediately.\n\n**Minimum role:** ADMIN.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"sourceId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Source id"}],"responses":{"200":{"description":"The source with its new ingest URL.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations":{"get":{"operationId":"get_workspaces_by_wsId_destinations","tags":["Destinations"],"summary":"List destinations","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"200":{"description":"Destinations with health. Header values are masked.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_workspaces_by_wsId_destinations","tags":["Destinations"],"summary":"Create a destination","description":"The response contains the signing secret (`whsec_…`) **once**. Plan limits apply.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","minLength":1,"maxLength":2048},"method":{"default":"POST","type":"string","enum":["POST","PUT","PATCH"]},"headers":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"},"additionalProperties":{"type":"string","maxLength":2048,"pattern":"^[\\t\\x20-\\x7e\\x80-\\xff]*$"}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":9007199254740991},"maxAttempts":{"type":"integer","minimum":1,"maximum":9007199254740991},"backoffBaseMs":{"default":30000,"type":"integer","minimum":1000,"maximum":3600000},"backoffMaxMs":{"default":21600000,"type":"integer","minimum":1000,"maximum":86400000},"retryOn4xx":{"default":false,"type":"boolean"},"maxConcurrency":{"default":10,"type":"integer","minimum":1,"maximum":100},"successCodes":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}},"required":["name","url"]}}}},"responses":{"201":{"description":"The destination and its `signingSecret`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations/{destinationId}":{"get":{"operationId":"get_workspaces_by_wsId_destinations_by_destinationId","tags":["Destinations"],"summary":"Get a destination","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"responses":{"200":{"description":"The destination.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"patch":{"operationId":"patch_workspaces_by_wsId_destinations_by_destinationId","tags":["Destinations"],"summary":"Update a destination","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","minLength":1,"maxLength":2048},"method":{"type":"string","enum":["POST","PUT","PATCH"]},"headers":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"},"additionalProperties":{"type":"string","maxLength":2048,"pattern":"^[\\t\\x20-\\x7e\\x80-\\xff]*$"}},"timeoutMs":{"type":"integer","minimum":1000,"maximum":9007199254740991},"maxAttempts":{"type":"integer","minimum":1,"maximum":9007199254740991},"backoffBaseMs":{"type":"integer","minimum":1000,"maximum":3600000},"backoffMaxMs":{"type":"integer","minimum":1000,"maximum":86400000},"retryOn4xx":{"type":"boolean"},"maxConcurrency":{"type":"integer","minimum":1,"maximum":100},"successCodes":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"The updated destination.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"delete":{"operationId":"delete_workspaces_by_wsId_destinations_by_destinationId","tags":["Destinations"],"summary":"Delete a destination","description":"Pending deliveries to it are cancelled.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations/{destinationId}/pause":{"post":{"operationId":"post_workspaces_by_wsId_destinations_by_destinationId_pause","tags":["Destinations"],"summary":"Pause deliveries","description":"New deliveries are held until resumed.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"responses":{"200":{"description":"The destination.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations/{destinationId}/resume":{"post":{"operationId":"post_workspaces_by_wsId_destinations_by_destinationId_resume","tags":["Destinations"],"summary":"Resume deliveries","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"responses":{"200":{"description":"The destination.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations/{destinationId}/rotate-signing-secret":{"post":{"operationId":"post_workspaces_by_wsId_destinations_by_destinationId_rotate_signing_secret","tags":["Destinations"],"summary":"Rotate the signing secret","description":"During `overlapHours` both secrets sign every delivery.\n\n**Minimum role:** ADMIN.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"overlapHours":{"default":0,"type":"integer","minimum":0,"maximum":72}}}}}},"responses":{"200":{"description":"The destination and its new `signingSecret` (shown once).","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/destinations/{destinationId}/health":{"get":{"operationId":"get_workspaces_by_wsId_destinations_by_destinationId_health","tags":["Destinations"],"summary":"Health and hourly stats","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"destinationId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Destination id"},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["hour","day"]}}],"responses":{"200":{"description":"Current health and an hourly series of attempts.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/connections":{"get":{"operationId":"get_workspaces_by_wsId_connections","tags":["Connections"],"summary":"List connections","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"200":{"description":"Source → destination connections.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_workspaces_by_wsId_connections","tags":["Connections"],"summary":"Connect a source to a destination","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sourceId":{"type":"string"},"destinationId":{"type":"string"}},"required":["sourceId","destinationId"]}}}},"responses":{"201":{"description":"The connection.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/connections/{connectionId}":{"patch":{"operationId":"patch_workspaces_by_wsId_connections_by_connectionId","tags":["Connections"],"summary":"Enable or disable a connection","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"connectionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Connection id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"The connection.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"delete":{"operationId":"delete_workspaces_by_wsId_connections_by_connectionId","tags":["Connections"],"summary":"Delete a connection","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"connectionId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Connection id"}],"responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/events":{"get":{"operationId":"get_workspaces_by_wsId_events","tags":["Events"],"summary":"Search events","description":"Newest first, keyset pagination (`cursor`).\n\n**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"sourceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"deliveryStatus","in":"query","required":false,"schema":{"maxItems":10,"type":"array","items":{"type":"string","enum":["PENDING","SCHEDULED","IN_FLIGHT","SUCCEEDED","DEAD","CANCELLED"]}}},{"name":"errorClass","in":"query","required":false,"schema":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z0-9_]{2,40}$"}}},{"name":"httpStatus","in":"query","required":false,"schema":{"type":"integer","minimum":100,"maximum":599}},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":3,"maxLength":200}},{"name":"header","in":"query","required":false,"schema":{"maxItems":5,"type":"array","items":{"type":"string"}}},{"name":"jsonPath","in":"query","required":false,"schema":{"type":"string","maxLength":600}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"`{data, nextCursor}`; bodies and headers are the redacted copies.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/events/{eventId}":{"get":{"operationId":"get_workspaces_by_wsId_events_by_eventId","tags":["Events"],"summary":"Get an event","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Event id"}],"responses":{"200":{"description":"The event (redacted) and its deliveries.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/events/{eventId}/raw":{"get":{"operationId":"get_workspaces_by_wsId_events_by_eventId_raw","tags":["Events"],"summary":"Get the original request (decrypted)","description":"ADMIN only; every view is audit-logged.\n\n**Minimum role:** ADMIN.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Event id"}],"responses":{"200":{"description":"Original headers and body, as received.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/events/{eventId}/replay":{"post":{"operationId":"post_workspaces_by_wsId_events_by_eventId_replay","tags":["Events"],"summary":"Replay an event","description":"Creates new deliveries (to the connected destinations, or `destinationIds`). Counts toward the monthly quota; rate limited.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Event id"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Same key + same body returns the stored response; kept 24 h."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destinationIds":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"string"}}}}}}},"responses":{"202":{"description":"`{deliveries: [{id, destinationId}]}`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/deliveries":{"get":{"operationId":"get_workspaces_by_wsId_deliveries","tags":["Deliveries"],"summary":"Search deliveries","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"status","in":"query","required":false,"schema":{"maxItems":10,"type":"array","items":{"type":"string","enum":["PENDING","SCHEDULED","IN_FLIGHT","SUCCEEDED","DEAD","CANCELLED"]}}},{"name":"destinationId","in":"query","required":false,"schema":{"type":"string"}},{"name":"sourceId","in":"query","required":false,"schema":{"type":"string"}},{"name":"eventId","in":"query","required":false,"schema":{"type":"string"}},{"name":"errorClass","in":"query","required":false,"schema":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z0-9_]{2,40}$"}}},{"name":"httpStatus","in":"query","required":false,"schema":{"type":"integer","minimum":100,"maximum":599}},{"name":"trigger","in":"query","required":false,"schema":{"type":"string","enum":["INITIAL","MANUAL_RETRY","REPLAY"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"`{data, nextCursor}`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/deliveries/{deliveryId}":{"get":{"operationId":"get_workspaces_by_wsId_deliveries_by_deliveryId","tags":["Deliveries"],"summary":"Get a delivery and its attempts","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Delivery id"}],"responses":{"200":{"description":"The delivery with every attempt's request and response (headers masked).","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/deliveries/{deliveryId}/retry":{"post":{"operationId":"post_workspaces_by_wsId_deliveries_by_deliveryId_retry","tags":["Deliveries"],"summary":"Retry a delivery now","description":"`409` while it's in flight or after it succeeded (replay the event instead).\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Delivery id"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Same key + same body returns the stored response; kept 24 h."}],"responses":{"202":{"description":"The delivery, queued.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/deliveries/{deliveryId}/cancel":{"post":{"operationId":"post_workspaces_by_wsId_deliveries_by_deliveryId_cancel","tags":["Deliveries"],"summary":"Cancel a pending delivery","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Delivery id"}],"responses":{"200":{"description":"The delivery.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/deliveries/bulk-retry":{"post":{"operationId":"post_workspaces_by_wsId_deliveries_bulk_retry","tags":["Deliveries"],"summary":"Retry many deliveries","description":"Up to 1,000 matching deliveries, as a background job. `dryRun` only counts.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","maxLength":255},"description":"Same key + same body returns the stored response; kept 24 h."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filter":{"default":{},"type":"object","properties":{"status":{"maxItems":10,"type":"array","items":{"type":"string","enum":["PENDING","SCHEDULED","IN_FLIGHT","SUCCEEDED","DEAD","CANCELLED"]}},"destinationId":{"type":"string"},"sourceId":{"type":"string"},"eventId":{"type":"string"},"errorClass":{"maxItems":10,"type":"array","items":{"type":"string","pattern":"^[A-Z0-9_]{2,40}$"}},"httpStatus":{"type":"integer","minimum":100,"maximum":599},"trigger":{"type":"string","enum":["INITIAL","MANUAL_RETRY","REPLAY"]},"from":{"type":"string"},"to":{"type":"string"}}},"dryRun":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"Dry run: `{jobId: null, matched, capped}`.","content":{"application/json":{}}},"202":{"description":"`{jobId, matched, capped}`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/jobs/{jobId}":{"get":{"operationId":"get_workspaces_by_wsId_jobs_by_jobId","tags":["Deliveries"],"summary":"Bulk job progress","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"jobId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Bulk job id"}],"responses":{"200":{"description":"The job's status and counts.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/metrics":{"get":{"operationId":"get_workspaces_by_wsId_metrics","tags":["Monitoring"],"summary":"Workspace metrics","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"from","in":"query","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","required":false,"schema":{"type":"string"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["hour","day"]}}],"responses":{"200":{"description":"Totals and an hourly or daily series of events, attempts and latency.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/alert-rules":{"get":{"operationId":"get_workspaces_by_wsId_alert_rules","tags":["Monitoring"],"summary":"List alert rules","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"responses":{"200":{"description":"Alert rules.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"post":{"operationId":"post_workspaces_by_wsId_alert_rules","tags":["Monitoring"],"summary":"Create an alert rule","description":"Recipients must be members of the organization.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["FAILURE_RATE","CONSECUTIVE_FAILURES","DEAD_DELIVERIES","SOURCE_INACTIVE"]},"subjectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"threshold":{"type":"number","minimum":0,"maximum":1000000},"windowSec":{"type":"integer","minimum":60,"maximum":604800},"minSamples":{"default":10,"type":"integer","minimum":1,"maximum":100000},"cooldownSec":{"default":3600,"type":"integer","minimum":0,"maximum":604800},"recipients":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"enabled":{"default":true,"type":"boolean"}},"required":["name","type","threshold","windowSec","recipients"]}}}},"responses":{"201":{"description":"The rule.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/alert-rules/{ruleId}":{"get":{"operationId":"get_workspaces_by_wsId_alert_rules_by_ruleId","tags":["Monitoring"],"summary":"Get an alert rule","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Alert rule id"}],"responses":{"200":{"description":"The rule.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"patch":{"operationId":"patch_workspaces_by_wsId_alert_rules_by_ruleId","tags":["Monitoring"],"summary":"Update an alert rule","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Alert rule id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"subjectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"threshold":{"type":"number","minimum":0,"maximum":1000000},"windowSec":{"type":"integer","minimum":60,"maximum":604800},"minSamples":{"type":"integer","minimum":1,"maximum":100000},"cooldownSec":{"type":"integer","minimum":0,"maximum":604800},"recipients":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The rule.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}},"delete":{"operationId":"delete_workspaces_by_wsId_alert_rules_by_ruleId","tags":["Monitoring"],"summary":"Delete an alert rule","description":"Its open incidents close without email.\n\n**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Alert rule id"}],"responses":{"204":{"description":"Deleted."},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/incidents":{"get":{"operationId":"get_workspaces_by_wsId_incidents","tags":["Monitoring"],"summary":"List incidents","description":"**Minimum role:** VIEWER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["OPEN","RESOLVED"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"`{data, nextCursor}`.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}},"/workspaces/{wsId}/incidents/{incidentId}/acknowledge":{"post":{"operationId":"post_workspaces_by_wsId_incidents_by_incidentId_acknowledge","tags":["Monitoring"],"summary":"Acknowledge an incident","description":"**Minimum role:** MEMBER.","parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Workspace id"},{"name":"incidentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Incident id"}],"responses":{"200":{"description":"The incident.","content":{"application/json":{}}},"400":{"$ref":"#/components/responses/E400","description":"Malformed request (bad JSON)."},"401":{"$ref":"#/components/responses/E401","description":"Missing or invalid credentials."},"403":{"$ref":"#/components/responses/E403","description":"Your role doesn't allow it, or `plan_limit_reached`."},"404":{"$ref":"#/components/responses/E404","description":"Not found, or not yours. Other tenants' resources always look like this."},"409":{"$ref":"#/components/responses/E409","description":"Conflict or invalid state; `idempotency_in_progress`."},"422":{"$ref":"#/components/responses/E422","description":"Validation failed (`errors` lists each field); `idempotency_key_reused`."},"429":{"$ref":"#/components/responses/E429","description":"`rate_limited` or `quota_exceeded`, with `Retry-After`."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key: `hw_live_…`."},"session":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"Browser session (same-origin requests only)."}},"schemas":{"Problem":{"type":"object","required":["type","title","status","code","requestId"],"properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer"},"code":{"type":"string","examples":["not_found","validation_failed","quota_exceeded"]},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}}},"responses":{"E400":{"description":"Malformed request (bad JSON).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E401":{"description":"Missing or invalid credentials.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E403":{"description":"Your role doesn't allow it, or `plan_limit_reached`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E404":{"description":"Not found, or not yours. Other tenants' resources always look like this.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E409":{"description":"Conflict or invalid state; `idempotency_in_progress`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E422":{"description":"Validation failed (`errors` lists each field); `idempotency_key_reused`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"E429":{"description":"`rate_limited` or `quota_exceeded`, with `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}