A consistent REST API
Every route in the REST API answers a declared shape, the same after a write as on a read, with every field present and null when it is empty. Values that name a state are in upper case, every list answers one envelope, and one thing has one name on every route.
Values in upper case
Every value that names a state, a source or a reason is written in upper case. A send's status is SENT, SUPPRESSED, QUEUED, SCHEDULED or CANCELLED, a contact's is SUBSCRIBED, UNSUBSCRIBED, BOUNCED or COMPLAINED, and its source is MANUAL, IMPORT, API, FORM or SYNC. List types, suppression reasons, segment rules and the triggers, delays, conditions, actions and branches of a sequence follow the same rule, and a signup through the API answers ACCEPTED. Identifiers keep their spelling: scopes such as contacts:read, and an attachment's disposition.
A declared shape for every response
Each route answers one documented record, built the same way for a write and for a read, so a contact looks the same after POST /contacts as on GET /contacts/{id}. A field with nothing in it is null rather than left out, so a client can count on every key being there, and a record carries the fields the reference documents and nothing else.
Where a record points at another, it carries the id: an enrollment names its contact, its sequence and its current step. Tags on a contact or a template come with their id, name and colour, a suppression entry carries its tier, and each entry on a contact's timeline says whether it is an event, an email or a sequence step.
One envelope for every list
Every list answers data, totalCount, page, limit and hasNextPage. The page counts from zero, the limit defaults to 50 and stops at 100 on every list, and a count is 0 rather than null when nothing matches. Sending domains and sender identities are paged the same way.
A scheduled send is a send record
A send with sendAt answers the same send record as one that goes out now, with the status SCHEDULED and scheduledAt set. Its id cancels it until it fires, and GET /emails/{id} reads it the whole way: SCHEDULED while it waits, CANCELLED after a cancel, and once it has fired, the send record it became.
Also in this release
- The enrollments of a sequence can be searched by contact. GET /sequences/{id}/enrollments takes term, a partial match on the contact's email, first name or last name, as GET /contacts and GET /lists/{id}/contacts do, and it can be combined with status.
- A value that names a state, a source or a reason is accepted only in the upper-case spelling the reference shows, and any other spelling is refused with 400 rather than corrected. A segment rule on status or source accepts only the operators and values that apply to it, and each contact a bulk enrollment turns away comes with a reason code: CONTACT_NOT_FOUND, ALREADY_ENROLLED or CONTACT_SUPPRESSED.
- Template values are called variables on every route, POST /emails/send-bulk and POST /templates/preview included, and a bulk send names its audience once: exactly one of listId, contactIds or sendToAll.
- Every delete answers { deleted: true } and takes no body. Removing contacts from a list and cancelling enrollments in bulk are POST routes ending in /bulk-remove, which answer the ids they removed and the ids they found nothing to remove for.
- A rate-limited request gets the same error body as every other refusal, tooManyRequests with Retry-After, and an id that is not a UUID answers 400 invalidUUID on every route.
- Validating or previewing a template, verifying a domain and making a sender identity the default answer 200, since none of them creates anything.
- The idempotency key applies to the three send routes, so a read is never answered from a stored response.
Related: The API reference, Send outcomes, The Node SDK
Free trial
See the next one land
Everything listed here is live the day it is listed. Start a trial and use it.
7-day free trial. Pick a plan, add a card, cancel before the trial ends and you won't be charged. 1,000 contacts and 5,000 sends during the trial.