Emails

Queues one email and answers 202 Accepted with its id. Delivery happens asynchronously — follow it with GET /emails/{id}, GET /emails/{id}/events or webhooks. Either give subject plus html/text, or a published template_id (+ variables). Attachment limits apply to the decoded bytes: 10 MB per file, 25 MB per email, 10 files.

post/emails

Request

Headers

Idempotency-Keystring

Optional dedupe key (printable ASCII, max 64 chars). Used only when the body has no idempotency_key. The official SDKs send one automatically. On batch, element i gets <key>:<i>.

Request body

fromstring required
tostring[] required
ccstring[]
bccstring[]
reply_tostring email
subjectstring
htmlstring
textstring
headersobject
tagsstring[]
idempotency_keystring
template_idstring
variablesobject
unsubscribeboolean
signature'auto' | 'none'
idempotency_window_hoursinteger

Response

Accepted and queued (or replayed — see replayed).

idstring required

Public email id (em_…). Every email endpoint is addressed by this id.

replayedboolean

Present and true when idempotency_key (or the Idempotency-Key header) matched an earlier send: id is that email and nothing was sent. The response also carries X-Idempotent-Replay: true.

test_modetrue

Present only when authenticated with an sk_test_ key: the email was recorded and marked delivered but never handed to a mail server.

spam_scorenumber

rspamd score of the rendered message (omitted when the spam check was skipped).

Example response

{
  "id": "em_8c1f3a2b9d4e5f60718293a4"
}

Changes

    • warning

      the / request property's maxLength was set to 320

    • warning

      the / request property's maxLength was set to 320

    • warning

      the request property's maxLength was set to 998

    • warning

      the request property's maxLength was set to 320

    • warning

      the / request property's maxLength was set to 320

    • breaking

      the request property type changed from string to no type, and format from date-time to no format

    • info

      added subschema #1 subschema #2 to the request property anyOf list

    • info

      removed the 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))$ from the request property