Skip to documentation
Dashboard
Emails

Send batch emails

Validate and process up to 100 independent one-recipient transactional emails.

POST/api/v1/emails/batch
On this page

Authentication

Send a RouteKite API key as a Bearer token. This endpoint requires the email:send scope.

Required headers
NameTypeRequirementDescription
AuthorizationstringRequiredBearer API key with the required workspace scope.Example: Bearer rk_your_key
Content-TypestringRequiredMust be application/json.Example: application/json

Request body

Request fields
NameTypeRequirementDescription
emailsemail[]RequiredBetween 1 and 100 one-recipient email items.
emails[].idempotency_keystringRequiredA unique key between 8 and 200 characters for this item.
fromemailRequiredA verified RouteKite Sending Address. Maximum 320 characters.Example: updates@example.com
toemailRequiredExactly one recipient. Maximum 320 characters.Example: customer@example.net
reply_toemailOptionalOverride where replies are delivered for this message.Example: support@example.com
subjectstringDirect contentThe message subject when template_id is not used. Between 1 and 998 characters.Example: Your order is confirmed
preview_textstringOptionalInbox preview shown beside the subject in supported inboxes. Maximum 240 characters. Requires HTML or template_id and may use declared variables with a template.Example: Your receipt and delivery details are inside.
htmlstringDirect contentHTML body when template_id is not used. Provide html, text, or both. Maximum 500,000 characters. RouteKite removes scripts, event handlers, embedded documents, forms, and unsafe URLs before the message is stored.Example: <h1>Thank you</h1>
textstringDirect contentPlain-text body when template_id is not used. Provide html, text, or both. Maximum 200,000 characters.Example: Thank you. Your order is confirmed.
template_iduuidTemplate contentA published transactional template in this workspace.
template_version_iduuidOptionalPin an immutable published version. Omit it to use the current published version.
variablesobjectOptionalValues used to render template variables and lists. Each dynamic image accepts one complete HTTPS URL variable and uses its saved fallback image when that value is omitted. Maximum encoded size is 100,000 characters.Example: { "product": { "image_url": "https://images.example.com/product.jpg" } }
metadataobjectOptionalSmall correlation values. Keys are limited to 80 characters and string values to 500 characters.Example: { "order_id": "ord_123" }
emails[].attachmentsuuid[]OptionalUp to 10 unique ready uploaded attachment IDs. Direct attachments are not supported in batches.

Response

Response fields
NameTypeRequirementDescription
objectstringAlwaysAlways list.
databatch_result[]AlwaysResults in the same order as the request.
data[].indexintegerAlwaysZero-based input position.
data[].idempotency_keystring | nullAlwaysThe submitted item key when available.
data[].iduuidAccepted itemThe accepted email identifier.
data[].errorerrorFailed itemThe stable per-item code, message, status, retryable flag, and optional details.
acceptedintegerAlwaysAccepted item count.
failedintegerAlwaysFailed item count.

Independent results

Each item has its own idempotency key and result. A fully accepted batch returns 202. Any item failure returns 207 with accepted and failed counts.

Errors

StatusCodeWhat it meansWhat to do
400INVALID_REQUESTA required value is missing or invalid.Correct the first validation message.
400IDEMPOTENCY_KEY_REQUIREDThe idempotency key is missing or invalid.Send a stable key between 8 and 200 characters.
401UNAUTHORIZEDThe API key is missing, invalid, revoked, or expired.Check the Bearer header and active key.
402BALANCE_EXHAUSTEDThe billing account does not have enough prepaid balance for this email.Add balance or reduce billable attachment usage before retrying.
403FORBIDDENThe key lacks email:send access.Use a key with the required scope.
403SENDING_PAUSEDWorkspace sending is paused.Resolve the active sending notice in RouteKite.
403BILLING_ACCOUNT_RESTRICTEDSending is restricted for this billing account.Resolve the billing restriction before retrying.
409IDEMPOTENCY_CONFLICTThe key was reused with changed content.Reuse the original payload or create a new key.
409ATTACHMENT_NOT_READYAn attachment has not completed validation.Complete the attachment before sending.
410ATTACHMENT_EXPIREDA referenced attachment is no longer retained.Prepare a new attachment.
413ATTACHMENT_LIMIT_EXCEEDEDThe attachment count or size exceeds the limit.Use no more than 10 files totaling 10 MB.
413PAYLOAD_TOO_LARGEThe encoded email request exceeds 16,000,000 bytes.Use an uploaded attachment ID or reduce the request.
413STORAGE_LIMIT_EXCEEDEDThe account storage allowance cannot accept the temporary file.Remove unused files or use a smaller attachment.
422ATTACHMENT_INVALIDBase64, signature, extension, or content type validation failed.Encode the original supported file as standard Base64 and keep its metadata exact.
422ATTACHMENT_TYPE_UNSUPPORTEDThe file format is not supported.Use one of the documented attachment formats.
422SENDER_UNAVAILABLEThe Sending Address cannot send.Verify it or choose another address.
422TEMPLATE_UNAVAILABLEThe transactional template is not published or available.Publish the template or check its ID.
422INVALID_TEMPLATE_DATARequired variables are missing or invalid.Provide values matching the template variable definitions.
429DAILY_LIMIT_REACHEDThe workspace reached its current daily limit.Wait for the limit window to reset.
429RATE_LIMITEDToo many requests were sent in a short period.Honor Retry-After before retrying.
500 / 503INTERNAL_ERRORRouteKite could not accept the message.Retry cautiously with the same idempotency key.