Skip to documentation
Dashboard
Emails

Send an email

Validate and queue one transactional email for one recipient.

POST/api/v1/emails
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
Idempotency-KeystringRequiredStable key between 8 and 200 characters.Example: order-123-confirmation
Content-TypestringRequiredMust be application/json.Example: application/json

Request body

Request fields
NameTypeRequirementDescription
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
htmlstringDirect contentHTML body when template_id is not used. Provide html, text, or both. Maximum 500,000 characters.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. Maximum encoded size is 100,000 characters.
metadataobjectOptionalSmall correlation values. Keys are limited to 80 characters and string values to 500 characters.Example: { "order_id": "ord_123" }
attachments(uuid | direct attachment)[]OptionalUp to 10 uploaded attachment IDs, direct Base64 files, or both in delivery order.Example: [{ "filename": "notes.txt", "content_type": "text/plain", "content": "SGVsbG8=" }]
attachments[].filenamestringDirect fileFilename with a supported extension. Maximum 255 characters.Example: invoice.pdf
attachments[].content_typestringDirect fileExact supported MIME type matching the file content and extension.Example: application/pdf
attachments[].contentBase64 stringDirect fileStandard Base64 only. Data URLs and files larger than 5,000,000 decoded bytes are rejected.

Response

Response fields
NameTypeRequirementDescription
iduuidAlwaysThe RouteKite message identifier.
objectstringAlwaysAlways email.
statusstringAlwaysThe current state, normally queued on acceptance.
created_atdate-timeAlwaysWhen RouteKite accepted the message.

Behavior

RouteKite validates the key, Sending Address, recipient, readiness, suppression state, content, attachments, limits, and idempotency before creating a message.

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.
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.
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.