Receipts, password resets, sign-in codes, shipping updates: one message to one contact,
because of something they did. POST /v1/transactional/messages sends it by email, push or
both. It needs the transactional:send scope.
Transactional mail is for messages a contact needs, such as receipts and password resets: it ignores marketing preferences and topic choices, so a receipt arrives even after the contact unsubscribed from your newsletter. Of the suppression reasons, only a bounce or a spam complaint on a transactional message stops it: those are facts about the mailbox. An unsubscribe, a suppression added by hand or imported, and a spam complaint on marketing mail stop marketing only. Do not send marketing through it.
The request
An email, written in the request:
{
"to": { "email": "[email protected]" },
"email": {
"from": "Juniper Kitchen <[email protected]>",
"subject": "Reset your password",
"html": "<p>Reset it here: …</p>"
},
"sensitive": true
}email holds the top-level message fields: from, subject, html
(and text, replyTo, previewText), or a stored template by template (its alias
or its id) (Email). Attachments, threading and tracking sit
inside email too. It is named for its channel because one
request can also carry a push, sent instead of or as well as the email:
{
"to": { "externalId": "user_123" },
"data": { "orderId": "1001" },
"email": { "template": "order-shipped" },
"push": { "title": "Order #{{ data.orderId }} shipped", "body": "Track it in the app" },
"fallbackOrder": ["push", "email"],
"correlationId": "order-1001"
}data holds the send’s own values, once for both channels: the stored template, inline
email and the push title and body all read them as {{ data.<key> }} (Data).
fallbackOrder: ["push", "email"] sends the push when the contact can receive it,
and the email only if the push cannot be sent: one request, one idempotency key, and no
device check of your own (Push, and choosing a channel).
Send an Idempotency-Key header: a retry with the same key and body returns the first
message instead of sending again, while the message is kept (see Retries).
It is optional: without one, every request sends. The response is 202 with one message
per channel stored (and one per cc or bcc copy), any channel given but not sent in
skippedChannels, and any copy not sent in skippedCopies:
{
"data": {
"messages": [
{
"id": "…",
"channel": "email",
"status": "queued",
"correlationId": "order-1001",
"createdAt": "2026-10-10T09:00:00.000Z",
"sendAt": null,
"fallbackFor": null,
"copy": null
}
],
"skippedChannels": [],
"skippedCopies": []
}
}Transactional API or a journey?
Use this API when your code decides, at that moment, to send one message: a receipt as
the order completes, a code as someone signs in. You write or name the message, and it
goes now (or at sendAt).
When the message is one step of a flow, track an event instead and let a journey decide:
“after Order Completed, push at once, wait three days, then email a review request
unless they already wrote one”. The trigger is POST /v1/events/track with
your properties, and the journey (built in the dashboard, or by POST /v1/journeys) holds
the channels, waits, conditions and exits. Its messages read the event’s properties as
{{ event.properties.* }}. Changing the flow then needs no deploy, and its stats and
conversion goals come with it.
| You want | Use |
|---|---|
| One message now, decided by your code | POST /v1/transactional/messages |
| Push, or email when the push cannot be sent, in one call | The same, with fallbackOrder: ["push", "email"] |
| Several steps, waits or conditions after something happened | An event and a journey |
| Marketing to many contacts | A campaign |
Who it goes to
to names one contact, in one of three ways:
to |
Who it reaches |
|---|---|
{ "contactId": "…" } |
A contact you know by id. |
{ "externalId": "user_123" } |
Your own id for them; the contact must exist. |
{ "email": "[email protected]" } |
An address. If no contact has it, an email send creates one for transactional mail only (it gets no marketing); a push-only send needs an existing contact. |
to only says who receives the message. To set a new customer’s name or attributes so
the message can use them, call
POST /v1/contacts/identify first. A send never
changes a contact’s details or consent.
Data
data is an object of up to 32 KB beside to. Whatever the content is, a stored
template, inline email or push, it reads a value as {{ data.<key> }}, a nested one as
{{ data.order.total }}, and a list in a repeat block. In a stored template the
editor’s {{ event.properties.<key> }} names the same value.
Content you write in the request is checked against it: an inline email or push whose
{{ data.<key> }} tag has no value in data, and no default
({{ data.coupon | default: "none" }}), is refused with 400 VALIDATION_ERROR at that
field rather than sent with a blank. A stored template’s tag without a value shows its
default, or nothing.
Give the content inline:
// In the body of POST /v1/transactional/messages
"email": {
"subject": "Your order {{ contact.firstName | default: \"\" }}",
"from": "Juniper Kitchen <[email protected]>",
"html": "<p>…</p>",
"text": "…",
"previewText": "…",
"replyTo": "[email protected]"
}or a stored template, named by template: its alias (password-reset) or its id.
An alias can never look like an id, so one field takes either:
// In the body of POST /v1/transactional/messages
"data": { "order_id": "1001" },
"email": { "template": "order-receipt" }A template send renders the template’s published version when the request is
accepted, never its draft, so editing a template cannot change mail in flight; publish to
make a change live. It reads the send’s data. The template’s
transactionalDefaults supply the subject, preview text, sender and reply-to; any of those
you also give in email override them. Without a subject or a sender from either, the
send is refused with 409 TEMPLATE_ENVELOPE_INCOMPLETE. A template that was never
published is refused with 409 TEMPLATE_NOT_PUBLISHED.
The sender’s domain must be verified. From an address on a domain that is not, the send is
refused with 409 SENDING_DOMAIN_UNVERIFIED, and from a new domain Kirora is still
reviewing, with 403 SENDING_REVIEW_REQUIRED. INVALID_SENDER_ADDRESS (400) means
from does not parse as one email address.
Languages
A stored template with translations sends the recipient the version for their
locale (fr-CA gets fr), else the main email. Name one with email.language to
choose for them:
"email": { "template": "password-reset", "language": "fr" }The message’s language says which version went. An email written in the request has
no translations: write it in the recipient’s language.
Attachments
Inside email, inline or from a template:
// In the body of POST /v1/transactional/messages
"email": {
"template": "invoice",
"attachments": [{ "filename": "invoice-1001.pdf", "content": "<base64>" }]
}Up to 10 files, 10 MB in all once decoded; the request may be up to 15 MB. Send an email
with attachments on its own: /v1/transactional/messages/batch refuses them. The extension
sets the type each is sent as, and only these are accepted: pdf, doc, docx, xls,
xlsx, ppt, pptx, odt, ods, odp, rtf, txt, csv, ics, png, jpg,
jpeg, gif, webp, heic. Archives, HTML and SVG are not, since each can carry
something that runs. Attachments go with email only, are kept just until the email is sent,
and are never readable back.
To show an image inside the body rather than attach it, give it a contentId and refer to
it from the HTML as cid::
// In the body of POST /v1/transactional/messages
"attachments": [{ "filename": "logo.png", "content": "<base64>", "contentId": "logo" }]<img src="cid:logo" alt="Juniper Kitchen" />Only an image can be shown inline.
Replying in a conversation
email.threading sets the In-Reply-To and References headers, so a mail client files
the email in the conversation it continues, as a support reply would be:
// In the body of POST /v1/transactional/messages
"threading": { "inReplyTo": "<[email protected]>", "references": ["<[email protected]>", "<[email protected]>"] }Without references, it is inReplyTo alone.
cc and bcc
// In the body of POST /v1/transactional/messages
"email": {
"template": "order-receipt",
"cc": ["[email protected]"],
"bcc": ["[email protected]"]
}Up to 14 addresses across the two. Everyone sees the original To and Cc lines, and
bcc addresses appear in no header.
Each address is sent its own message, so a bounce or complaint always belongs to the address it happened to. That means each copy:
- counts as one email, and is listed in
messageswithcopy: { "kind", "of" }; - carries the same content as the main email, merge tags filled for the main recipient;
- goes only after the main email has been accepted, and not if that email is skipped or fails;
- is not tracked for opens or clicks;
- can be followed by its own id. Cancelling a scheduled email cancels its copies too; cancelling a copy leaves the main email and the other copies alone.
An address that cannot take a copy, because it is suppressed or the plan has no room, is
listed in skippedCopies with its error code, and the rest of the send goes on. An address with no contact gets a transactional-only one, as to does, once its copy is accepted, and it counts toward the plan’s contacts. Copies cannot be
combined with fallbackOrder.
Finished HTML and merge tags
Content is read for merge tags by default. If yours is already finished and may contain
{{ of its own, such as HTML moved from another provider, turn that off:
// In the body of POST /v1/transactional/messages
"email": {
"subject": "Your {{ weekly }} digest",
"from": "[email protected]",
"html": "<p>Use {{ curly }} braces freely.</p>",
"mergeTags": false
}The subject, HTML, text and preview text then go out exactly as written, with nothing
checked or filled in. {{unsubscribe_url}} and {{web_version_url}} still work. It applies
to inline email only.
Opens and clicks
Transactional email is not tracked unless the send asks, inside email:
// In the body of POST /v1/transactional/messages
"tracking": { "opens": true, "clicks": true }The message then gets openedAt, clickedAt and the message.opened and
message.clicked webhooks. Contacts whose country is in the EEA or the UK are never
tracked: the law there needs their consent first. Leave tracking off for a password reset
or a sign-in code; a link rewritten through a tracker can confuse recipients who are being
told to check where a link goes.
Sending later
sendAt holds the send, email and push alike, until a time in the future, at most 90
days ahead; it goes within a minute of that time. It is an ISO 8601 date-time with its
offset (Z for UTC). To send tomorrow at 09:00 UTC from a shell:
SEND_AT=$(date -u -d '+1 day' +%Y-%m-%dT09:00:00Z 2>/dev/null || date -u -v+1d +%Y-%m-%dT09:00:00Z)and put "sendAt": "'"$SEND_AT"'" in the body. A time in the past or more than 90 days
ahead is refused with 400 VALIDATION_ERROR at sendAt. Suppression and push
reachability are checked when the request is accepted (a contact who cannot receive it is
refused then) and again when it goes (one suppressed since is skipped). A
fallbackOrder fallback keeps the same sendAt but goes only after the message before
it fails, is skipped or bounces. A retry with the
same Idempotency-Key replays even after the time has passed.
POST /v1/transactional/messages/{id}/cancel stops a message before then; it becomes
skipped with skip.reason cancelled, and what it reserved of the plan’s allowance (or
paid from the balance this period) is given back; its waiting fallbacks are skipped too,
and cost nothing. Cancelling it again answers 200 with the
message as it is, so a retry after a timeout is safe; 409 CONFLICT means it had already
started sending, or was never timed. A send to both channels is two messages: cancel each.
Push, and choosing a channel
// In the body of POST /v1/transactional/messages
"push": { "title": "…", "body": "…", "actionUrl": "https://…" }reaches the contact’s devices on every app of the workspace’s push project. With more than
one push project, name it: "pushProjectId": "…" beside the fields. As with email, marketing
consent is not needed: it goes to every device of the contact’s that allows notifications,
whatever consent.push says. Give both email and push and
choose with fallbackOrder:
fallbackOrder |
Sends |
|---|---|
| Left out (default) | Each channel the contact can receive. |
["push", "email"] |
The first in that order the contact can receive; the next only if it fails, is skipped or bounces. List every channel given, each once, in the order you want. |
With fallbackOrder, every channel the contact can receive is stored at once. The first goes out;
each later one waits as queued, its fallbackFor naming the message before it. It goes
when that one fails, is skipped or bounces (an email gets 15 minutes to bounce), and is
otherwise skipped with skip.reason fallback_not_needed, which costs nothing and is not
a failure. A fallback is charged only when it goes; if the plan has no room by then, it is
skipped with plan_limit_reached. Push reports nothing past sent: a push Apple, Google or the
browser accepted counts as arrived, even if no device shows it.
A channel the contact cannot receive, or the plan has no room for, is passed over and
listed in skippedChannels with its error code (PUSH_DESTINATION_MISSING,
CONSENT_MISSING, SUPPRESSED, PLAN_LIMIT_REACHED, …). So without fallbackOrder too,
a 202 can leave a channel unsent: check skippedChannels. Only when none is left does the send fail, with that channel’s
error. With one channel, the send fails with that channel’s reason.
Secrets and what is kept
What you send is kept for the workspace’s retention period (30 days by default, readable
at GET /v1/messages/{id}/content with the messages:read scope), so support can see
what a customer received. Mark a send that carries a secret, such as a reset link or a one-time code,
"sensitive": true: its content is removed once sending finishes (sent, failed or
skipped).
Retries
The key is optional, but without one Kirora cannot tell a retry from a new send: a request
that timed out after Kirora accepted it sends the message again when repeated. Reuse the
Idempotency-Key for every retry of the same send: a retry with the same key and request
body gets the messages the first request created, with Idempotency-Replay: true,
without creating another send. The replay is built from the messages as they stand now,
so its status can differ from the first answer (sent where it said queued). A
transactional-only contact that to created stays even when the send was then refused:
a retry finds it. A key is remembered as long
as the messages it sent, so it never expires while you could still retry. After a 5xx or a
timeout, resend the same request with the same key. See Idempotency.
Many at once
POST /v1/transactional/messages/batch takes up to 100 messages, each a single send’s
body under message, with its own optional key:
{
"messages": [
{ "idempotencyKey": "receipt-1001", "message": { "to": { "externalId": "u1" }, "email": { "template": "order-receipt" } } },
{ "idempotencyKey": "receipt-1002", "message": { "to": { "externalId": "u2" }, "email": { "template": "order-receipt" } } }
]
}Each entry gets its own result, in order, with its messages (one per channel the
entry sends, so an entry with both email and push can create two) and replayed, or with
the error a single send would have returned; one refused entry does not stop the rest,
including a send that fails validation (its error is VALIDATION_ERROR with the
issues). Only the batch’s own shape is checked up front: 1–100 entries, no two with the
same idempotencyKey.
A batch counts against the rate limit as one request per entry, on the
send budget. The cost is taken once the batch’s shape is accepted, so an entry that is
then refused still counts. To retry after a 5xx or a timeout, resend the whole batch with
the same keys: entries already accepted replay with replayed: true.
Marketing to a list you choose
A price drop or a back-in-stock notice is marketing, even when each contact’s copy differs.
Send it as a campaign: POST /v1/campaigns/{id}/trigger sends a draft to up to 5,000
contacts you list, each with their own data, read as {{ data.<key> }} as here. It
requires an Idempotency-Key header:
{
"data": { "store": "Shoreditch" },
"recipients": [
{ "externalId": "u1", "data": { "item": "Desk lamp", "price": "$45" } },
{ "email": "[email protected]", "data": { "item": "Chair", "price": "$120" } }
]
}It then goes as any campaign does: only to contacts with marketing consent, with an
unsubscribe link, counted in the campaign’s report. Recipients that name no contact come
back in notFound. A campaign sends once; duplicate it to send again.
What happened
correlationId is your own reference; it comes back on the message and on every webhook
about it, and GET /v1/messages?correlationId=… finds the messages that carried it
(templateId narrows to one template the same way). Transactional sends live in the one
message log with every other message: reading them needs messages:read,
not transactional:send. Follow outcomes with webhooks (message.sent,
message.delivered, message.bounced, message.complained, message.opened,
message.clicked, message.failed, message.skipped) or read GET /v1/messages/{id}.
A skipped message was not sent and says why in skip.reason:
- Email or push:
cancelled(stopped with the cancel call),workspace_suspended,workspace_deletion_pending,contact_deleted, and for afallbackOrderfallbackfallback_not_neededorplan_limit_reached. - Email:
suppressed,test_email,contact_not_found,recipient_email_missing,recipient_email_unsupported,sending_review_required(the sender’s domain is waiting for Kirora’s review),main_email_not_sent(accorbcccopy whose main email did not go). - Push:
push_no_eligible_installations(no device can take it, or the contact cannot receive push). - Campaign and journey messages also:
consent_missing,topic_unsubscribed,local_time_passed,message_limit(the workspace’s message limit held it past its retry window),plan_limit_reached,campaign_cancelled,expired(a campaign’sdelivery.expiresAfterpassed before it was sent), and for emailmissing_merge_tag:<tag>(a merge tag with no value and no default).
For a push send, GET /v1/messages/{id}/deliveries lists what happened on each of the
contact’s devices.
Message statuses
status / event |
Meaning |
|---|---|
queued |
Accepted (202) and stored. Nothing is sent yet, or it waits for sendAt. |
sending |
Being handed to the provider. |
sent / message.sent |
Handed to the email provider or the push service. For push, that means the push service accepted it, not that the device showed it. |
delivered / message.delivered |
Email only. The recipient’s mail server accepted it. This does not show whether it reached the inbox or the spam folder. |
bounced / message.bounced |
Email only. A permanent bounce; the address is now suppressed, unless the bounce was simulated. bounce holds when, its type and the receiving server’s detail. |
complained / message.complained |
Email only. The recipient marked it as spam; the address is now suppressed, unless the complaint was simulated. |
failed / message.failed |
The provider refused it, the email soft-bounced, or Kirora couldn’t send it (not_sent, never caused by your setup). failure.reason says which, for example provider_rejected, transient_bounce, push_provider_rejected or not_sent. It is not sent again; see Messages. |
skipped / message.skipped |
Not sent. skip.reason says why (above). |
message.opened |
The first open, if tracking is on. It may be a machine open (Apple Mail Privacy Protection, Gmail fetching images on delivery, a mail security scanner): check openedByMachine on the message. No second event follows a later open or click by a person. |
message.clicked |
The first click or push tap by a person. A security scanner’s click sends none and sets clickedByMachine. |
“Accepted” in these guides means the request passed validation and checks and the message
was stored (202). Outcomes for test addresses (below) carry simulated: true.
Test addresses
Email to example.com, example.net, example.org (and their subdomains) or to any
.test, .example, .invalid or .localhost address goes through every check a real
send does, then stops before the email provider: it is skipped with test_email,
counts toward no limit, and affects no sending reputation. Build and test with them freely.
Three local parts at those domains act out an outcome instead, so you can see every webhook your handler must cope with:
| Address | Becomes | Webhooks |
|---|---|---|
[email protected] |
delivered |
message.delivered |
[email protected] |
bounced |
message.bounced |
[email protected] |
complained |
message.complained |
A +tag is allowed ([email protected]). Nothing is delivered, nothing is
suppressed, so the same address works for every test, and none of it counts toward the
workspace’s bounce or complaint rates.