DocsReference
API reference
Every endpoint, field, response and error code.
Basics
- Base URL
https://app.zosmail.com/api/v1- Format
- JSON in, JSON out
- Authentication
Authorization: Bearer zm_...- Times
- ISO 8601, in UTC
Send request bodies as JSON with Content-Type: application/json. Successful responses wrap their result in a data key, and errors are always JSON too. IDs are UUIDs. More about keys.
Send an email
POST /emails
| Field | Type | Rules |
|---|---|---|
from | string or object | Required. "Name <address>", a bare address, or {"email", "name"}. The address must be on a verified domain. |
to | string or array | Required. Up to 50 addresses. Names are ignored and duplicates removed. |
subject | string | Required unless template_id is set. Up to 998 characters. |
html | string | Required unless text or template_id is set. |
text | string | Optional plain-text body. |
reply_to | string | Optional. One email address. |
template_id | integer | Optional. Fills in any subject, HTML or text you leave out. |
variables | object | Optional. Values for {{ placeholders }}. |
category | string | Optional. transactional (default) or marketing. |
The HTML and text together can be up to 50 KB. The response is 202 with one email object per recipient:
{
"data": [
{
"id": "9b1f6c2e-4d0a-4c55-a1f2-6d2b8e7c1a90",
"from": "Acme <[email protected]>",
"to": "[email protected]",
"subject": "Your sign-in code",
"category": "transactional",
"status": "queued",
"created_at": "2026-11-26T10:15:02+00:00",
"sent_at": null,
"delivered_at": null
}
]
}
Get an email
GET /emails/{id}
Returns 200 with one email object under data, or 404 if there's no email with that ID on your account.
The email object
| Field | Description |
|---|---|
id | The email's ID. |
from, to, subject | As sent. |
category | transactional or marketing. |
status | Where the email is now. Every status. |
created_at | When we accepted it. |
sent_at, delivered_at | When it was handed over for delivery, and when the receiving server accepted it. |
opened_at, clicked_at | The first open and the first click, when reported. |
bounced_at, complained_at | When it bounced or was marked as spam. |
error | Only when the status is failed: why it wasn't sent. |
rejection_reason | Only when the status is rejected: why our team didn't send it. |
Times that haven't happened yet are null.
Contacts
List your contact lists
GET /lists
{
"data": [
{ "id": "5f0c7a52-0a3e-4a1b-9a57-3c2e1d9b8f10", "name": "Newsletter", "subscribed": 1280 }
]
}
Add or update a contact
POST /lists/{list}/contacts
| Field | Rules |
|---|---|
email | Required. Up to 255 characters, and must pass the address checks. |
first_name, last_name | Optional. Up to 100 characters each. |
fields | Optional object of custom fields. Up to 30 fields; values up to 500 characters. |
{
"data": {
"id": "c2d1f0a4-7b6e-4f3a-8d2c-1e9f0b7a6c5d",
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"fields": { "city": "London" },
"status": "subscribed"
}
}
201: the contact was added and is subscribed straight away.200: the contact was already on the list. Names and fields were updated; the status didn't change.200with statusunsubscribed: the address is on a suppression list, so it was added but won't get campaigns.402: your contact limit is reached.422: the address failed the checks. The body has areasonand, for typos, asuggestion.
{
"message": "This looks like a typo. Did you mean [email protected]?",
"errors": { "email": ["This looks like a typo. Did you mean [email protected]?"] },
"reason": "typo",
"suggestion": "[email protected]"
}
The reason is one of typo, not_allowed, impossible, made_up, disposable or no_mail_server.
Unsubscribe a contact
DELETE /lists/{list}/contacts/{email}
Marks the contact as unsubscribed on that list and keeps the record. Returns 200 with the contact's email and new status, or 404 if the list or the contact doesn't exist.
Status codes
| Code | Meaning |
|---|---|
200, 201 | Done. |
202 | The email was accepted and will be sent. |
401 | The API key is missing, wrong or revoked. |
402 | Not enough email credits for every recipient, or your credits expired, or your contact limit is reached. |
403 | Your company details are incomplete, sending is paused, the account is suspended, or the request broke a transactional email rule. |
404 | No email, list or contact with that ID on your account. |
422 | A field is invalid, the sender isn't on a verified domain, a recipient failed the address checks, or the email is too large. errors says which field. |
429 | The same transactional email is already being sent by another request. Try again in a moment. |
Errors always have a message you can log or show. Validation errors also have an errors object keyed by field:
{
"message": "Every recipient must be a valid email address.",
"errors": { "to": ["Every recipient must be a valid email address."] }
}