ZosMail Docs
Browse the documentation

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
fromstring or objectRequired. "Name <address>", a bare address, or {"email", "name"}. The address must be on a verified domain.
tostring or arrayRequired. Up to 50 addresses. Names are ignored and duplicates removed.
subjectstringRequired unless template_id is set. Up to 998 characters.
htmlstringRequired unless text or template_id is set.
textstringOptional plain-text body.
reply_tostringOptional. One email address.
template_idintegerOptional. Fills in any subject, HTML or text you leave out.
variablesobjectOptional. Values for {{ placeholders }}.
categorystringOptional. 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
idThe email's ID.
from, to, subjectAs sent.
categorytransactional or marketing.
statusWhere the email is now. Every status.
created_atWhen we accepted it.
sent_at, delivered_atWhen it was handed over for delivery, and when the receiving server accepted it.
opened_at, clicked_atThe first open and the first click, when reported.
bounced_at, complained_atWhen it bounced or was marked as spam.
errorOnly when the status is failed: why it wasn't sent.
rejection_reasonOnly 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
emailRequired. Up to 255 characters, and must pass the address checks.
first_name, last_nameOptional. Up to 100 characters each.
fieldsOptional 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.
  • 200 with status unsubscribed: 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 a reason and, for typos, a suggestion.
{
  "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, 201Done.
202The email was accepted and will be sent.
401The API key is missing, wrong or revoked.
402Not enough email credits for every recipient, or your credits expired, or your contact limit is reached.
403Your company details are incomplete, sending is paused, the account is suspended, or the request broke a transactional email rule.
404No email, list or contact with that ID on your account.
422A 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.
429The 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."] }
}

Can't find an answer? Write to [email protected] and a person will reply. Support is by email only.