{"openapi":"3.1.0","info":{"title":"Transmit API","version":"1.0.0","description":"Transactional email and SMS. Authenticate with an API key as a bearer token; every key carries scopes, and a call without the scope it needs is refused rather than partially served.","contact":{"name":"Transmit support","email":"support@transmit.dev","url":"https://www.transmit.dev"}},"servers":[{"url":"https://api.transmit.dev","description":"Production"}],"tags":[{"name":"Incidents"},{"name":"Compatibility"},{"name":"Emails"},{"name":"Analytics"},{"name":"Contacts"},{"name":"Suppressions"},{"name":"Audiences"},{"name":"Campaigns"},{"name":"Templates"},{"name":"SMS"},{"name":"Webhooks"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your API key, as `Authorization: Bearer tr_v2_…`. Create one in Settings → API keys."}},"schemas":{"Error":{"type":"object","description":"The error envelope returned by authentication, authorization and validation failures","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"A stable, machine-readable code"},"message":{"type":"string"},"details":{"type":"object","description":"Present when the failure has structure worth reading, such as validation issues"}}}}}}},"paths":{"/v1/integrations/alertmanager/{configurationId}/{escalationPolicyId}/{sourceId}":{"post":{"operationId":"receiveAlertmanager","summary":"Receive Prometheus Alertmanager events","description":"Accepts the standard version-4 Alertmanager webhook with at most 20 alerts and no truncation. Requires both incidents:ingest and incidents:write on the current API key; test/live isolation follows the key. Keep sourceId stable for each independent Alertmanager source and shared across its HA replicas. No Idempotency-Key is required. Per-alert fingerprint and nanosecond startsAt ordering deduplicate retries and fence delayed recovery. A recovery received before firing records a terminal source episode without creating an incident. Repeated firing cannot reopen a manually resolved episode; a newer startsAt may open another incident. The whole batch, its clock, incident cancellation and queue intent commit atomically. The body is limited to 256 KiB. See /docs/incident-alertmanager for receiver configuration.","tags":["Incidents"],"x-scope":"incidents:ingest","parameters":[{"name":"configurationId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"escalationPolicyId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"sourceId","in":"path","description":"Stable UUID identifying one independent Alertmanager source.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","const":"4"},"truncatedAlerts":{"default":0,"type":"number","const":0},"alerts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["firing","resolved"]},"fingerprint":{"type":"string","pattern":"^[a-fA-F0-9]{16}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"labels":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","maxLength":1024}},"annotations":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","maxLength":4000}}},"required":["status","fingerprint","startsAt","endsAt","labels","annotations"]}}},"required":["version","alerts"]},"example":{"version":"4","truncatedAlerts":0,"alerts":[{"status":"firing","fingerprint":"0011223344556677","startsAt":"2026-10-21T00:00:00Z","endsAt":"0001-01-01T00:00:00Z","labels":{"alertname":"DatabaseDown","severity":"critical"},"annotations":{"summary":"Database unavailable"}}]}}}},"responses":{"200":{"description":"Committed batch with source-ordering results","content":{"application/json":{"schema":{"type":"object","properties":{"sandbox":{"type":"boolean"},"results":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"fingerprint":{"type":"string"},"outcome":{"type":"string","enum":["firing","resolved","ignored"]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["fingerprint","outcome","incident_id"],"additionalProperties":false}}},"required":["sandbox","results"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Routing resources are outside this workspace"},"413":{"description":"Body exceeds 256 KiB"},"415":{"description":"Use application/json"},"422":{"description":"Invalid, truncated or excessive batch, or invalid episode times"}}}},"/v1/integrations/opsgenie/{configurationId}/{escalationPolicyId}/v2/alerts":{"post":{"operationId":"receiveOpsgenieAlert","summary":"Create an alert with the Opsgenie Alert API","description":"Opsgenie-compatible create-alert endpoint. Point any tool that can send to a custom Opsgenie API URL here, and authenticate with either `Authorization: GenieKey <transmit key>` or a Bearer key. message becomes the title; alias groups repeats into one active incident (identical messages share one when alias is absent); priority P1–P5 maps to critical, high, medium, low and low (default P3). Other Opsgenie fields are accepted and ignored: routing comes from the path and the key. No Idempotency-Key is needed; a retried request joins the active incident. Body limit 64 KiB. See /docs/incident-opsgenie.","tags":["Compatibility"],"x-scope":"incidents:ingest","parameters":[{"name":"configurationId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"escalationPolicyId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":1000},"alias":{"type":"string","minLength":1,"maxLength":512},"description":{"type":"string","maxLength":15000},"priority":{"type":"string","enum":["P1","P2","P3","P4","P5"]}},"required":["message"]},"example":{"message":"Database unavailable","alias":"database-primary","description":"Primary is refusing connections.","priority":"P1"}}}},"responses":{"202":{"description":"Alert committed","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string"},"took":{"type":"number"},"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incident_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["result","took","requestId"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Routing resources are outside this workspace"},"413":{"description":"Body exceeds 64 KiB"},"415":{"description":"Use application/json"},"422":{"description":"Invalid alert"}}}},"/v1/integrations/opsgenie/{configurationId}/{escalationPolicyId}/v2/alerts/{identifier}/{action}":{"post":{"operationId":"transitionOpsgenieAlert","summary":"Close or acknowledge an alert with the Opsgenie Alert API","description":"Opsgenie-compatible close and acknowledge. identifier is the alert alias and identifierType=alias is required. Closing resolves the active incident for that alias and cancels pending escalation; an alias with no active incident is accepted without effect. The request body is not read.","tags":["Compatibility"],"x-scope":"incidents:write","parameters":[{"name":"configurationId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"escalationPolicyId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"identifier","in":"path","description":"The alias the alert was created with, URL-encoded.","required":true,"schema":{"type":"string"}},{"name":"action","in":"path","description":"close or acknowledge.","required":true,"schema":{"type":"string","enum":["close","acknowledge"]}},{"name":"identifierType","in":"query","description":"Must be alias.","required":true,"schema":{"type":"string","enum":["alias"]}}],"responses":{"202":{"description":"Transition committed","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"type":"string"},"took":{"type":"number"},"requestId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incident_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["result","took","requestId"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unsupported action"},"422":{"description":"identifierType is not alias, or the alias is invalid"}}}},"/v1/integrations/grafana/{configurationId}/{escalationPolicyId}/{sourceId}":{"post":{"operationId":"receiveGrafana","summary":"Receive Grafana alerting webhooks","description":"Accepts Grafana's webhook contact point payload with at most 20 alerts and no truncation, and applies the same per-fingerprint episode ordering as the Alertmanager integration. Requires both incidents:ingest and incidents:write. Keep sourceId stable for each Grafana instance. Body limit 256 KiB. See /docs/incident-grafana.","tags":["Incidents"],"x-scope":"incidents:ingest","parameters":[{"name":"configurationId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"escalationPolicyId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"sourceId","in":"path","description":"Stable UUID identifying one Grafana instance.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","maxLength":16},"truncatedAlerts":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"alerts":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["firing","resolved"]},"fingerprint":{"type":"string","pattern":"^[a-fA-F0-9]{16}$"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"labels":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","maxLength":1024}},"annotations":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":128},"additionalProperties":{"type":"string","maxLength":4000}}},"required":["status","fingerprint","startsAt","endsAt","labels","annotations"]}}},"required":["alerts"]},"example":{"version":"1","truncatedAlerts":0,"alerts":[{"status":"firing","fingerprint":"0011223344556677","startsAt":"2026-10-21T00:00:00Z","endsAt":"0001-01-01T00:00:00Z","labels":{"alertname":"DatabaseDown","severity":"critical"},"annotations":{"summary":"Database unavailable"}}]}}}},"responses":{"200":{"description":"Committed batch with source-ordering results","content":{"application/json":{"schema":{"type":"object","properties":{"sandbox":{"type":"boolean"},"results":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"fingerprint":{"type":"string"},"outcome":{"type":"string","enum":["firing","resolved","ignored"]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["fingerprint","outcome","incident_id"],"additionalProperties":false}}},"required":["sandbox","results"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Routing resources are outside this workspace"},"413":{"description":"Body exceeds 256 KiB"},"415":{"description":"Use application/json"},"422":{"description":"Invalid, truncated or excessive batch, or invalid episode times"}}}},"/v1/integrations/datadog/{configurationId}/{escalationPolicyId}":{"post":{"operationId":"receiveDatadog","summary":"Receive Datadog monitor webhooks","description":"Accepts the body produced by the documented Datadog webhook payload template. transition Recovered resolves the active incident for the aggregate key; every other transition opens or joins one. $ALERT_PRIORITY P1–P5 sets severity; otherwise warnings are medium and alerts high. Requires both incidents:ingest and incidents:write. Body limit 64 KiB. See /docs/incident-datadog.","tags":["Incidents"],"x-scope":"incidents:ingest","parameters":[{"name":"configurationId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"escalationPolicyId","in":"path","description":"Routing resource UUID in the API key's workspace.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"alert_id":{"default":"","type":"string","maxLength":128},"aggregate":{"default":"","type":"string","maxLength":256},"transition":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","minLength":1,"maxLength":1000},"body":{"default":"","type":"string","maxLength":20000},"priority":{"default":"","type":"string","maxLength":16},"link":{"default":"","type":"string","maxLength":2048}},"required":["transition","title"]},"example":{"alert_id":"12345","aggregate":"a1b2c3","transition":"Triggered","title":"[Triggered] Database unavailable","body":"Primary is refusing connections.","priority":"P1","link":"https://app.datadoghq.com/monitors/12345"}}}},"responses":{"200":{"description":"Committed outcome","content":{"application/json":{"schema":{"type":"object","properties":{"sandbox":{"type":"boolean"},"outcome":{"type":"string","enum":["firing","acknowledged","resolved","unchanged","no_active_incident"]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["sandbox","outcome","incident_id"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Routing resources are outside this workspace"},"413":{"description":"Body exceeds 64 KiB"},"415":{"description":"Use application/json"},"422":{"description":"Invalid event"}}}},"/v1/heartbeats":{"post":{"operationId":"createHeartbeat","summary":"Create a heartbeat","description":"Pages the escalation policy when a job stops checking in. A heartbeat waits for its first ping, then opens one incident when intervalSeconds plus graceSeconds pass without another; the next ping resolves it. The creating key must hold incidents:ingest and incidents:write, and missed-heartbeat incidents are raised as that key, so revoking it stops the pages. Test keys create test heartbeats whose incidents never call a provider. Names are unique per workspace and mode. See /docs/incident-heartbeats.","tags":["Incidents"],"x-scope":"incidents:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"configurationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalationPolicyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":604800},"graceSeconds":{"default":300,"type":"integer","minimum":0,"maximum":86400}},"required":["name","configurationId","escalationPolicyId","intervalSeconds"],"additionalProperties":false},"example":{"name":"nightly-backup","configurationId":"00000000-0000-4000-8000-000000000001","escalationPolicyId":"00000000-0000-4000-8000-000000000002","intervalSeconds":86400,"graceSeconds":1800}}}},"responses":{"201":{"description":"Heartbeat with its ping URL","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"configuration_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalation_policy_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"interval_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grace_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sandbox":{"type":"boolean"},"state":{"type":"string","enum":["waiting","up","missed"]},"last_ping_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"ping_url":{"type":"string"}},"required":["id","name","configuration_id","escalation_policy_id","interval_seconds","grace_seconds","sandbox","state","last_ping_at","due_at","incident_id","ping_url"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Routing resources are outside this workspace"},"409":{"description":"A heartbeat with this name exists"},"415":{"description":"Use application/json"},"422":{"description":"Invalid heartbeat"}}},"get":{"operationId":"listHeartbeats","summary":"List heartbeats","description":"Returns up to 200 heartbeats in the key's workspace and test/live mode, by name. state is waiting before the first ping, missed once the deadline passes, and up otherwise.","tags":["Incidents"],"x-scope":"incidents:read","responses":{"200":{"description":"Heartbeats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"configuration_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalation_policy_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"interval_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grace_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sandbox":{"type":"boolean"},"state":{"type":"string","enum":["waiting","up","missed"]},"last_ping_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"ping_url":{"type":"string"}},"required":["id","name","configuration_id","escalation_policy_id","interval_seconds","grace_seconds","sandbox","state","last_ping_at","due_at","incident_id","ping_url"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/heartbeats/{id}":{"delete":{"operationId":"deleteHeartbeat","summary":"Delete a heartbeat","description":"Stops monitoring. An incident it already opened stays open until resolved.","tags":["Incidents"],"x-scope":"incidents:write","parameters":[{"name":"id","in":"path","description":"The heartbeat id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deleted":{"type":"boolean","const":true}},"required":["id","deleted"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Heartbeat not found"}}}},"/v1/heartbeats/{id}/ping":{"post":{"operationId":"pingHeartbeat","summary":"Ping a heartbeat","description":"Records a check-in and moves the deadline. If the heartbeat had opened an incident, the ping resolves it and cancels pending escalation. Any request body is ignored. The key's test/live mode must match the heartbeat's.","tags":["Incidents"],"x-scope":"incidents:ingest","parameters":[{"name":"id","in":"path","description":"The heartbeat id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Heartbeat after the ping","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"configuration_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalation_policy_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"interval_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grace_seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sandbox":{"type":"boolean"},"state":{"type":"string","enum":["waiting","up","missed"]},"last_ping_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"due_at":{"anyOf":[{"type":"string"},{"type":"null"}]},"incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"ping_url":{"type":"string"},"recovered_incident_id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","name","configuration_id","escalation_policy_id","interval_seconds","grace_seconds","sandbox","state","last_ping_at","due_at","incident_id","ping_url","recovered_incident_id"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Heartbeat not found"}}}},"/v1/incidents":{"get":{"operationId":"listIncidents","summary":"List incidents","description":"Returns up to 50 incidents, newest first. The API key determines the workspace and test/live namespace; neither can be overridden. Follow next_cursor until has_more is false.","tags":["Incidents"],"x-scope":"incidents:read","parameters":[{"name":"cursor","in":"query","description":"The `next_cursor` from the previous page.","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","description":"Filter incident status.","required":false,"schema":{"type":"string","enum":["open","acknowledged","resolved"]}}],"responses":{"200":{"description":"Incident page","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"sandbox":{"type":"boolean"},"occurrence_count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"last_seen_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","title","severity","status","sandbox","occurrence_count","created_at","last_seen_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"],"additionalProperties":false}}}},"400":{"description":"Invalid page cursor"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid query parameters"}}}},"/v1/incidents/{id}":{"get":{"operationId":"getIncident","summary":"Get an incident","description":"Reads current incident state in the API key's workspace and test/live namespace. Unlike an ingestion receipt, this reflects subsequent acknowledgments and resolution. Notification contacts and provider attempts are excluded.","tags":["Incidents"],"x-scope":"incidents:read","parameters":[{"name":"id","in":"path","description":"The incident id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Current incident","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"severity":{"type":"string","enum":["critical","high","medium","low"]},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"sandbox":{"type":"boolean"},"occurrence_count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"last_seen_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"configuration_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalation_policy_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"alias":{"type":"string"},"description":{"type":"string"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"resolved_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","title","severity","status","sandbox","occurrence_count","created_at","last_seen_at","configuration_id","escalation_policy_id","alias","description","acknowledged_at","resolved_at"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Incident not found in this workspace and key mode"}}},"post":{"operationId":"transitionIncident","summary":"Acknowledge or resolve an incident","description":"Use the incident_id returned by alert ingestion. Acknowledgment and resolution cancel pending escalation atomically; resolution also releases the active alias. Repeating the same action is safe and returns unchanged: true when already in the requested state. Resolved incidents cannot be acknowledged or reopened. No Idempotency-Key is required. Actions are attributed to the API key in the incident timeline and audit log. The key is rechecked within the write transaction, and test keys cannot mutate live incidents. The JSON body is limited to 1 KiB.","tags":["Incidents"],"x-scope":"incidents:write","parameters":[{"name":"id","in":"path","description":"The incident id.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["acknowledge","resolve"]}},"required":["action"],"additionalProperties":false},"example":{"action":"resolve"}}}},"responses":{"200":{"description":"Current state after the action","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"unchanged":{"type":"boolean"}},"required":["id","status","unchanged"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Incident not found in this workspace and key mode"},"409":{"description":"Resolved incident cannot be acknowledged"},"413":{"description":"Body exceeds 1 KiB"},"415":{"description":"Content-Type must be application/json"},"422":{"description":"Invalid action"}}}},"/v1/alerts":{"post":{"operationId":"ingestAlert","summary":"Ingest an alert","description":"Accepts an authenticated alert into a persisted incident with durable dispatch intent. Live paging requires a current audited configuration activation backed by supervised approval or ongoing-service consent and readiness evidence; test incidents record simulated notification attempts and never call a delivery provider. The paging_enabled receipt flag records authorization at acceptance, not delivery. Configuration and escalation-policy IDs must belong to the API key's workspace. Test keys use a separate incident namespace. Distinct events with the same alias, configuration and policy join the active incident until it is resolved; acknowledgment is preserved. The incident title and severity retain the first alert's values. Resolution releases the alias for a new incident.\n\nSupply a unique Idempotency-Key of 1–255 non-space printable ASCII characters for each event; reuse it only for an exact retry. Matching retries return the original acceptance body, even after resolution, with Idempotency-Replayed: true. Different normalized payloads with the same key return 409. Receipts have no automatic expiration. The body is limited to 16 KiB. Use source-prefixed aliases to avoid grouping unrelated integrations.","tags":["Incidents"],"x-scope":"incidents:ingest","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key, at most 255 characters. Replaying it returns the original result instead of billing twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"configurationId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"escalationPolicyId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"alias":{"type":"string","minLength":1,"maxLength":128},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"default":"","type":"string","maxLength":4000},"severity":{"default":"high","type":"string","enum":["critical","high","medium","low"]}},"required":["configurationId","escalationPolicyId","alias","title"],"additionalProperties":false},"example":{"configurationId":"00000000-0000-4000-8000-000000000001","escalationPolicyId":"00000000-0000-4000-8000-000000000002","alias":"monitoring:database-primary","title":"Database unavailable","severity":"critical"}}}},"responses":{"202":{"description":"Persisted acceptance receipt and durable dispatch intent; production paging remains gated","content":{"application/json":{"schema":{"type":"object","properties":{"incident_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"alert_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"deduplicated":{"type":"boolean"},"occurrence_count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"sandbox":{"type":"boolean"},"paging_enabled":{"type":"boolean"}},"required":["incident_id","alert_id","status","deduplicated","occurrence_count","sandbox","paging_enabled"],"additionalProperties":false}}}},"400":{"description":"Invalid or missing idempotency key"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `incidents:ingest` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Configuration or policy not found in this workspace"},"409":{"description":"Idempotency key conflicts with a different payload"},"413":{"description":"Body exceeds 16 KiB"},"415":{"description":"Content-Type must be application/json"},"422":{"description":"Invalid alert payload"}}}},"/v1/emails":{"post":{"operationId":"sendEmail","summary":"Send an email","description":"Accepts the message, charges the credits and queues it. The response is the receipt for the submission, not the delivery; delivery events arrive on your webhook.\n\nSend either a body — `subject` plus `html` or `text` — or a template, by `template_id` or `template_friendly_name` but not both. JSON Schema cannot express that, so those fields are all optional below and the API answers 422 when the combination is wrong.","tags":["Emails"],"x-scope":"email:send","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key, at most 255 characters. Replaying it returns the original result instead of billing twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":320},"from_name":{"type":"string","minLength":1,"maxLength":255},"to":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"minItems":1,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}]},"cc":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"minItems":1,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}]},"bcc":{"anyOf":[{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"minItems":1,"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}]},"reply_to":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"subject":{"type":"string","maxLength":998},"html":{"type":"string"},"text":{"type":"string"},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template_friendly_name":{"type":"string","minLength":1,"maxLength":255},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"headers":{"description":"Custom headers to add to the message. Reserved headers are refused with a 422 reserved_header error: Bcc, Cc, Content-Type, Date, DKIM-Signature, From, List-Unsubscribe, List-Unsubscribe-Post, Message-ID, Received, Reply-To, Return-Path, Subject, To, and any X-SES-* header.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attachments":{"description":"Up to 20. Each is either inline base64 or an `upload_id` from POST /v1/attachments.","maxItems":20,"type":"array","items":{"anyOf":[{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"content":{"type":"string","minLength":1,"maxLength":14000000,"description":"Base64-encoded attachment body"},"type":{"type":"string","minLength":1,"maxLength":255},"contentId":{"type":"string","minLength":1,"maxLength":255},"disposition":{"default":"attachment","type":"string","enum":["attachment","inline"]}},"required":["filename","content","type"]},{"type":"object","properties":{"upload_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The `id` from POST /v1/attachments, after the file was uploaded"},"filename":{"description":"Overrides the filename given at upload","type":"string","minLength":1,"maxLength":255},"contentId":{"type":"string","minLength":1,"maxLength":255},"disposition":{"default":"attachment","type":"string","enum":["attachment","inline"]}},"required":["upload_id"]}]}},"scheduled_for":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"batch_id":{"type":"string","minLength":1,"maxLength":255},"message_stream":{"default":"transactional","type":"string","enum":["transactional","broadcast"]},"track_opens":{"default":true,"type":"boolean"},"track_clicks":{"default":true,"type":"boolean"}},"required":["from","to"]},"example":{"from":"Acme <hello@yourdomain.com>","to":"you@example.com","subject":"It arrived.","html":"<p>Nobody noticed. That is the job.</p>"}}}},"responses":{"202":{"description":"Queued, or scheduled if `scheduled_for` was set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"scheduled_for":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]},"suppressed_recipients":{"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"status":{"type":"string","enum":["queued","scheduled"]},"credits_consumed":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","from","to","subject","created_at","scheduled_for","suppressed_recipients","status","credits_consumed"],"additionalProperties":false}}}},"400":{"description":"The `Idempotency-Key` header is missing or too long"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `email:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation"}}}},"/v1/attachments":{"post":{"operationId":"createAttachmentUpload","summary":"Create an attachment upload","description":"Reserves a slot for a file and returns a URL to PUT it to, so the file never travels inside the send request. Upload the raw bytes with the headers given, then send an email whose `attachments` names the slot by `upload_id`.\n\nOne upload can be referenced by any number of sends until it expires. Files are at most 7340032 bytes (7 MB); the message as a whole is capped at 10 MB after encoding.","tags":["Emails"],"x-scope":"email:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","minLength":1,"maxLength":255,"description":"MIME type, sent as the object's Content-Type"},"size_bytes":{"type":"integer","minimum":1,"maximum":7340032,"description":"Exact size of the file in bytes, at most 7340032. The upload must match it."}},"required":["filename","type","size_bytes"]},"example":{"filename":"invoice-1042.pdf","type":"application/pdf","size_bytes":184320}}}},"responses":{"201":{"description":"The slot, with the URL and headers for the PUT","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"upload_url":{"type":"string","format":"uri","description":"PUT the raw file here with the `headers` below. Not a Transmit URL; do not send your API key to it."},"method":{"type":"string","const":"PUT"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"Headers the PUT must carry, exactly as given"},"filename":{"type":"string"},"type":{"type":"string"},"size_bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url_expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"After this the upload URL stops working; request a new slot"},"expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$","description":"A send must reference the upload before this, or it is discarded"}},"required":["id","upload_url","method","headers","filename","type","size_bytes","url_expires_at","expires_at"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `email:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation, or the file is over the size limit"}}}},"/v1/analytics":{"get":{"operationId":"getAnalytics","summary":"Daily email totals","description":"Aggregates by day over the requested range. Defaults to the last 30 days; the range cannot exceed 366 days.","tags":["Analytics"],"x-scope":"analytics:read","parameters":[{"name":"from","in":"query","description":"Start of the range, inclusive. Defaults to 30 days before `to`.","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"End of the range, inclusive. Defaults to now.","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Totals for the range and a row per day","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"totals":{"type":"object","properties":{"accepted":{"type":"integer"},"submitted":{"type":"integer"},"delivered":{"type":"integer"},"bounced":{"type":"integer"},"complained":{"type":"integer"},"opened":{"type":"integer"},"clicked":{"type":"integer"},"credits_used":{"type":"integer"}}},"data":{"type":"array","items":{"type":"object"},"description":"One aggregate per day"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `analytics:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The range is invalid or longer than 366 days"}}}},"/v1/contacts":{"get":{"operationId":"listContacts","summary":"List contacts","tags":["Contacts"],"x-scope":"contact:read","parameters":[{"name":"limit","in":"query","description":"Rows per page, 1–500. Defaults to 100.","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"cursor","in":"query","description":"The `next_cursor` from the previous page.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"A page of contacts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `contact:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"upsertContact","summary":"Create or update a contact","description":"Matches on `email` within your organization: an existing contact is updated, otherwise one is created.","tags":["Contacts"],"x-scope":"contact:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"subscribed":{"type":"boolean"},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["email"]}}}},"responses":{"200":{"description":"The stored contact"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `contact:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation"}}}},"/v1/suppressions":{"get":{"operationId":"listSuppressions","summary":"List suppressions","description":"Workspace addresses that will not be sent to. Filter by `type`: `hard_bounce`, `complaint`, `unsubscribed`, `manual`, `invalid`.","tags":["Suppressions"],"x-scope":"suppression:read","parameters":[{"name":"limit","in":"query","description":"Rows per page, 1–500. Defaults to 100.","required":false,"schema":{"type":"integer","minimum":1,"maximum":500,"default":100}},{"name":"cursor","in":"query","description":"The `next_cursor` from the previous page.","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Restrict to one suppression type.","required":false,"schema":{"type":"string","enum":["hard_bounce","complaint","unsubscribed","manual","invalid"]}}],"responses":{"200":{"description":"A page of suppressions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `suppression:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createSuppression","summary":"Create or import suppressions","description":"One address, or `data` with up to 1,000. Use this to import Mailgun bounce, complaint, and unsubscribe lists. `bounce` and `unsubscribe` are accepted as type aliases. An existing stronger type (complaint, unsubscribe) is not downgraded by a bounce import.","tags":["Suppressions"],"x-scope":"suppression:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"type":{"type":"string","enum":["hard_bounce","bounce","complaint","unsubscribed","unsubscribe","manual","invalid"]},"reason":{"type":"string","maxLength":500}},"required":["email"]},{"type":"object","properties":{"data":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"type":{"type":"string","enum":["hard_bounce","bounce","complaint","unsubscribed","unsubscribe","manual","invalid"]},"reason":{"type":"string","maxLength":500}},"required":["email"]}}},"required":["data"]}]},"example":{"email":"former@example.com","type":"hard_bounce","reason":"Imported from Mailgun"}}}},"responses":{"201":{"description":"The stored suppression, or `{ data, created }` for a bulk import","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"type":{"type":"string","enum":["hard_bounce","complaint","unsubscribed","manual","invalid"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"},{"type":"null"}]}},"required":["id","email","type","reason","reason_code","created_at","expires_at"],"additionalProperties":false}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `suppression:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation"}}}},"/v1/suppressions/{id}":{"delete":{"operationId":"deleteSuppression","summary":"Remove a suppression","description":"Hard bounces, manual entries, and invalid-address rows can be removed. Complaints and unsubscribes cannot — those are opt-outs.","tags":["Suppressions"],"x-scope":"suppression:write","parameters":[{"name":"id","in":"path","description":"The suppression id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Removed"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `suppression:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such suppression, or it is a complaint/unsubscribe and cannot be removed"}}}},"/v1/audiences":{"get":{"operationId":"listAudiences","summary":"List audiences","tags":["Audiences"],"x-scope":"campaign:read","responses":{"200":{"description":"Every audience, each with its contact count","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"},"description":"Audiences"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `campaign:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAudience","summary":"Create an audience","tags":["Audiences"],"x-scope":"campaign:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000},"contact_ids":{"default":[],"maxItems":100000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["name"]}}}},"responses":{"201":{"description":"The created audience"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `campaign:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A contact id does not belong to your organization"}}}},"/v1/campaigns":{"get":{"operationId":"listCampaigns","summary":"List campaigns","tags":["Campaigns"],"x-scope":"campaign:read","responses":{"200":{"description":"Campaigns, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"},"description":"Campaigns"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `campaign:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCampaign","summary":"Create and start a campaign","description":"Starts the send immediately, or holds it until `scheduled_for`.","tags":["Campaigns"],"x-scope":"campaign:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"audience_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"from_name":{"type":"string","maxLength":200},"track_opens":{"default":true,"type":"boolean"},"track_clicks":{"default":true,"type":"boolean"},"scheduled_for":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["name","audience_id","template_id","from"]}}}},"responses":{"202":{"description":"The campaign and the id of the run driving it"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `campaign:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The audience or the template does not exist"}}}},"/v1/templates":{"get":{"operationId":"listTemplates","summary":"List templates","tags":["Templates"],"x-scope":"template:read","responses":{"200":{"description":"Templates, most recently updated first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"},"description":"Templates"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `template:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTemplate","summary":"Create a template","tags":["Templates"],"x-scope":"template:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"friendly_name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"subject":{"type":"string","minLength":1,"maxLength":998},"html":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["friendly_name","name","subject"]},"example":{"friendly_name":"order-shipped","name":"Order shipped","subject":"Your order is on its way","html":"<p>Hello {{name}}, tracking: {{tracking}}.</p>"}}}},"responses":{"201":{"description":"The created template"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `template:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation"}}}},"/v1/templates/{id}":{"get":{"operationId":"getTemplate","summary":"Retrieve a template","description":"Includes every revision and the stored body.","tags":["Templates"],"x-scope":"template:read","parameters":[{"name":"id","in":"path","description":"The template id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The template"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `template:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such template"}}},"patch":{"operationId":"updateTemplate","summary":"Update a template","description":"Changing the body cuts a new revision.","tags":["Templates"],"x-scope":"template:write","parameters":[{"name":"id","in":"path","description":"The template id.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"friendly_name":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9][a-z0-9_-]*$"},"name":{"type":"string","minLength":1,"maxLength":200},"subject":{"type":"string","minLength":1,"maxLength":998},"html":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"text":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"The updated template"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `template:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such template"}}},"delete":{"operationId":"deleteTemplate","summary":"Delete a template","tags":["Templates"],"x-scope":"template:write","parameters":[{"name":"id","in":"path","description":"The template id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `template:write` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such template"}}}},"/v1/sms":{"post":{"operationId":"sendSms","summary":"Send an SMS","description":"Transactional only. The body comes from an approved template rendered with your variables; there is no free-text body, and every send attests the consent basis.","tags":["SMS"],"x-scope":"sms:send","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"A unique key, at most 255 characters. Replaying it returns the original result instead of billing twice.","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"Sender phone number in E.164 format"},"to":{"type":"string","pattern":"^\\+[1-9]\\d{1,14}$","description":"Recipient phone number in E.164 format"},"template_id":{"description":"Approved template id","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template":{"description":"Approved template name (alternative to template_id)","type":"string","minLength":1,"maxLength":100},"variables":{"default":{},"type":"object","propertyNames":{"type":"string","pattern":"^[a-zA-Z][a-zA-Z0-9_]{0,31}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\p{L}\\p{N} .,'#:\\-()/]+$"}},"consent_basis":{"type":"string","enum":["transactional"],"description":"Attestation that the recipient requested this message (transactional)"},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["from","to","consent_basis"]},"example":{"from":"+18885550100","to":"+12025550100","template":"otp","variables":{"code":"483920"},"consent_basis":"transactional"}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string"},"to":{"type":"string"},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","const":"queued"},"segments":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"credits_consumed":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"}},"required":["id","from","to","template_id","status","segments","credits_consumed","created_at"],"additionalProperties":false}}}},"400":{"description":"The `Idempotency-Key` header is missing or too long"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `sms:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation"}}},"get":{"operationId":"listSms","summary":"List SMS messages","tags":["SMS"],"x-scope":"sms:read","parameters":[{"name":"limit","in":"query","description":"Rows per page, 1–100. Defaults to 20.","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","description":"The `next_cursor` from the previous page.","required":false,"schema":{"type":"string"}},{"name":"direction","in":"query","description":"Restrict to one direction.","required":false,"schema":{"type":"string","enum":["outbound","inbound"]}}],"responses":{"200":{"description":"A page of messages, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"},"description":"SMS messages"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"Pass as `cursor` to fetch the next page"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `sms:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sms/{id}":{"get":{"operationId":"getSms","summary":"Retrieve an SMS message","tags":["SMS"],"x-scope":"sms:read","parameters":[{"name":"id","in":"path","description":"The message id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The message and its delivery attempts"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `sms:read` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such message"}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","summary":"List webhook endpoints","tags":["Webhooks"],"x-scope":"webhook:manage","responses":{"200":{"description":"Your endpoints. Secrets are never returned here.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"},"description":"Webhook endpoints"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `webhook:manage` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWebhook","summary":"Create a webhook endpoint","description":"The signing secret is returned once, on creation. Store it: it cannot be read back.","tags":["Webhooks"],"x-scope":"webhook:manage","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name","url","events"]}}}},"responses":{"201":{"description":"The endpoint, including its signing secret"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `webhook:manage` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The URL failed validation or is not reachable from the public internet"}}}},"/v1/webhooks/{id}":{"patch":{"operationId":"updateWebhook","summary":"Update a webhook endpoint","tags":["Webhooks"],"x-scope":"webhook:manage","parameters":[{"name":"id","in":"path","description":"The endpoint id.","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","format":"uri"},"events":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"status":{"type":"string","enum":["ACTIVE","DISABLED"]}}}}}},"responses":{"200":{"description":"The updated endpoint"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `webhook:manage` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such endpoint"}}},"delete":{"operationId":"deleteWebhook","summary":"Disable a webhook endpoint","description":"Endpoints are disabled rather than destroyed, so past deliveries keep their reference.","tags":["Webhooks"],"x-scope":"webhook:manage","parameters":[{"name":"id","in":"path","description":"The endpoint id.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Disabled"},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `webhook:manage` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such endpoint"}}}},"/emails":{"post":{"operationId":"sendEmailResendCompatible","summary":"Send an email, Resend-shaped","description":"The same send as `POST /v1/emails`, at the path and in the body shape a Resend client already uses, so migrating is a base URL and a key. `tags` name/value pairs become `name:value`, `content_type` becomes `type`, `content_id` becomes `contentId`, `template.id` becomes `template_id` (a Transmit template id), and `scheduled_at` becomes `scheduled_for` — but only as an ISO 8601 instant: Resend's relative times (\"in 1 min\") are refused rather than silently sent now. `topic_id` is refused. Errors are `{ name, message, statusCode }`, as the Resend client reads them. Answers with `{ id }`, as Resend does.","tags":["Compatibility"],"x-scope":"email:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"reply_to":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"html":{"type":"string"},"text":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"anyOf":[{"type":"string"},{"type":"boolean","const":false}]},"content":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"Buffer"},"data":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255}}},"required":["type","data"]}]},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]}},"scheduled_at":{"type":"string"},"template":{"type":"object","properties":{"id":{"type":"string"},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["id"]},"topic_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["from","to"]},"example":{"from":"Acme <hello@yourdomain.com>","to":["you@example.com"],"subject":"It arrived.","html":"<p>Nobody noticed.</p>"}}}},"responses":{"200":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `email:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation, or names something we will not silently ignore"}}}},"/emails/batch":{"post":{"operationId":"sendEmailBatchResendCompatible","summary":"Send a batch of emails, Resend-shaped","description":"The path `resend.batch.send` already posts. The body is an array of the same send objects as `POST /emails`, at most 100. Attachments are refused: Resend's batch endpoint does not take them. Default validation is strict (one bad row fails the batch). `x-batch-validation: permissive` queues what it can and returns `{ data, errors }`. Answers `{ data: [{ id }] }`, as Resend does.","tags":["Compatibility"],"x-scope":"email:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"bcc":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"cc":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"reply_to":{"anyOf":[{"type":"string"},{"minItems":1,"type":"array","items":{"type":"string"}}]},"html":{"type":"string"},"text":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attachments":{"type":"array","items":{"type":"object","properties":{"filename":{"anyOf":[{"type":"string"},{"type":"boolean","const":false}]},"content":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"Buffer"},"data":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255}}},"required":["type","data"]}]},"path":{"type":"string"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"tags":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name","value"]}},"scheduled_at":{"type":"string"},"template":{"type":"object","properties":{"id":{"type":"string"},"variables":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["id"]},"topic_id":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["from","to"]}}}}},"responses":{"200":{"description":"Queued. In permissive mode, `errors` names the rows that were not.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}}}},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"string"}}},"description":"Only present when `x-batch-validation` is `permissive`"}}}}}},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `email:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation, or names something we will not silently ignore"}}}},"/v3/mail/send":{"post":{"operationId":"sendEmailSendGridCompatible","summary":"Send an email, SendGrid-shaped","description":"The same send as `POST /v1/emails`, at the path and in the body shape a SendGrid client already uses. Each personalization becomes one message, so a payload addressed to three queues three. `categories` become tags, `send_at` becomes `scheduled_for`, and `dynamic_template_data` becomes `variables`; a SendGrid dynamic template id (`d-…`) names a template that lives in SendGrid, so it is refused. Answers 202 with an empty body and the id in `X-Message-Id`, as SendGrid does.","tags":["Compatibility"],"x-scope":"email:send","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"personalizations":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"to":{"minItems":1,"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}},"cc":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}},"bcc":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]}},"subject":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"dynamic_template_data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"send_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["to"]}},"from":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},"reply_to":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email"]},"subject":{"type":"string"},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"value":{"type":"string"}},"required":["type","value"]}},"attachments":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"filename":{"type":"string"},"type":{"type":"string"},"disposition":{"type":"string","enum":["attachment","inline"]},"content_id":{"type":"string"}},"required":["content","filename"]}},"template_id":{"type":"string"},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"categories":{"type":"array","items":{"type":"string"}},"send_at":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["personalizations","from"]},"example":{"personalizations":[{"to":[{"email":"you@example.com"}]}],"from":{"email":"hello@yourdomain.com"},"subject":"It arrived.","content":[{"type":"text/plain","value":"Nobody noticed."}]}}}},"responses":{"202":{"description":"Queued. `X-Message-Id` carries the first id, `X-Message-Ids` all of them."},"401":{"description":"The API key is missing, malformed, expired or revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the `email:send` scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request failed validation, or names something we will not silently ignore"}}}}}}