{"openapi":"3.1.0","info":{"title":"STATXE Public API","version":"1.0.0","description":"Production public API for inbox, outbox, contacts, segments, automations, templates, metrics, and webhooks. Human docs: https://docs.statxe.com — OpenAPI only covers the public `/api/v1` surface (no provider or admin routes).","contact":{"url":"https://docs.statxe.com"}},"externalDocs":{"description":"STATXE developer documentation","url":"https://docs.statxe.com"},"servers":[{"url":"https://api.statxe.com/api/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Getting Started"},{"name":"Domains"},{"name":"Contacts"},{"name":"Segments"},{"name":"Automations"},{"name":"Templates"},{"name":"Metrics"},{"name":"Inbox"},{"name":"Outbox"},{"name":"Webhooks"}],"paths":{"/me":{"get":{"tags":["Getting Started"],"summary":"Test an API key","description":"Returns the authenticated org, key id, scopes, and rate-limit profile.","x-required-scopes":["me:read"],"responses":{"200":{"description":"Current API key details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/domains":{"get":{"tags":["Domains"],"summary":"List sending domain options","description":"Returns verified sending domains in the workspace with available sender identities per domain.","x-required-scopes":["domains:read"],"responses":{"200":{"description":"Domain options","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainOptionListEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/contacts":{"get":{"tags":["Contacts"],"summary":"List contacts","x-required-scopes":["contacts:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Contact list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Contacts"],"summary":"Create a contact","x-required-scopes":["contacts:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactRequest"}}}},"responses":{"201":{"description":"Created contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Unprocessable — well-formed but rejected by a business rule (e.g. the contact email failed quality validation). See the error `details`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/contacts/{id}":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"get":{"tags":["Contacts"],"summary":"Retrieve a contact","x-required-scopes":["contacts:read"],"responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Contacts"],"summary":"Update a contact","x-required-scopes":["contacts:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactRequest"}}}},"responses":{"200":{"description":"Updated contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Contacts"],"summary":"Delete a contact","x-required-scopes":["contacts:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Deleted contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/segments":{"get":{"tags":["Segments"],"summary":"List segments","x-required-scopes":["segments:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Segment list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Segments"],"summary":"Create a segment","x-required-scopes":["segments:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSegmentRequest"}}}},"responses":{"201":{"description":"Created segment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/automations":{"get":{"tags":["Automations"],"summary":"List automations","x-required-scopes":["automations:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Automation list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/automations/{id}":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"get":{"tags":["Automations"],"summary":"Retrieve an automation","x-required-scopes":["automations:read"],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Automations"],"summary":"Update an automation","description":"Updates name, description, and/or status (draft/active/paused/archived). Creating or editing an automation's workflow (trigger, steps) is not yet supported over the API — use the dashboard.","x-required-scopes":["automations:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutomationRequest"}}}},"responses":{"200":{"description":"Updated automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Automations"],"summary":"Delete (archive) an automation","x-required-scopes":["automations:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Deleted automation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List templates","x-required-scopes":["templates:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Template list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Templates"],"summary":"Create a template","x-required-scopes":["templates:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateRequest"}}}},"responses":{"201":{"description":"Created template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/templates/{id}":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"get":{"tags":["Templates"],"summary":"Retrieve a template","x-required-scopes":["templates:read"],"responses":{"200":{"description":"Template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["Templates"],"summary":"Update a template","x-required-scopes":["templates:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateRequest"}}}},"responses":{"200":{"description":"Updated template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Templates"],"summary":"Delete a template","description":"Deletes the template if you own it. If you can only see it via org-sharing, this hides it for you instead — the response's `hidden` field tells you which happened.","x-required-scopes":["templates:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"Deleted or hidden template","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/metrics":{"get":{"tags":["Metrics"],"summary":"Get send/engagement metrics summary","description":"Aggregate send, delivery, engagement, and contact-health metrics for a period.","x-required-scopes":["metrics:read"],"parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","enum":["7d","14d","30d","90d"],"default":"7d"}}],"responses":{"200":{"description":"Metrics summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsSummaryEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/inbox/threads":{"get":{"tags":["Inbox"],"summary":"List inbox threads","x-required-scopes":["inbox.threads:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Inbox thread list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxThreadListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/inbox/messages":{"get":{"tags":["Inbox"],"summary":"List incoming and outgoing messages by update cursor","description":"Ascending updated_at then ID. Poll with the last cursor; overlap updated_after when reconciling imports. Re-fetch attachments while attachments_ready is false.","x-required-scopes":["inbox.threads:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"name":"thread_id","in":"query","schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}},{"name":"updated_after","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"direction","in":"query","schema":{"type":"string","enum":["inbound","outbound"]}},{"name":"scope","in":"query","schema":{"type":"string","enum":["mine","team"]}},{"name":"include","in":"query","description":"`html` adds each message's sanitized HTML body (`html`).","schema":{"type":"string","enum":["html"]}}],"responses":{"200":{"description":"Message list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessageListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Inbox"],"summary":"Send a conversation email","description":"Sends 1:1 email as the caller from a mailbox they may use (their login email or an inbox assigned to them; owners and admins may use any). It is the dashboard inbox send: no email credits, the sender's signature added (see `html_signature` on GET /domains — never paste it yourself), suppressed recipients refused, and threading headers when it answers a message (`reply_to_message_id`, or `thread_id` to answer that thread's latest message).\n\nBecause it is free, it stays a conversation: one `to`, up to 5 `cc`, no `bcc`. A new thread counts against the sending domain's daily limit and is refused with 429 when the domain is full; a reply is never refused for volume. `include_footer: true` adds the legal footer (company, address, unsubscribe link) and List-Unsubscribe headers.","x-required-scopes":["inbox.messages:send"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendInboxMessageRequest"}}}},"responses":{"202":{"description":"Message accepted for delivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessageSentEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The workspace's plan does not include sending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"`reply_to_message_id` or `thread_id` was not found, or you cannot see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"The sender is not yours to use, or a footer was asked for and the brand has no legal address. `details.reason` is SENDER_NOT_ASSIGNED or LEGAL_IDENTITY_MISSING.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The delivery provider rejected the message. Nothing was sent; safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/inbox/messages/{id}":{"get":{"tags":["Inbox"],"summary":"Read an authorized message and reply correlation","x-required-scopes":["inbox.threads:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"description":"Includes `html`, the body sanitized the way the inbox shows it.","responses":{"200":{"description":"Message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxMessageEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Message not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/inbox/messages/{id}/attachments/{attachmentId}":{"get":{"tags":["Inbox"],"summary":"Download an authorized message attachment","x-required-scopes":["inbox.threads:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}},{"name":"attachmentId","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-fA-F0-9]{24}$"}}],"responses":{"200":{"description":"Private attachment bytes; consumers must scan before extraction","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Attachment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/broadcasts":{"get":{"tags":["Outbox"],"summary":"List broadcasts","x-required-scopes":["outbox.broadcasts:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Broadcast list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Outbox"],"summary":"Draft a broadcast","x-required-scopes":["outbox.broadcasts:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBroadcastRequest"}}}},"responses":{"201":{"description":"Created broadcast","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/emails":{"post":{"tags":["Outbox"],"summary":"Send a transactional email","description":"Sends one transactional email from an address on a sendable workspace domain. Consumes one transactional credit per recipient (to + cc + bcc) and counts against the sending domain's daily warm-up cap. Returns 202 once the message is accepted for delivery — delivery outcome arrives on your webhooks.\n\nSender merge fields are filled for the From address's domain in subject, html and text: `{{website}}`, `{{form}}` (the domain's default published form), `{{form:slug}}`, `{{link.N}}` and `{{company_name}}`. Every other `{{…}}`, contact fields included, is left for you to fill before calling. Add `|fallback` (`{{form|https://example.com/contact}}`) to send the fallback when the domain has no value; without one, a merge field with no value is refused with 422.","x-required-scopes":["outbox.transactional:send"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTransactionalEmailRequest"}}}},"responses":{"202":{"description":"Message accepted for delivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionalEmailEnvelope"}}}},"400":{"description":"Rejected before delivery. `details.reason` is one of INVALID_FROM, NO_RECIPIENTS, TOO_MANY_RECIPIENTS, EMPTY_BODY, TOO_MANY_ATTACHMENTS, or INVALID_ATTACHMENT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Out of email credits (`error.code` insufficient_credits) with overage off, or the plan does not include sending. Nothing is sent or billed and the Idempotency-Key is released: top up or wait for `credits.email.resets_at` on GET /me, then retry the same request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Forbidden — sender domain is missing, not ready, or needs attention, or a recipient is suppressed. `details.reason` is one of DOMAIN_NOT_FOUND, DOMAIN_NOT_READY, DOMAIN_ATTENTION, DOMAIN_REPUTATION_RECOVERY, or RECIPIENT_SUPPRESSED.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"A referenced `attachment_id` does not exist in this workspace. `details.reason` is INVALID_ATTACHMENT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Payload too large. `details.reason` is REQUEST_TOO_LARGE (the raw request body exceeded the route's byte ceiling), MESSAGE_TOO_LARGE (body over 25 MB), or ATTACHMENT_TOO_LARGE (a single attachment over 12 MB, or body plus attachments over 25 MB).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"A sender merge field has no value for the From domain (no published or default form, no URL for link N on that domain, no company name). `details.reason` is SENDER_TOKEN_UNRESOLVED, `details.tokens` lists them (e.g. `[\"{{form}}\"]`) and `details.apex` names the domain. Nothing is sent or billed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The upstream delivery provider rejected the message. Credits and domain quota are released; safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/emails/{id}":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"patch":{"tags":["Outbox"],"summary":"Reschedule a scheduled email","description":"Moves an email sent with `scheduled_at` to a new time, while it is still waiting.","x-required-scopes":["outbox.transactional:send"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RescheduleEmailRequest"}}}},"responses":{"200":{"description":"Rescheduled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledEmailEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The email is no longer waiting to send (sent, canceled), or the provider refused. `details.reason` is NOT_SCHEDULED or PROVIDER_REFUSED.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/emails/{id}/cancel":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"post":{"tags":["Outbox"],"summary":"Cancel a scheduled email","description":"Cancels an email sent with `scheduled_at` before it goes out. The balance credits it spent are refunded (`credits_refunded`); overage already billed is not.","x-required-scopes":["outbox.transactional:send"],"responses":{"200":{"description":"Canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledEmailEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The email is no longer waiting to send, or the provider refused. `details.reason` is NOT_SCHEDULED or PROVIDER_REFUSED.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/marketing":{"post":{"tags":["Outbox"],"summary":"Send one marketing email","description":"Sends one marketing email to one existing contact — a flow step run by your app. Like an automation email: the contact must be validated, and is promoted into a free premium contact slot (no email credit is spent); the legal footer, a signed unsubscribe link and List-Unsubscribe headers are added; contact merge fields and sender merge fields are filled; `<style>` blocks survive.\n\nWhen the sender's domain is at its daily or hourly limit the send is queued: the answer is 202 with `status: \"queued\"`, an `id` to poll at GET /outbox/marketing/{id}, and `resume_at`. Pass `queue_if_full: false` to get 429 instead.","x-required-scopes":["outbox.marketing:send"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMarketingEmailRequest"}}}},"responses":{"202":{"description":"Sent, or queued until the domain has room","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingSendEnvelope"}}}},"400":{"description":"Invalid body, or the contact is not validated yet (`details.reason` CONTACT_NOT_VALIDATED, retryable once validated).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"The workspace's plan does not include sending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"The contact does not exist. `details.reason` is CONTACT_NOT_FOUND.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Every premium slot is taken (PREMIUM_CAP_REACHED), the contact paused marketing email (CONTACT_PAUSED), or an Idempotency-Key conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Sender not yours to use, no legal address for the brand, or an unfilled sender merge field. `details.reason` is SENDER_NOT_FOUND, SENDER_NOT_ASSIGNED, LEGAL_IDENTITY_MISSING or SENDER_TOKEN_UNRESOLVED.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The delivery provider rejected the message. Nothing was sent; safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Premium promotion failed. Safe to retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/marketing/{id}":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"get":{"tags":["Outbox"],"summary":"Get a queued marketing send","x-required-scopes":["outbox.marketing:send"],"responses":{"200":{"description":"Queued send","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingQueueItemEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Outbox"],"summary":"Cancel a queued marketing send","x-required-scopes":["outbox.marketing:send"],"responses":{"200":{"description":"Canceled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketingQueueItemEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"The send already went out, failed, or was canceled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/outbox/attachments":{"post":{"tags":["Outbox"],"summary":"Create an attachment upload URL","description":"Returns a short-lived URL to upload a file directly to storage, plus the `attachment_id` to reference when sending. Use this for any attachment: the bytes never pass through the API, so this is the only way to send files larger than the inbound request-body limit. Upload with `PUT` using exactly the headers in `required_headers` — the URL is signed against that content type and length. Unused uploads are deleted after 7 days.","x-required-scopes":["outbox.transactional:send"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttachmentUploadRequest"}}}},"responses":{"201":{"description":"Upload URL created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentUploadEnvelope"}}}},"400":{"description":"Invalid filename or disallowed content type. `details.reason` is INVALID_ATTACHMENT.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"Declared size exceeds the per-file limit. `details.reason` is ATTACHMENT_TOO_LARGE.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Attachment storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","x-required-scopes":["webhooks:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Webhook endpoint list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","x-required-scopes":["webhooks:write"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookRequest"}}}},"responses":{"201":{"description":"Created webhook endpoint. Response includes the one-time signing secret; store it — it is never returned again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreatedEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Service temporarily unavailable — a required dependency (e.g. secret encryption) is not available. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/webhooks/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook delivery logs","x-required-scopes":["webhooks:read"],"parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/WebhookId"},{"$ref":"#/components/parameters/DeliveryStatus"}],"responses":{"200":{"description":"Webhook delivery list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/webhooks/deliveries/{id}/replay":{"parameters":[{"$ref":"#/components/parameters/ResourceId"}],"post":{"tags":["Webhooks"],"summary":"Queue a webhook delivery replay","x-required-scopes":["webhooks:admin"],"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"202":{"description":"Queued delivery replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryEnvelope"}}}},"400":{"description":"Invalid request — malformed body/JSON, failed field validation, an invalid pagination cursor, an invalid resource id, or a missing/short Idempotency-Key on a write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Resource not found, or not owned by this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"Conflict — a duplicate resource (e.g. duplicate contact email), or an Idempotency-Key reused with a different request body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Public API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"STATXE API key"}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Required for retry-safe write operations."},"ResourceId":{"name":"id","in":"path","required":true,"schema":{"type":"string"}},"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"Cursor":{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},"WebhookId":{"name":"webhook_id","in":"query","required":false,"schema":{"type":"string"}},"DeliveryStatus":{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","delivering","delivered","failed","exhausted"]}}},"schemas":{"InboxMessage":{"type":"object","required":["id","thread_id","direction","text","attachments","attachments_ready","created_at","updated_at"],"properties":{"id":{"type":"string"},"thread_id":{"type":"string"},"direction":{"type":"string","enum":["inbound","outbound"]},"subject":{"type":"string"},"text":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}},"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}}},"rfc_message_id":{"type":["string","null"]},"in_reply_to_message_id":{"type":["string","null"]},"references_rfc":{"type":"array","items":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object","required":["id","filename","content_type","size_bytes"],"properties":{"id":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"}}}},"attachment_ingest_status":{"type":"string","enum":["pending","ready","partial_failure","unavailable"],"description":"pending means inbound ingestion may finish; partial_failure requires review; unavailable means outbound bytes were not retained and must not be polled for ingestion."},"failed_attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"type":"string"},"reason":{"const":"ingest_failed"}}}},"attachment_count":{"type":"integer"},"html":{"type":["string","null"],"description":"Sanitized HTML body. On GET /inbox/messages/{id}, and on the list with ?include=html."},"attachments_ready":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Metadata":{"type":"object","description":"Up to 20 string key/values (keys up to 64 characters, values up to 500). Stored on the message and echoed as `metadata` on its email.* webhooks, and as `reply_to_metadata` on inbox.message.received when someone replies to it.","additionalProperties":{"type":"string","maxLength":500}},"SendInboxMessageRequest":{"type":"object","required":["to"],"properties":{"from":{"type":"string","format":"email","description":"Sender mailbox. Defaults to the caller's default sender."},"sender_id":{"type":"string","description":"Sender mailbox by id, instead of `from`."},"to":{"type":"string","format":"email"},"cc":{"type":"array","maxItems":5,"items":{"type":"string","format":"email"}},"subject":{"type":"string","description":"Required for a new thread. A reply defaults to \"Re: <subject>\"."},"html":{"type":"string"},"text":{"type":"string"},"reply_to_message_id":{"type":"string","description":"Answer this message (an inbound reply, typically)."},"thread_id":{"type":"string","description":"Answer the latest message in this thread."},"contact_id":{"type":"string"},"attachments":{"type":"array","maxItems":10,"items":{"type":"object","required":["attachment_id"],"properties":{"attachment_id":{"type":"string","description":"From POST /outbox/attachments."}}}},"include_footer":{"type":"boolean","default":false,"description":"Add the legal footer and List-Unsubscribe headers."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"InboxMessageSent":{"type":"object","properties":{"id":{"type":"string"},"message_id":{"type":"string"},"thread_id":{"type":"string"},"provider_message_id":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}},"sender_id":{"type":"string"},"to":{"type":"array","items":{"type":"string"}},"subject":{"type":"string"},"status":{"type":"string","enum":["sent","scheduled"]},"credits_deducted":{"type":"integer","const":0}}},"InboxMessageSentEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InboxMessageSent"}}}]},"SendMarketingEmailRequest":{"type":"object","required":["subject"],"properties":{"contact_id":{"type":"string","description":"The contact. Pass this or `to`."},"to":{"type":"string","format":"email","description":"The contact by email."},"from":{"type":"string","format":"email"},"sender_id":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string","description":"A whole document is fine; `<style>` blocks are kept (CSS filtered)."},"text":{"type":"string"},"metadata":{"$ref":"#/components/schemas/Metadata"},"queue_if_full":{"type":"boolean","default":true}}},"MarketingSend":{"type":"object","description":"`status` is \"sent\" (with `message_id`) or \"queued\" (with `resume_at`; `id` is the queue id for GET /outbox/marketing/{id}).","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["sent","queued"]},"message_id":{"type":["string","null"]},"provider_message_id":{"type":"string"},"contact_id":{"type":"string"},"to":{"type":"string"},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}}},"subject":{"type":"string"},"promoted_to_premium":{"type":"boolean"},"credits_deducted":{"type":"integer","const":0},"queued_at":{"type":"string","format":"date-time"},"resume_at":{"type":["string","null"],"format":"date-time"},"hold_reason":{"type":["string","null"],"enum":["daily_cap","hourly_cap",null]}}},"MarketingSendEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingSend"}}}]},"MarketingQueueItem":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","sending","sent","failed","canceled"]},"queued_at":{"type":"string","format":"date-time"},"resume_at":{"type":["string","null"],"format":"date-time"},"hold_reason":{"type":["string","null"]},"attempts":{"type":"integer"},"message_id":{"type":["string","null"]},"sent_at":{"type":["string","null"],"format":"date-time"},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"MarketingQueueItemEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MarketingQueueItem"}}}]},"RescheduleEmailRequest":{"type":"object","required":["scheduled_at"],"properties":{"scheduled_at":{"type":"string","format":"date-time","description":"ISO 8601 with an offset, in the future."}}},"ScheduledEmail":{"type":"object","properties":{"id":{"type":"string"},"message_id":{"type":"string"},"status":{"type":"string","description":"scheduled or canceled."},"scheduled_at":{"type":["string","null"],"format":"date-time"},"canceled_at":{"type":["string","null"],"format":"date-time"},"credits_refunded":{"type":"integer"}}},"ScheduledEmailEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScheduledEmail"}}}]},"InboxMessageEnvelope":{"type":"object","properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/InboxMessage"},"meta":{"type":"object"}}},"InboxMessageListEnvelope":{"type":"object","properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/InboxMessage"}},"meta":{"type":"object"}}},"ApiKeyContext":{"type":"object","properties":{"org_id":{"type":"string"},"org_slug":{"type":["string","null"]},"org_name":{"type":["string","null"]},"actor_user_id":{"type":"string"},"key_id":{"type":["string","null"],"description":"Null when the request was not authenticated with an API key."},"auth_method":{"type":"string"},"scopes":{"type":"array","description":"Scopes granted to this key.","items":{"type":"string"}},"enabled_scope_catalog":{"type":"array","description":"Every scope this API surface exposes, with its launch state — not only the scopes granted to this key (see `scopes` for those).","items":{"$ref":"#/components/schemas/ScopeCatalogEntry"}},"rate_limit_profile":{"type":"object"},"credits":{"type":"object","properties":{"email":{"type":["object","null"],"description":"Transactional email credits. Null when the workspace has no credit record.","properties":{"remaining":{"type":"integer"},"monthly_allocation":{"type":"integer"},"used":{"type":"integer"},"resets_at":{"type":"string","format":"date-time","description":"When the included allowance refills."},"overage_enabled":{"type":"boolean","description":"When true, a send past zero is billed as overage instead of refused."}}}}}}},"ScopeCatalogEntry":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"access":{"type":"string"},"launch":{"type":"string"},"description":{"type":"string"}}},"SenderOption":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"is_default":{"type":"boolean"},"verified":{"type":"boolean"},"merge_fields":{"$ref":"#/components/schemas/SenderMergeFields"},"replies_enabled":{"type":"boolean","description":"A reply to this address reaches a person: the domain receives mail and someone holds an inbox for it. False means replies are dropped — warn before sending."},"assigned_to_me":{"type":"boolean","description":"The caller holds an inbox for this address, or it is their login email."},"html_signature":{"type":["string","null"],"description":"The signature POST /inbox/messages adds when the caller sends from this mailbox, sanitized. Show it in previews; never add it to the body."}}},"SenderMergeFields":{"type":"object","description":"What POST /outbox/emails writes for this sender's merge fields, for previews.","properties":{"website":{"type":"string","description":"`{{website}}`."},"form":{"type":"string","nullable":true,"description":"`{{form}}`: the domain's default published form. Null when there is none; a send using it is refused."},"forms":{"type":"object","additionalProperties":{"type":"string"},"description":"`{{form:slug}}` for each published form on the domain, keyed by slug."},"links":{"type":"object","additionalProperties":{"type":"string"},"description":"`{{link.N}}` keyed `link.N`, only for links with a URL on this domain."},"company_name":{"type":"string","nullable":true,"description":"`{{company_name}}`."}}},"DomainOption":{"type":"object","properties":{"_id":{"type":"string"},"domain":{"type":"string"},"verified":{"type":"boolean"},"isDefault":{"type":"boolean"},"domainSource":{"type":"string"},"deliverability":{"type":"object"},"sender_options":{"type":"array","items":{"$ref":"#/components/schemas/SenderOption"}}}},"ContactStatus":{"type":"string","description":"Subscription state of a contact. These are the only values accepted when updating a contact; any other value is rejected with 400.","enum":["active","unsubscribed","bounced","complained","suppressed"]},"Contact":{"type":"object","properties":{"_id":{"type":"string"},"email":{"type":"string","format":"email"},"firstName":{"type":"string"},"lastName":{"type":"string"},"company":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"customFields":{"type":"object"},"status":{"$ref":"#/components/schemas/ContactStatus"},"smsOptedOut":{"type":"boolean","description":"Texting opt-out kept by STATXT. Never blocks email."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateContactRequest":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"tags":{"type":"array","items":{"type":"string"},"default":[]},"custom_fields":{"type":"object","default":{}},"sms_opted_out":{"type":"boolean","description":"Texting opt-out. Informational: it never blocks email."}}},"UpdateContactRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"first_name":{"type":"string"},"last_name":{"type":"string"},"company":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"status":{"$ref":"#/components/schemas/ContactStatus"},"sms_opted_out":{"type":"boolean","description":"Texting opt-out. Informational: it never blocks email."}}},"Segment":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"contactCount":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateSegmentRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":500},"tags":{"type":"array","items":{"type":"string"},"default":[]}}},"Automation":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","archived"]},"trigger_type":{"type":"string"},"stats":{"type":"object","properties":{"totalRuns":{"type":"integer"},"activeRuns":{"type":"integer"},"completedRuns":{"type":"integer"},"failedRuns":{"type":"integer"},"emailsSent":{"type":"integer"},"creditsUsed":{"type":"integer"}}},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"UpdateAutomationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":2000},"status":{"type":"string","enum":["draft","active","paused","archived"]}}},"Template":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"subject":{"type":"string"},"preview_text":{"type":"string"},"html":{"type":"string"},"category":{"type":"string","enum":["marketing","transactional","newsletter","welcome","other"]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published","archived"]},"version":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CreateTemplateRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":500},"subject":{"type":"string","maxLength":500},"preview_text":{"type":"string","maxLength":200},"html":{"type":"string"},"category":{"type":"string","enum":["marketing","transactional","newsletter","welcome","other"]},"folder_id":{"type":"string","nullable":true}}},"UpdateTemplateRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":500},"subject":{"type":"string","maxLength":500},"preview_text":{"type":"string","maxLength":200},"html":{"type":"string"},"category":{"type":"string","enum":["marketing","transactional","newsletter","welcome","other"]},"folder_id":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published","archived"]}}},"MetricsSummary":{"type":"object","properties":{"summary":{"type":"object","properties":{"sent":{"type":"integer"},"delivered":{"type":"integer"},"opened":{"type":"integer"},"clicked":{"type":"integer"},"bounced":{"type":"integer"},"complained":{"type":"integer"},"unsubscribed":{"type":"integer"},"campaigns":{"type":"integer"}}},"rates":{"type":"object","properties":{"delivery":{"type":"number"},"open":{"type":"number"},"click":{"type":"number"},"ctor":{"type":"number"},"bounce":{"type":"number"},"complaint":{"type":"number"},"unsubscribe":{"type":"number"}}},"dailyVolume":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"sent":{"type":"integer"},"delivered":{"type":"integer"},"opened":{"type":"integer"},"clicked":{"type":"integer"},"bounced":{"type":"integer"}}}},"topCampaigns":{"type":"array","items":{"type":"object"}},"contacts":{"type":"object","properties":{"total":{"type":"integer"},"active":{"type":"integer"},"unsubscribed":{"type":"integer"},"bounced":{"type":"integer"},"complained":{"type":"integer"}}},"domains":{"type":"array","items":{"type":"object"}},"period":{"type":"string"}}},"Broadcast":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"subject":{"type":"string"},"previewText":{"type":"string"},"fromName":{"type":"string"},"fromEmail":{"type":"string","format":"email"},"groupIds":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"scheduledAt":{"type":["string","null"],"format":"date-time"},"metrics":{"type":"object"},"createdAt":{"type":"string","format":"date-time"}}},"CreateBroadcastRequest":{"type":"object","required":["name","subject","from_name","from_email","segment_ids"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"subject":{"type":"string","minLength":1,"maxLength":500},"preview_text":{"type":"string","maxLength":200},"from_name":{"type":"string","minLength":1,"maxLength":100},"from_email":{"type":"string","format":"email"},"reply_to":{"type":"string","format":"email"},"segment_ids":{"type":"array","minItems":1,"items":{"type":"string"}},"html":{"type":"string"},"plain_text":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"}}},"SendTransactionalEmailRequest":{"type":"object","required":["from","to","subject"],"description":"Supply at least one of `html` or `text`.","properties":{"from":{"type":"string","minLength":3,"maxLength":320,"description":"`addr@host` or `Display Name <addr@host>`. The host must be a sendable domain in this workspace; any local part is allowed."},"to":{"oneOf":[{"type":"string","format":"email"},{"type":"array","minItems":1,"maxItems":50,"items":{"type":"string","format":"email"}}]},"cc":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"bcc":{"type":"array","maxItems":50,"items":{"type":"string","format":"email"}},"subject":{"type":"string","minLength":1,"maxLength":998},"html":{"type":"string","maxLength":500000},"text":{"type":"string","maxLength":200000},"reply_to":{"type":"string","format":"email"},"headers":{"type":"object","additionalProperties":{"type":"string","maxLength":4000},"description":"Additional RFC 5322 headers. `Message-ID` is always assigned by STATXE."},"attachments":{"type":"array","maxItems":20,"description":"Files sent with the message. Bytes are passed through to delivery and never stored — only filename, type, and size are retained on the message record.","items":{"oneOf":[{"$ref":"#/components/schemas/OutboundAttachment"},{"$ref":"#/components/schemas/StoredAttachmentRef"}]}},"scheduled_at":{"type":"string","description":"ISO 8601 timestamp or natural language (e.g. `in 1 hour`), up to 30 days out. Cancel with POST /outbox/emails/{id}/cancel or move with PATCH /outbox/emails/{id}."},"metadata":{"$ref":"#/components/schemas/Metadata"}}},"CreateAttachmentUploadRequest":{"type":"object","required":["filename","content_type","size_bytes"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":512},"content_type":{"type":"string","description":"MIME type, e.g. `application/pdf`."},"size_bytes":{"type":"integer","description":"Exact byte length of the file. The upload URL is signed against it."}}},"AttachmentUpload":{"type":"object","properties":{"attachment_id":{"type":"string","description":"Reference this in an email's `attachments` after uploading."},"upload_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"},"required_headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Send exactly these headers on the PUT, or the upload is rejected."}}},"StoredAttachmentRef":{"type":"object","required":["attachment_id"],"description":"An attachment already uploaded via POST /outbox/attachments.","properties":{"attachment_id":{"type":"string"},"filename":{"type":"string","description":"Overrides the name given at upload time."},"content_type":{"type":"string"},"content_id":{"type":"string","description":"Set to embed the file inline via `cid:<content_id>`."}}},"OutboundAttachment":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":512},"content":{"type":"string","format":"byte","description":"Base64-encoded file bytes. Max 12 MB per file."},"content_type":{"type":"string","maxLength":255,"description":"MIME type, e.g. `application/pdf`. Inferred by the recipient if omitted."},"content_id":{"type":"string","maxLength":255,"description":"Set to embed the file in the HTML body via `cid:<content_id>` instead of attaching it. Must be unique within the message."}}},"TransactionalEmail":{"type":"object","properties":{"_id":{"type":"string"},"message_id":{"type":"string"},"provider_message_id":{"type":"string"},"rfc_message_id":{"type":"string","description":"RFC 5322 Message-ID sent on the wire; use it to correlate replies."},"from":{"type":"string","format":"email"},"to":{"type":"array","items":{"type":"string","format":"email"}},"subject":{"type":"string"},"status":{"type":"string","enum":["sent","scheduled"]},"recipient_count":{"type":"integer"},"attachment_count":{"type":"integer"},"credits_deducted":{"type":"integer"},"overage_used":{"type":"integer","description":"Recipients billed as overage because the credit balance was exhausted."}}},"InboxThread":{"type":"object","properties":{"_id":{"type":"string"},"inboxThreadId":{"type":"string"},"subject":{"type":"string"},"unreadCount":{"type":"integer"},"lastMessageAt":{"type":"string","format":"date-time"}}},"WebhookEventType":{"type":"string","description":"A webhook event type. These are the only values accepted when creating an endpoint; any other value is rejected with 400.","enum":["contact.created","contact.updated","contact.deleted","broadcast.sent","broadcast.completed","email.delivered","email.opened","email.clicked","email.bounced","email.complained","unsubscribe","inbox.message.received"]},"WebhookEndpoint":{"type":"object","properties":{"_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventType"}},"enabled":{"type":"boolean"},"deliveryCount":{"type":"integer"},"failureCount":{"type":"integer"},"lastDeliveredAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"WebhookEndpointCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","description":"Signing secret (prefixed `whsec_`) used to verify webhook payload signatures. Returned ONLY once — in the response to endpoint creation — and never included in any later response. Store it securely."}}}]},"CreateWebhookRequest":{"type":"object","required":["name","url","events"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WebhookEventType"}},"enabled":{"type":"boolean","default":true}}},"WebhookDelivery":{"type":"object","properties":{"_id":{"type":"string"},"webhookId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"$ref":"#/components/schemas/WebhookEventType"},"status":{"type":"string","enum":["queued","delivering","delivered","failed","exhausted"]},"attemptCount":{"type":"integer"},"responseStatus":{"type":"integer"},"nextAttemptAt":{"type":["string","null"],"format":"date-time"},"lastAttemptAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"replayCount":{"type":"integer","description":"Number of times this delivery has been replayed."},"replayedAt":{"type":["string","null"],"format":"date-time","description":"When this delivery was last replayed; null if never replayed."}}},"DeleteResult":{"type":"object","required":["deleted","id"],"properties":{"deleted":{"type":"boolean"},"id":{"type":"string"}}},"SuccessEnvelope":{"type":"object","required":["ok","data","meta"],"properties":{"ok":{"const":true},"data":{},"meta":{"$ref":"#/components/schemas/Meta"}}},"ErrorEnvelope":{"type":"object","required":["ok","error","meta"],"properties":{"ok":{"const":false},"error":{"type":"object","required":["code","message","docs_url"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"docs_url":{"type":"string","format":"uri","description":"Stable link to the public error catalog entry."},"details":{}}},"meta":{"$ref":"#/components/schemas/Meta"}}},"Meta":{"type":"object","required":["request_id"],"properties":{"request_id":{"type":"string"},"pagination":{"type":"object"},"rate_limit":{"type":"object"}}},"MeEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ApiKeyContext"}}}]},"DomainOptionListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainOption"}}}}]},"ContactEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}]},"ContactListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}}}}]},"SegmentEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Segment"}}}]},"SegmentListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}}}}]},"AutomationEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Automation"}}}]},"AutomationListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}}}}]},"TemplateEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}]},"TemplateListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}}}}]},"MetricsSummaryEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MetricsSummary"}}}]},"InboxThreadListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboxThread"}}}}]},"AttachmentUploadEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttachmentUpload"}}}]},"TransactionalEmailEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TransactionalEmail"}}}]},"BroadcastEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Broadcast"}}}]},"BroadcastListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Broadcast"}}}}]},"WebhookEndpointEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}}}]},"WebhookEndpointCreatedEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}]},"WebhookEndpointListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}]},"WebhookDeliveryEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookDelivery"}}}]},"WebhookDeliveryListEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}]},"DeleteEnvelope":{"allOf":[{"$ref":"#/components/schemas/SuccessEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteResult"}}}]}},"x-statxe-scopes":[{"id":"me:read","domain":"me","access":"read","launch":"public","description":"Inspect the current API key, org, scopes, and rate-limit profile."},{"id":"domains:read","domain":"domains","access":"read","launch":"public","description":"Read verified sending domains and available sender identities."},{"id":"inbox.threads:read","domain":"inbox","access":"read","launch":"public","description":"Read inbox threads, messages, and delivery events."},{"id":"inbox.threads:write","domain":"inbox","access":"write","launch":"public","description":"Update inbox thread/message state such as read, starred, archived, and tags."},{"id":"inbox.messages:send","domain":"inbox","access":"send","launch":"public","label":"Conversation email — Send","description":"Send 1:1 conversation email from a mailbox you are assigned: new threads and replies, with the sender's signature. Uses no email credits; new threads count against the domain's daily limit, replies never do."},{"id":"outbox.broadcasts:read","domain":"outbox","access":"read","launch":"public","description":"Read outbox broadcasts, campaign drafts, schedules, and send status."},{"id":"outbox.broadcasts:write","domain":"outbox","access":"write","launch":"public","description":"Create and update broadcast drafts and schedules."},{"id":"outbox.broadcasts:send","domain":"outbox","access":"send","launch":"public","description":"Launch or cancel broadcast/send lifecycle operations."},{"id":"outbox.transactional:send","domain":"outbox","access":"send","launch":"public","label":"Transactional email — Send","description":"Send individual transactional emails via the API or the SMTP front door. Deliberately separate from outbox.broadcasts:send so an SMTP-only key cannot launch a broadcast."},{"id":"outbox.marketing:send","domain":"outbox","access":"send","launch":"public","label":"Marketing email — Send","description":"Send one marketing email to one contact (flow steps). Promotes the contact into a free premium slot, adds the legal footer and unsubscribe link, and queues the send when the domain is at its daily limit."},{"id":"contacts:read","domain":"contacts","access":"read","launch":"public","description":"Read contacts and contact metadata."},{"id":"contacts:write","domain":"contacts","access":"write","launch":"public","description":"Create, update, import, export, and delete contacts."},{"id":"segments:read","domain":"segments","access":"read","launch":"public","description":"Read segments, groups, and membership lists."},{"id":"segments:write","domain":"segments","access":"write","launch":"public","description":"Create/update segments and manage contact membership."},{"id":"webhooks:read","domain":"webhooks","access":"read","launch":"public","description":"Read webhook endpoints and delivery status."},{"id":"webhooks:write","domain":"webhooks","access":"write","launch":"public","description":"Create and update webhook endpoints."},{"id":"webhooks:admin","domain":"webhooks","access":"admin","launch":"public","description":"Delete webhooks, rotate secrets, and replay deliveries."},{"id":"api_keys:read","domain":"api_keys","access":"read","launch":"public","description":"Read API key metadata."},{"id":"api_keys:write","domain":"api_keys","access":"write","launch":"public","description":"Create and revoke API keys."},{"id":"automations:read","domain":"automations","access":"read","launch":"public","description":"Read automations and their run history."},{"id":"automations:write","domain":"automations","access":"write","launch":"public","description":"Update an automation's name, description, and status (activate/pause/archive), and delete automations. Creating an automation's workflow is not yet supported over the API — use the dashboard."},{"id":"templates:read","domain":"templates","access":"read","launch":"public","description":"Read email templates."},{"id":"templates:write","domain":"templates","access":"write","launch":"public","description":"Create, update, and delete email templates."},{"id":"metrics:read","domain":"metrics","access":"read","launch":"public","description":"Read send/engagement metrics summaries."},{"id":"assistant.chat:write","domain":"assistant","access":"write","launch":"gated","description":"Send gated assistant chat requests for admin-approved orgs."},{"id":"assistant.tools:read","domain":"assistant","access":"read","launch":"gated","label":"Assistant tools — Read","description":"Discover gated assistant tools available to an approved org."},{"id":"assistant.sessions:read","domain":"assistant","access":"read","launch":"gated","label":"Assistant sessions — Read","description":"Read gated assistant session and usage state."}]}}