Transactional vs. campaigns
| Transactional | Campaigns | |
|---|---|---|
| Triggered by | API call | Dashboard action or schedule |
| Audience | One or more specific recipients | All subscribed contacts or a segment |
| Subscription check | Ignored — always delivered | Required — only delivered to subscribed contacts |
| Use case | Password reset, invoice, notification | Newsletter, product announcement, promotion |
Transactional emails bypass subscription state by design. A contact who has unsubscribed will still receive a transactional email. If you use a marketing template, however, that restriction still applies — see Template types.
Sending via the API
UsePOST /v1/send with a secret API key. The endpoint accepts a single recipient or an array of recipients in one request.
- Single recipient
- Object format (recommended)
- JavaScript
- Python
Request parameters
The recipient or recipients of the email.
- String:
"[email protected]" - Object:
{ "name": "Jane Doe", "email": "[email protected]" } - Array: mix of strings and objects —
["[email protected]", { "name": "John", "email": "[email protected]" }]
The email subject line. Supports
{{variable}} substitution from the data object.The HTML body of the email. Supports
{{variable}} substitution and {{variable ?? 'fallback'}} syntax.The sender address. Must belong to a verified domain in your project.
- String:
"[email protected]" - Object:
{ "name": "Your App", "email": "[email protected]" }
Display name for the sender. Alternative to passing
from as an object with a name field.Reply-to email address.
ID of a template to use for the email. The template’s
subject, body, from, and fromName are used as defaults — any fields provided in the request override the template values.Key-value pairs used for template variable substitution and, by default, saved as contact data.
- Persistent (default):
"firstName": "Jane"— saved to the contact record and usable in future emails. - Non-persistent:
"resetCode": { "value": "ABC123", "persistent": false }— used only for this email, not saved.
Additional email headers to include, as a flat key-value object. For example,
{ "X-Campaign-ID": "welcome-flow" }.Array of attachment objects. Maximum 10 attachments, 10 MB total. Each object requires:
filename— the filename displayed to the recipientcontent— base64-encoded file contentcontentType— MIME type, e.g."application/pdf"or"image/png"
Explicitly set the contact’s subscription state. If omitted, existing contacts keep their current state; new contacts default to unsubscribed.
Sending to multiple recipients
Pass an array toto to send the same email to multiple recipients in a single API call. Each recipient is processed independently — their contact record is created or updated, variables are resolved against their own data, and a separate email record is created for each.
Sending with attachments
Include theattachments array in the request body. Each attachment must be base64-encoded.
Sending with a template
Pass thetemplate parameter with a template ID to use a saved template. Any fields you provide in the request body (such as subject or from) override the template’s stored values.
data object is merged with the contact’s existing data to resolve {{variable}} placeholders in the template. Non-persistent values (using { "value": "...", "persistent": false }) are available only for this send and are not saved to the contact record.
Subscription state behavior
Transactional emails are delivered regardless of the contact’s subscription state. This makes them appropriate for account and transactional notifications that the user must receive.| Contact state | Email delivered? |
|---|---|
| Subscribed | Yes |
| Unsubscribed | Yes |
/v1/send, a marketing template will not be sent to an unsubscribed contact. Use a transactional template if the email must reach all contacts. See Template types.