{"openapi":"3.1.0","info":{"title":"Email Gateway API","version":"1.0.0","description":"Transactional email API. Authenticate with `Authorization: Bearer <api key>`. All request and response bodies are JSON with camelCase keys. An `accepted` status means the recipient's mail server accepted the message (SMTP 250); it does not indicate inbox placement."},"servers":[{"url":"https://api.sendoryn.com/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key, e.g. gw_live_abc123..."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"validation_error"},"message":{"type":"string"},"details":{}},"required":["code","message"]},"requestId":{"type":"string"}}},"SendEmailRequest":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","example":"Acme <notifications@acme.com>","description":"Must use an active, verified domain."},"to":{"oneOf":[{"type":"string","format":"email"},{"type":"array","items":{"type":"string","format":"email"},"maxItems":50}]},"marketing":{"type":"object","required":["listId"],"properties":{"listId":{"type":"string"}},"description":"Marks this as marketing email. Needs one recipient who is subscribed to the list. Adds one-click unsubscribe."},"cc":{"type":"array","items":{"type":"string","format":"email"}},"bcc":{"type":"array","items":{"type":"string","format":"email"}},"replyTo":{"type":"string","format":"email"},"subject":{"type":"string","maxLength":998},"html":{"type":"string"},"text":{"type":"string"},"template":{"type":"object","properties":{"id":{"type":"string","description":"Template id or slug"},"variables":{"type":"object","additionalProperties":true}},"required":["id"]},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom headers (reserved headers are rejected)."},"attachments":{"type":"array","maxItems":10,"items":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string"},"content":{"type":"string","description":"Base64"},"contentType":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"string"},"maxItems":10},"metadata":{"type":"object","additionalProperties":{"type":"string"}}}},"SendEmailResponse":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["QUEUED","SUPPRESSED"]},"duplicate":{"type":"boolean"},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"status":{"type":"string"}}}}}},"EmailStatus":{"type":"string","enum":["SUBMITTED","QUEUED","PROCESSING","ACCEPTED","DEFERRED","FAILED","BOUNCED","SUPPRESSED","CANCELED"]},"EmailSummary":{"type":"object","properties":{"id":{"type":"string"},"fromAddress":{"type":"string"},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/EmailStatus"},"source":{"type":"string","enum":["API","SMTP"]},"tags":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string","format":"date-time"},"lastSmtpCode":{"type":["integer","null"]},"lastSmtpResponse":{"type":["string","null"]}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"emailId":{"type":"string"},"recipient":{"type":["string","null"]},"data":{},"occurredAt":{"type":"string","format":"date-time"}}},"Domain":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["PENDING_VERIFICATION","VERIFIED","ACTIVE","PAUSED","SUSPENDED"]},"ownershipStatus":{"type":"string"},"spfStatus":{"type":"string"},"dkimStatus":{"type":"string"},"dmarcStatus":{"type":"string"},"returnPathStatus":{"type":"string"}}},"DnsRecord":{"type":"object","properties":{"key":{"type":"string"},"type":{"type":"string"},"host":{"type":"string"},"value":{"type":"string"},"required":{"type":"boolean"},"purpose":{"type":"string"}}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":["string","null"]},"lastUsedAt":{"type":["string","null"]}}},"Template":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"published":{"type":"boolean"}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"}}}}},"paths":{"/emails":{"post":{"summary":"Send an email","description":"Validates, authorizes and queues a message. Returns 202 once queued. Delivery is asynchronous — follow progress via GET /emails/{id}, /events or webhooks.","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string","maxLength":128},"description":"Repeat-safe submissions: the same key returns the original result for 30+ days."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailRequest"}}}},"responses":{"200":{"description":"Idempotent replay of an earlier submission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendEmailResponse"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Message too large"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"emails:send"},"get":{"summary":"List emails","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Value of `nextCursor` from the previous page."},{"name":"status","in":"query","schema":{"$ref":"#/components/schemas/EmailStatus"}},{"name":"from","in":"query","schema":{"type":"string"}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"domain","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"A page of emails","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EmailSummary"}},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"emails:read"}},"/emails/{id}":{"get":{"summary":"Retrieve an email with recipients, event timeline and delivery attempts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Email"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"emails:read"}},"/emails/{id}/retry":{"post":{"summary":"Retry a failed email","description":"Only FAILED emails whose content is still retained can be retried. Permanent failures are never retried automatically.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Re-queued"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Not retryable"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"emails:send"}},"/events":{"get":{"summary":"List email events","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Value of `nextCursor` from the previous page."},{"name":"type","in":"query","schema":{"type":"string"}},{"name":"emailId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A page of events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"nextCursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"events:read"}},"/usage":{"get":{"summary":"Current period usage and plan limits","responses":{"200":{"description":"Usage"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"usage:read"}},"/domains":{"get":{"summary":"List sending domains","responses":{"200":{"description":"Domains"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"domains:read"},"post":{"summary":"Add a sending domain","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"acme.com"}}}}}},"responses":{"201":{"description":"Created, with the DNS records to publish"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"domains:write"}},"/domains/{id}":{"get":{"summary":"Domain details and DNS records","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Domain"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"domains:read"}},"/domains/{id}/verify":{"post":{"summary":"Check DNS records now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verification result"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"domains:write"}},"/api-keys":{"get":{"summary":"List API keys","responses":{"200":{"description":"Keys (secrets are never returned)"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"api_keys:manage"},"post":{"summary":"Create an API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","scopes"],"properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string","format":"date-time"},"ipAllowlist":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Created. `key` is shown only in this response."},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"api_keys:manage"}},"/api-keys/{id}":{"delete":{"summary":"Revoke an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Revoked"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"api_keys:manage"}},"/templates":{"get":{"summary":"List templates","responses":{"200":{"description":"Templates"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"templates:read"},"post":{"summary":"Create a template","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug","subject","html"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"}}}}}},"responses":{"201":{"description":"Created (draft version 1)"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"templates:write"}},"/domains/{id}/dmarc":{"get":{"summary":"Summary of received DMARC aggregate reports","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Totals and top sending sources. Covers only providers that send reports."},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"domains:read"}},"/contact-lists":{"get":{"summary":"List consent-based contact lists","responses":{"200":{"description":"Lists"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:read"},"post":{"summary":"Create a contact list","description":"Requires an account approved for marketing email.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:manage"}},"/contact-lists/{id}/contacts":{"get":{"summary":"List contacts with their consent records","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Value of `nextCursor` from the previous page."}],"responses":{"200":{"description":"A page of contacts"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:read"},"post":{"summary":"Add a contact with a consent record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["address","consentSource","consentAt"],"properties":{"address":{"type":"string","format":"email"},"consentSource":{"type":"string"},"consentText":{"type":"string"},"consentIp":{"type":"string"},"consentAt":{"type":"string","format":"date-time"}}}}}},"responses":{"201":{"description":"Added"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The address opted out or is suppressed"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:manage"}},"/contact-lists/{id}/contacts/import":{"post":{"summary":"Import opted-in contacts","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["addresses","consentSource","consentAt","attestConsent"],"properties":{"addresses":{"type":"array","maxItems":10000,"items":{"type":"string","format":"email"}},"consentSource":{"type":"string"},"consentAt":{"type":"string","format":"date-time"},"attestConsent":{"const":true}}}}}},"responses":{"200":{"description":"Counts of imported, duplicate, opted-out and rejected addresses"},"400":{"description":"Refused as a likely purchased or scraped list"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:manage"}},"/contact-lists/{id}/broadcasts":{"get":{"summary":"List broadcasts sent to a list","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Broadcasts"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"contacts:read"},"post":{"summary":"Send a broadcast to every subscribed contact","description":"Each message gets one-click unsubscribe headers and a visible link. Place {{unsubscribe_url}} to choose where the link appears.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","subject"],"properties":{"from":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"202":{"description":"Queued"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"emails:send"}},"/webhooks":{"get":{"summary":"List webhook endpoints","responses":{"200":{"description":"Endpoints"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"webhooks:manage"},"post":{"summary":"Create a webhook endpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"Created. `secret` (for signature verification) is shown only in this response."},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope, sender, account status, plan limit)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited or quota exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-scope":"webhooks:manage"}}}}