Kraiter
API Reference

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/send

Sends 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

FieldTypeRequiredDescription
tostringYesRecipient email address. Must match an existing contact, or a new contact is created automatically.
templateIdstringYesThe ID of the template to use.
variablesobjectNoKey-value pairs to inject into the template's Liquid variables.
ignoreUnsubscribebooleanNoIf 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

StatusDescription
queuedThe email has been accepted and is waiting to be sent.
sentThe email has been handed off to SES for delivery.
deliveredSES confirmed delivery to the recipient's mail server.
bouncedThe email bounced (hard or soft bounce).
complainedThe recipient marked the email as spam.
rejectedThe send was rejected (e.g. suppressed contact, invalid domain).

Errors

CodeDescription
VALIDATION_ERRORMissing to or templateId, or invalid email format.
NOT_FOUNDThe specified template does not exist.
UNPROCESSABLE_ENTITYThe 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.