API reference
Emails
Send one email or a batch, and look up what became of each recipient.
Send one email.
POST/v1/emails
Needs an API key with the email:send scope. Operation sendEmail
Accepts the message and queues it; the 202 means it is certain to be attempted, not that it was delivered. At most 50 recipients in all.
Addresses at simulator.test are never delivered, with a test key or a live one: the outcome named by the part before the @ is simulated. With a live key a message may not mix them with real recipients (422 on to); send them separately. An Idempotency-Key is remembered separately for test keys and live keys, so a live request that reuses a test request's key is sent.
stream defaults to transactional. marketing and promotional need a key with campaign:write (403 stream_not_allowed otherwise) and are held to every check of the compliance engine:
- every recipient must be a contact of the organisation who is
subscribed(notpendingdouble opt-in), has not unsubscribed or opted out of the category, is not suppressed and did not bounce or complain, whose consent was attested (basisconsent; basisunknownis refused unless the deployment allows it), and who has not reached the contact-frequency limit; - the message must have exactly one recipient in
to,ccandbcctogether (422single_recipient_required): it carries that recipient's own unsubscribe link. Use/v1/emails/batchfor several people; - the organisation must have set its postal address (422
postal_address_not_set).
The platform makes every such message unsubscribable when it sends it: List-Unsubscribe: <https://…/api/v1/public/unsubscribe?token=…> and List-Unsubscribe-Post: List-Unsubscribe=One-Click (RFC 8058; any List-Unsubscribe or List-Unsubscribe-Post in headers is replaced, not merged), and a footer in the HTML and the text part with an unsubscribe link, a link to the recipient's email preferences and the postal address. To place these yourself, write {{unsubscribe_url}}, {{preferences_url}} and {{postal_address}} (spaces inside the braces allowed): they are filled in, HTML-escaped in the HTML part, and a part that contains {{unsubscribe_url}} gets no footer, so it must show the postal address too (422 business_identification_missing otherwise; unsubscribe_missing cannot occur unless a part lacks the link). Transactional mail is sent exactly as submitted.
A refused recipient refuses the request (403, the reason as code, the recipient in details); nothing is stored. The checks run again when the message is sent: a recipient who unsubscribed in between, by any means including the one-click link, is cancelled with the reason. Transactional mail is checked only against the organisation, the domain, the sender and the suppression list, as before.
With an Idempotency-Key, the same key and body returns the original response with Idempotent-Replayed: true and creates nothing; the same key with a different body is 422 idempotency_key_reused. Keys are kept for 24 hours.
Templates. Instead of subject, html and text, send template_id (a template of the organisation, see Templates) with template_data for its merge tags: the template's published current version is sent (422 template_not_published if it has none, 422 validation_failed for an unknown ID). The message's stream is the template's category, and a stream that is given must match it (422 template_category_mismatch). Everything above applies to the filled-in content exactly as if it had been sent as subject, html and text, the compliance checks of marketing and promotional mail included.
Parameters
Idempotency-KeyheaderoptionalMakes the request safe to retry. 1 to 255 printable ASCII characters without spaces.
string
length 1 to 255pattern: ^[\x21-\x7e]+$
Request body
SendEmailRequestSendEmailRequest
fromstringrequiredThe sender, optionally with a name:
Shop <orders@shop.example>. Its domain must be verified.tostring or string[]requiredOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.ccstring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.bccstring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.reply_tostring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.subjectstringoptionalOne line, at most 998 bytes.
htmlstringoptionalThe HTML body. Give
html,textor both.textstringoptionalThe plain text body.
headersobjectoptionalUp to 20 custom headers. Only
X-*,List-Unsubscribe,List-Unsubscribe-Post,In-Reply-ToandReferencesmay be set. On marketing and promotional mail the platform setsList-UnsubscribeandList-Unsubscribe-Postitself and drops yours.other keys: string valuestagsobjectoptionalUp to 10 tags. Names and values are 1 to 64 letters, digits, hyphens or underscores.
other keys: string valuesstreamStreamoptionalDefaults to
transactional, or to the template's category withtemplate_id; withtemplate_ida stream that is given must be the template's category.One oftransactionalmarketingpromotionaltemplate_iduuidoptionalSend a template's published current version instead of
subject,htmlandtext, which must then be left out. Its merge tags are filled fromtemplate_data.template_dataTemplateDataoptionalValues for a template's merge tags:
{{first_name}},{{last_name}},{{email}}and{{fields.<key>}}. At most 1,000 characters each and 50 fields; field values are strings, numbers or booleans. A tag with no value takes its fallback ({{first_name|there}}) or nothing.Show fields (4)Fields (4)
first_namestringoptionallast_namestringoptionalemailstringoptionalDefaults to the first
toaddress when sending.fieldsobjectoptionalother keys: string values
Responses
- 202EmailReceipt
The message was accepted and queued.
Idempotent-Replayedheader: `true` when this is the stored response of an earlier request with the same `Idempotency-Key`. Absent otherwise.
object
dataEmailReceiptrequiredWhat the API returns for an accepted message.
Show fields (4)Fields (4)
iduuidrequiredUse it to look the email up later.
statusstringrequiredalways "queued"streamStreamrequiredThe kind of email. Streams do not share sending controls.
One oftransactionalmarketingpromotionaltest_modebooleanrequiredWhether a test key submitted it.
- 400BadRequest
invalid_json: the body is not one JSON object, or has a field this endpoint does not accept.
The body is the error envelope.
- 401InvalidApiKey
unauthenticated: no API key was sent.invalid_api_key: the key is unknown, revoked or expired.
The body is the error envelope.
- 403SendingRefused
insufficient_scope: the API key does not holdemail:send.account_suspended: the organisation is suspended.account_closed: the organisation has been closed.stream_disabled: sending on this stream has been turned off for the organisation.stream_not_allowed: the key may only send transactional email.domain_not_verified: the From domain is not registered or not verified.domain_disabled: the From domain has been disabled.sender_not_authorised: the From address may not be used.
Marketing and promotional only, when a recipient is refused by the compliance engine (
detailsnames each refused recipient;codeis the first one's reason):recipient_not_a_contact,consent_pending,consent_basis_unknown(checkconsent_or_lawful_basis);recipient_unsubscribed,category_opted_out(checknot_unsubscribed);recipient_suppressed,contact_bounced,contact_complained(checknot_suppressed);frequency_limit_reached(checkcontact_frequency).The body is the error envelope.
- 422SendingInvalid
validation_failed:detailsnames each invalid field (Idempotency-Keyfor a bad key).
Marketing and promotional only (check
identification_and_unsubscribe):single_recipient_required: more than one recipient (each needs their own unsubscribe link);postal_address_not_set: the organisation has not set its postal address;business_identification_missing: a body part that places its own footer ({{unsubscribe_url}}) does not show the postal address;unsubscribe_missing: a body part lacks the unsubscribe link (only possible with a customer layout).idempotency_key_reused: the key was used before with a different body.template_not_published:template_idnames a template with no published version.template_category_mismatch:streamis not the template's category.
The body is the error envelope.
- 429RateLimited
rate_limited: too many requests. WaitRetry-Afterseconds.
Retry-Afterheader: How many seconds to wait before trying again.RateLimit-Limitheader: How many requests the limit that stopped this one allows per period.RateLimit-Remainingheader: How many requests are left in the current period.
The body is the error envelope.
Example
curl -X POST https://api.cirrusmail.example/v1/emails \
-H "Authorization: Bearer $CIRRUS_API_KEY" \
-H "Idempotency-Key: order-42" \
-H "Content-Type: application/json" \
-d '{
"from": "Shop <orders@shop.example>",
"to": "ann@example.org",
"subject": "Your order is on its way",
"text": "Thanks for your order. It will arrive on Friday."
}'{
"data": {
"id": "b3c1f5a4-7d2e-4c8a-9a1b-0e6f2d4a8c11",
"status": "queued",
"stream": "transactional",
"test_mode": false
}
}Set CIRRUS_API_KEY to your key. The values are examples.
Send up to 100 emails in one request.
POST/v1/emails/batch
Needs an API key with the email:send scope. Operation sendEmailBatch
All or nothing: one invalid message rejects the whole batch, with field names such as emails[3].to. The stream and idempotency rules of POST /v1/emails apply.
Parameters
Idempotency-KeyheaderoptionalMakes the request safe to retry. 1 to 255 printable ASCII characters without spaces.
string
length 1 to 255pattern: ^[\x21-\x7e]+$
Request body
SendEmailBatchRequestSendEmailBatchRequest
emailsSendEmailRequest[]required1 to 100 itemsShow fields (13)Fields (13)
fromstringrequiredThe sender, optionally with a name:
Shop <orders@shop.example>. Its domain must be verified.tostring or string[]requiredOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.ccstring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.bccstring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.reply_tostring or string[]optionalOne email address, or a list of them. Each may carry a name, as in
Ann <ann@example.org>.subjectstringoptionalOne line, at most 998 bytes.
htmlstringoptionalThe HTML body. Give
html,textor both.textstringoptionalThe plain text body.
headersobjectoptionalUp to 20 custom headers. Only
X-*,List-Unsubscribe,List-Unsubscribe-Post,In-Reply-ToandReferencesmay be set. On marketing and promotional mail the platform setsList-UnsubscribeandList-Unsubscribe-Postitself and drops yours.other keys: string valuestagsobjectoptionalUp to 10 tags. Names and values are 1 to 64 letters, digits, hyphens or underscores.
other keys: string valuesstreamStreamoptionalDefaults to
transactional, or to the template's category withtemplate_id; withtemplate_ida stream that is given must be the template's category.One oftransactionalmarketingpromotionaltemplate_iduuidoptionalSend a template's published current version instead of
subject,htmlandtext, which must then be left out. Its merge tags are filled fromtemplate_data.template_dataTemplateDataoptionalValues for a template's merge tags:
{{first_name}},{{last_name}},{{email}}and{{fields.<key>}}. At most 1,000 characters each and 50 fields; field values are strings, numbers or booleans. A tag with no value takes its fallback ({{first_name|there}}) or nothing.Show fields (4)Fields (4)
first_namestringoptionallast_namestringoptionalemailstringoptionalDefaults to the first
toaddress when sending.fieldsobjectoptionalother keys: string values
Responses
- 202
Every message was accepted. One receipt per message, in order.
Idempotent-Replayedheader: `true` when this is the stored response of an earlier request with the same `Idempotency-Key`. Absent otherwise.
object
dataEmailReceipt[]requiredShow fields (4)Fields (4)
iduuidrequiredUse it to look the email up later.
statusstringrequiredalways "queued"streamStreamrequiredThe kind of email. Streams do not share sending controls.
One oftransactionalmarketingpromotionaltest_modebooleanrequiredWhether a test key submitted it.
- 400BadRequest
invalid_json: the body is not one JSON object, or has a field this endpoint does not accept.
The body is the error envelope.
- 401InvalidApiKey
unauthenticated: no API key was sent.invalid_api_key: the key is unknown, revoked or expired.
The body is the error envelope.
- 403SendingRefused
insufficient_scope: the API key does not holdemail:send.account_suspended: the organisation is suspended.account_closed: the organisation has been closed.stream_disabled: sending on this stream has been turned off for the organisation.stream_not_allowed: the key may only send transactional email.domain_not_verified: the From domain is not registered or not verified.domain_disabled: the From domain has been disabled.sender_not_authorised: the From address may not be used.
Marketing and promotional only, when a recipient is refused by the compliance engine (
detailsnames each refused recipient;codeis the first one's reason):recipient_not_a_contact,consent_pending,consent_basis_unknown(checkconsent_or_lawful_basis);recipient_unsubscribed,category_opted_out(checknot_unsubscribed);recipient_suppressed,contact_bounced,contact_complained(checknot_suppressed);frequency_limit_reached(checkcontact_frequency).The body is the error envelope.
- 422SendingInvalid
validation_failed:detailsnames each invalid field (Idempotency-Keyfor a bad key).
Marketing and promotional only (check
identification_and_unsubscribe):single_recipient_required: more than one recipient (each needs their own unsubscribe link);postal_address_not_set: the organisation has not set its postal address;business_identification_missing: a body part that places its own footer ({{unsubscribe_url}}) does not show the postal address;unsubscribe_missing: a body part lacks the unsubscribe link (only possible with a customer layout).idempotency_key_reused: the key was used before with a different body.template_not_published:template_idnames a template with no published version.template_category_mismatch:streamis not the template's category.
The body is the error envelope.
- 429RateLimited
rate_limited: too many requests. WaitRetry-Afterseconds.
Retry-Afterheader: How many seconds to wait before trying again.RateLimit-Limitheader: How many requests the limit that stopped this one allows per period.RateLimit-Remainingheader: How many requests are left in the current period.
The body is the error envelope.
Example
curl -X POST https://api.cirrusmail.example/v1/emails/batch \
-H "Authorization: Bearer $CIRRUS_API_KEY" \
-H "Idempotency-Key: order-42" \
-H "Content-Type: application/json" \
-d '{
"emails": [
{
"from": "Shop <orders@shop.example>",
"to": "ann@example.org",
"subject": "Your order",
"text": "Thanks, Ann."
},
{
"from": "Shop <orders@shop.example>",
"to": "bo@example.org",
"subject": "Your order",
"text": "Thanks, Bo."
}
]
}'{
"data": [
{
"id": "b3c1f5a4-7d2e-4c8a-9a1b-0e6f2d4a8c11",
"status": "queued",
"stream": "transactional",
"test_mode": false
}
]
}Set CIRRUS_API_KEY to your key. The values are examples.
Get an email with the status of each recipient.
GET/v1/emails/{emailID}
Needs an API key with the email:read scope. Operation getEmail
Parameters
emailIDpathrequiredThe ID returned when the email was submitted.
uuid
Responses
- 200Message
The message with its recipients. Never the body.
object
dataMessagerequiredA submitted email. The body is never returned.
Show fields (11)Fields (11)
iduuidrequiredstatusMessageStatusrequiredThe status its recipients share, or
mixedwhen they differ.One ofqueuedsendingsentdelayeddeliveredbouncedcomplainedcancelledfailedunknownmixedreasonstringoptionalWhy the message was cancelled or failed, as a code. Absent otherwise. A message cancelled by the compliance engine carries the reason of its first recipient; see
MessageRecipient.reason.streamStreamrequiredThe kind of email. Streams do not share sending controls.
One oftransactionalmarketingpromotionalfromstringrequiredThe sender's address.
subjectstringrequiredtostringrequiredThe first recipient;
recipient_countsays how many there are.recipient_countintegerrequiredtest_modebooleanrequiredsubmitted_atdate-timerequiredWhen the API accepted the request.
recipientsMessageRecipient[]optionalThe status of each recipient. Left out of lists.
Show fields (11)Fields (11)
emailstringrequiredtypestringrequiredOne oftoccbccstatusRecipientStatusrequiredWhere one recipient's copy is:
queued,sending,sent(the provider accepted it),delayed(soft bounce),delivered(the recipient's mail server accepted it),bounced(hard bounce),complained,cancelled(stopped by a sending rule; seereason),failed(the provider refused it) orunknown(the provider's answer was lost).One ofqueuedsendingsentdelayeddeliveredbouncedcomplainedcancelledfailedunknownreasonstringoptionalWhy this recipient was cancelled or failed. Absent otherwise. A recipient cancelled by the compliance engine at the moment of sending carries one of its reason codes, each belonging to one of the eight checks:
account_and_domain_active:account_suspended,account_closed,organisation_not_active,
stream_disabled,domain_not_registered,domain_not_verified,domain_disabled;sender_authorised:sender_not_authorised;consent_or_lawful_basis:recipient_not_a_contact,consent_pending,not_on_list,
consent_basis_unknown;not_unsubscribed:recipient_unsubscribed,category_opted_out,list_opted_out;not_suppressed:recipient_suppressed,contact_bounced,contact_complained;contact_frequency:frequency_limit_reached;sending_allowance:quota_exceeded,campaign_paused;identification_and_unsubscribe:single_recipient_required,unsubscribe_missing,postal_address_not_set,
business_identification_missing.accepted_atdate-timerequiredcan be nullWhen the email provider accepted the message.
delivered_atdate-timerequiredcan be nullWhen the recipient's mail server accepted it. Not proof that it reached the inbox or was read.
hard_bounced_atdate-timerequiredcan be nullsoft_bounced_atdate-timerequiredcan be nullcomplained_atdate-timerequiredcan be nullcancelled_atdate-timerequiredcan be nullfailed_atdate-timerequiredcan be null
- 401InvalidApiKey
unauthenticated: no API key was sent.invalid_api_key: the key is unknown, revoked or expired.
The body is the error envelope.
- 403InsufficientScope
insufficient_scope: the API key does not hold the scope this operation needs.account_suspended: the organisation is suspended; none of its keys work until that is lifted.account_closed: the organisation has been closed; none of its keys will work again.
The body is the error envelope.
- 404NotFound
not_found: the resource does not exist, or belongs to an organisation the caller is not a member of.
The two are not told apart, so IDs cannot be probed.
The body is the error envelope.
- 429RateLimited
rate_limited: too many requests. WaitRetry-Afterseconds.
Retry-Afterheader: How many seconds to wait before trying again.RateLimit-Limitheader: How many requests the limit that stopped this one allows per period.RateLimit-Remainingheader: How many requests are left in the current period.
The body is the error envelope.
Example
curl https://api.cirrusmail.example/v1/emails/b3c1f5a4-7d2e-4c8a-9a1b-0e6f2d4a8c11 \
-H "Authorization: Bearer $CIRRUS_API_KEY"{
"data": {
"id": "b3c1f5a4-7d2e-4c8a-9a1b-0e6f2d4a8c11",
"status": "queued",
"reason": "string",
"stream": "transactional",
"from": "Shop <orders@shop.example>",
"subject": "Your order",
"to": "string",
"recipient_count": 0,
"test_mode": false,
"submitted_at": "2026-01-15T09:30:00Z",
"recipients": [
{
"email": "ann@example.org",
"type": "to",
"status": "queued",
"reason": "string",
"accepted_at": "2026-01-15T09:30:00Z",
"delivered_at": "2026-01-15T09:30:00Z",
"hard_bounced_at": "2026-01-15T09:30:00Z",
"soft_bounced_at": "2026-01-15T09:30:00Z",
"complained_at": "2026-01-15T09:30:00Z",
"cancelled_at": "2026-01-15T09:30:00Z",
"failed_at": "2026-01-15T09:30:00Z"
}
]
}
}