Send
Send transactional emails to individual recipients using templates and dynamic variables.
The Send endpoint delivers a single transactional email immediately. Use this for password resets, order confirmations, welcome emails, and other one-off messages that are triggered by user actions.
For bulk or automated sending, use Sequences instead.
Send transactional email
POST /api/sendSends a single email to a recipient using a pre-defined template. The template is rendered with the provided variables and delivered via your verified domain.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address. Must match an existing contact, or a new contact is created automatically. |
templateId | string | Yes | The ID of the template to use. |
variables | object | No | Key-value pairs to inject into the template's Liquid variables. |
ignoreUnsubscribe | boolean | No | If true, sends even if the contact has unsubscribed. Use only for legally required messages (e.g. receipts, security alerts). Defaults to false. |
Response
Returns the created send record.
{
"id": "snd_01H9...",
"to": "alice@example.com",
"templateId": "password-reset",
"status": "queued",
"createdAt": "2025-09-15T14:30:00.000Z"
}Send statuses
| Status | Description |
|---|---|
queued | The email has been accepted and is waiting to be sent. |
sent | The email has been handed off to SES for delivery. |
delivered | SES confirmed delivery to the recipient's mail server. |
bounced | The email bounced (hard or soft bounce). |
complained | The recipient marked the email as spam. |
rejected | The send was rejected (e.g. suppressed contact, invalid domain). |
Errors
| Code | Description |
|---|---|
VALIDATION_ERROR | Missing to or templateId, or invalid email format. |
NOT_FOUND | The specified template does not exist. |
UNPROCESSABLE_ENTITY | The contact is suppressed and ignoreUnsubscribe is false. |
Examples
curl -X POST https://api.kraiter.com/api/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "alice@example.com",
"templateId": "password-reset",
"variables": {
"resetUrl": "https://app.example.com/reset?token=abc123",
"expiresIn": "24 hours"
}
}'const send = await kraiter.send({
to: "alice@example.com",
templateId: "password-reset",
variables: {
resetUrl: "https://app.example.com/reset?token=abc123",
expiresIn: "24 hours",
},
});Sending to suppressed contacts
By default, the API rejects sends to contacts who have unsubscribed or been suppressed. For legally required messages (receipts, security alerts, account notifications), set ignoreUnsubscribe to true:
curl -X POST https://api.kraiter.com/api/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "alice@example.com",
"templateId": "security-alert",
"variables": { "action": "Password changed" },
"ignoreUnsubscribe": true
}'const send = await kraiter.send({
to: "alice@example.com",
templateId: "security-alert",
variables: { action: "Password changed" },
ignoreUnsubscribe: true,
});Use ignoreUnsubscribe sparingly. Sending marketing content to suppressed contacts violates anti-spam regulations and can damage your sender reputation.
Template variables
Variables are injected into the template using Liquid syntax. For example, a template with {{ resetUrl }} will be replaced with the value of variables.resetUrl. If a required variable is missing, the template renders with an empty string for that placeholder.
See the Templates reference for details on template creation and variable declaration.