API reference

Send email from your app, and read what happened to it.

Introduction

The AcornDispatch API sends email from your app and tells you what happened to it. It also manages people, streams, suppressions, webhooks and mailing drafts.

The base URL is https://api.acorndispatch.com. Every path starts with /api/v1 after it, and the samples show the full URL. Requests and answers are JSON, except the image upload.

There is no SMTP endpoint. Send through the REST API only.

Authentication

Send the API key in the Authorization header on every request:

Authorization: Bearer $ACORNDISPATCH_API_KEY

A workspace Admin creates keys on the APIs & Keys page in AcornDispatch and picks the scopes of each. Every key starts with adn_. Keep the key in a server-side secret. No other auth header works.

A missing or wrong key gets 401 unauthorized. A key without the scope a route needs gets 403 forbidden. Where a route lists two scopes, either one works.

  • email:sendSend emailSend one email to one person from a stream. Also sends a batch, reads and lists messages, reads sending stats, lists streams and checks the suppressions of an address.
  • streams:writeManage streamsCreate and edit streams. Also lists, pauses and resumes streams.
  • topics:writeManage topicsCreate, edit and archive topics.
  • suppressions:writeManage suppressionsCheck, add and lift the suppressions of an address.
  • people:writeManage peopleAdd, update and delete people by their id or email address.
  • webhooks:writeManage webhooksCreate, edit and delete webhooks. Also lists webhooks.
  • mailings:writeWrite drafts and send testsCreate and edit drafts. Send tests to workspace members and allowed addresses only. Prepare a schedule for a person to confirm. Also manages the variants of an A/B test.
  • assets:writeUpload imagesPNG, JPEG, GIF or WebP, up to 5 MB each.
  • mailings:readRead mailingsSee drafts, scheduled and sent mailings.
  • reports:readRead resultsResults of each mailing, and how healthy your sending is. Reads the report of a mailing.
  • audiences:readRead audiencesAudience names and how many people are in each.

A key can prepare a schedule but never schedule or send a mailing. A person confirms that in AcornDispatch.

Errors

Every error has this form:

{ "error": { "code": "from_domain_not_allowed", "message": "The from domain is not the sending domain of the workspace." } }
  • Branch on code, not on message. Message texts can change.
  • recipient_inactive also has error.reason, and the MessageID, To and SubmittedAt of the stored message at the top level.
  • A batch answers 200 and puts each refusal in its own entry. See Send a batch.
  • A message that was accepted can still fail before it goes out. Its status is then failed with a failure.code. See Failures.

Each code, its HTTP status and what it means are in the error table.

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unsupported_field422Cc or Bcc has a value, To holds more than one address, or a template send sets TrackOpens or TrackLinks.
  • template_not_found422TemplateAlias names no template of the workspace.
  • template_archived422TemplateAlias names a template that is archived. Nothing is stored.
  • topic_not_found422Topic names no topic of the workspace. Nothing is stored.
  • topic_archived409 or 422The topic is archived. A send that names it gets 422, and nothing is stored. A change to it gets 409.
  • from_required422A template send has no From, the template has no sender, and the workspace has no default sender.
  • from_invalid422From is not one valid mailbox. See From address.
  • from_domain_not_allowed422The From domain is not the sending domain or a subdomain of it.
  • sending_domain_taken409Another workspace uses the From domain.
  • stream_required422A message of a batch has no MessageStream. A batch names the stream of every message; a single send without it uses the default transactional stream.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • stream_archived422A send or a webhook's streams names an archived stream. A default stream is never archived.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • stream_under_review409A resume names a stream that AcornDispatch paused while it reviews delivery. Only AcornDispatch resumes it.
  • link_domain_missing422The message needs the workspace link domain, and the workspace has none. See Unsubscribe links and tracking.
  • list_unsubscribe_not_allowed422Headers sets List-Unsubscribe or List-Unsubscribe-Post on a broadcast stream. AcornDispatch sets both there.
  • recipient_inactive422The recipient cannot get this message. error.reason is suppressed, address_not_found or unsubscribed. The message is stored as skipped, so the answer also has its MessageID, To and SubmittedAt.
  • idempotency_conflict409The Idempotency-Key was used with a different request. See Idempotency.
  • payload_too_large413The body is over the route's limit. See Body size.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • stream_key_taken409Another stream of the workspace has this key. Archived streams count.
  • stream_key_invalid422The stream key breaks the key rule. See the stream object.
  • stream_key_immutable422The key of a stream never changes after the stream is created.
  • stream_kind_immutable422A stream cannot change its kind.
  • stream_auto_pause_transactional422Only a broadcast stream can have auto_pause.
  • address_not_allowed422A mailing test send names an address that is not a workspace member or on the test list. The send routes never answer it.
  • internal_error500Something failed on our side. Retry with the same Idempotency-Key. In a batch, only that entry has it.
  • topic_key_invalid422The topic key breaks the key rule. See the topic object.
  • topic_key_taken409Another topic of the workspace has this key. Archived topics count.
  • topic_key_fixed409The key of a topic never changes after the topic is created.
  • topic_default_fixed409default_subscribed cannot change once the topic covers email or a person has made a choice.

Rate limits

  • Each key may make 60 requests per minute, counted per clock minute. Every route has this limit except the two send routes.
  • POST /api/v1/email and POST /api/v1/email/batch have no request limit. AcornDispatch paces the delivery itself.
  • Over the limit, a route answers 429 rate_limited with a retry-after header in seconds. Wait that long, then retry.
  • A request counts once its key is valid, also when it then fails, for example on a missing scope.

Pagination

GET /api/v1/messages and GET /api/v1/mailings answer one page at a time:

{ "data": [ ... ], "next_cursor": "MjAyNi0xMS0xMF..." }
  • limit sets the page size: 1 to 100 on messages (default 20), 1 to 100 on mailings.
  • For the next page, send cursor with the next_cursor of the previous page and the same filters.
  • next_cursor is null on the last page. Treat it as opaque text.
  • A cursor that AcornDispatch did not make gets 400 invalid_request.
  • The other lists (streams, webhooks, audiences) answer { "data": [ ... ] } in one page.

Idempotency

Send an Idempotency-Key header on POST /api/v1/email and POST /api/v1/email/batch to make a retry safe. Use a value that is unique per message in your app, for example password-reset:<token id>.

  • The value is 1 to 255 visible ASCII characters with no spaces. Anything else gets 400 invalid_request.
  • The same key with the same request returns the first answer: the same MessageID and SubmittedAt. Nothing is sent again. A first answer of recipient_inactive comes back again too.
  • The same key with a different request gets 409 idempotency_conflict. Every field counts, including the Feedback-ID header. The order of Metadata keys does not.
  • A key belongs to one workspace. It stays in use while AcornDispatch keeps the message record (13 months).
  • Without the header, every request is a new message. A retry after a timeout can then send twice.
  • In a batch the key counts per position. Send the same batch again with the same key, and each entry returns the MessageID it got the first time. Keep the same messages in the same order. A batch key never matches a single send with the same key.

From address

  • One mailbox: addr or Name <addr>. Two addresses, a group or a line break gets 422 from_invalid.
  • The domain must be the workspace sending domain or a subdomain of it, such as mail.acme.example when the sending domain is acme.example. Another domain gets 422 from_domain_not_allowed.
  • A domain that another workspace uses gets 409 sending_domain_taken.
  • From is at most 320 characters. Above it: 400 invalid_request.
  • AcornDispatch writes the From header again from the name and address it read, and quotes the name when needed.

Quote a display name

The check is strict (RFC 5322). Put a display name in double quotes when it holds one of , ; : @ ( ) < > [ ] " or \. A . may stay unquoted.

  • Smith, Jane <jane@mail.acme.example>422 from_invalid: put the name in double quotes
  • "Smith, Jane" <jane@mail.acme.example>Accepted
  • "ana@client.example via Acme" <notify@mail.acme.example>Accepted
  • Jane Q. Smith <notify@mail.acme.example>Accepted

In Python, email.utils.formataddr(("Ana, Acme Support", "notify@mail.acme.example")) quotes the name for you. In JavaScript, put the name in double quotes and escape \ and " inside it.

Body size

  • POST /api/v1/email10 MB413 payload_too_large
  • POST /api/v1/email/batch16 MB413 payload_too_large
  • POST /api/v1/assetsSee Images413 payload_too_large
  • PUT /api/v1/customers/{identifier}1 MB413 payload_too_large
  • Every other route with a JSON body4 MB413 payload_too_large
  • The size is checked from Content-Length before the body is read.
  • The attachments of one message are at most 10 MB in all, decoded. Above it: 400 invalid_request.
  • Attachments travel as base64, which adds a third to their size, and the body cap counts the whole JSON body. So one POST /api/v1/email carries about 7.5 MB of attachments at most, decoded. Send a larger one in a batch.
  • In a batch, the 16 MB is for every item together, and each message keeps its own 10 MB attachment cap.

Unsubscribe links and tracking

Each stream has a kind: transactional (mail a person needs: sign-in, receipts, notices) or broadcast (newsletters, announcements).

  • Put {{{ unsubscribe_url }}} where the link goes, in HtmlBody, TextBody or both, for example <a href="{{{ unsubscribe_url }}}">Unsubscribe</a>. AcornDispatch puts in the message's own link, on every stream kind. Spaces inside the braces are optional.
  • The link turns off the email's topic: the Topic your app named, else a topic of its template or its stream. See Topics and spam reports.
  • An email with no topic gets an unsubscribe from all broadcast mail. Transactional mail keeps sending.
  • On a broadcast stream, a part without the placeholder gets a small footer: an Unsubscribe link and, when the workspace has one set, its postal address. The HTML footer goes before </body>. HtmlBody and TextBody are checked one by one.
  • Broadcast mail also gets the one-click unsubscribe headers. A message that sets List-Unsubscribe or List-Unsubscribe-Post there gets 422 list_unsubscribe_not_allowed.
  • A transactional stream gets no footer, and AcornDispatch adds no unsubscribe headers. Your app may set its own: see Headers AcornDispatch owns.
  • Commercial email must carry the sender's postal address (CAN-SPAM in the United States, and similar laws elsewhere). Put it in the HTML your app sends for broadcast mail. AcornDispatch does not refuse a message without one.
  • A message needs the workspace link domain when it is on a broadcast stream, has the placeholder in either body, or has an HtmlBody with TrackOpens or TrackLinks on.
  • A template send needs it on a broadcast stream or on a stream that tracks.
  • Without a link domain, such a message gets 422 link_domain_missing.

Tracking

  • TrackOpens adds an open pixel to the HTML part. TrackLinks rewrites the links of the HTML part. A text-only message is never tracked.
  • With link tracking off, the HTML goes out byte for byte as you sent it, apart from the placeholder, the footer and the open pixel.
  • A template send, and every other message on the stream, is tracked as the stream's track_opens and track_links say.
  • Never track sign-in, password reset or verification mail. Link tracking stores each rewritten URL, so a secret link would be stored. Send "TrackLinks": "None" and "TrackOpens": false on that mail, so a stream default cannot turn them on.

AcornDispatch checks suppressions and unsubscribes when it accepts a message and again when it sends it. A recipient blocked at accept gets 422 recipient_inactive. A block that comes later ends the message as skipped.

A recipient who turned off a topic of the message counts as unsubscribed: error.reason and skip_reason say unsubscribed.

Topics and spam reports

A topic is a kind of email that a person can turn off. Give every email a topic, transactional and broadcast. Use one topic per kind of email, and name it when you send: "Topic": "weekly-summary".

A topic on a whole stream covers every email of that stream. Give each kind of email its own topic with Topic.

When someone marks an email as spam

  • AcornDispatch stops all email from your workspace to that person, transactional and broadcast. It shows as a spam report on the Suppressions page.
  • It also turns off every topic of the email they reported, transactional ones included.
  • A team member can remove the spam report on the Suppressions page. Email starts again, and the topics it turned off turn back on.

Who can turn a topic back on, and what happens when spam reports rise: Topics guide.

Check your integration

  1. Send one message to an address you control with POST /api/v1/email and an Idempotency-Key.
  2. Send the same request again. The MessageID must be the same.
  3. Read it with GET /api/v1/messages/{id} until status is delivered, or read why it is skipped, bounced or failed.
  4. If you use webhooks, check that your endpoint got the Delivery event and that your signature check passes. Then change one byte of the body in a test and check that it fails.
  5. On a broadcast stream, open the message and check the unsubscribe link and the postal address.

Send an email

Send one message from your app: a body you write, or a template kept in AcornDispatch.

Send an email

POST/api/v1/email

Needsemail:send

Sends one message to one recipient. 200 means AcornDispatch stored the message and queued it. Delivery comes later: read it on the message or get it by webhook.

  • Send TemplateAlias, or at least one of HtmlBody and TextBody. Both, or neither, gets 400 invalid_request.
  • TemplateModel, Identifiers and SendAt need TemplateAlias. Without it they get 400 invalid_request.
  • A template send refuses TrackOpens and TrackLinks with 422 unsupported_field: the stream decides.
  • In a template send, From and Subject are optional.

Body

  • Fromstring, requiredOne mailbox on your sending domain or a subdomain of it: addr or Name <addr>. See From address. Optional in a template send.
  • Tostring, requiredExactly one address: addr or Name <addr>, at most 320 characters. A list or a group gets 422 unsupported_field. Send one message per recipient.
  • Ccstring or array, optionalNot supported. A value gets 422 unsupported_field. null, "" and [] are ignored.
  • Bccstring or array, optionalNot supported, as Cc.
  • Subjectstring, requiredAt most 2,000 characters, one line: no control characters except tab. Optional in a template send, where it replaces the template's subject.
  • HtmlBodystring, one of requiredAt least one of HtmlBody and TextBody, unless you send TemplateAlias. Sent as you wrote it: no template language runs on it, so braces are safe.
  • TextBodystring, one of requiredSent as you wrote it.
  • ReplyTostring, optionalOne address: addr or Name <addr>. In a template send it replaces the template's reply-to.
  • Headersarray, optionalAt most 20 headers, each name once in any case. Some names are refused, and three have their own rules: see Headers AcornDispatch owns.
  • Headers.Namestring, requiredA letter or digit first, then letters, digits and hyphens. At most 64 characters.
  • Headers.Valuestring, requiredAt most 998 characters, no line breaks.
  • Tagstring, optionalAt most 1,000 characters, one line. Stored on the message, read back on it and sent in webhooks.
  • Metadataobject, optionalA flat object of string values: at most 20 keys, each key 1 to 80 characters, each value at most 1,000 characters, one line each. Stored on the message, read back on it and sent in webhooks.
  • MessageStreamstring, optionalA stream key. Not sent: the default transactional stream of the workspace. Unknown: 422 stream_not_found. Archived: 422 stream_archived. The Mailings or Automations stream: 422 stream_reserved.
  • TrackOpensboolean, optionalNot sent, or null: the stream's track_opens. Adds an open pixel to the HTML part only. A template send refuses it.
  • TrackLinksstring, optionalNot sent, or null: the stream's track_links. Links are rewritten in the HTML part only: HtmlAndText and TextOnly act as HtmlOnly, and links in TextBody are never tracked. A template send refuses it.string: None, HtmlAndText, HtmlOnly or TextOnly
  • Attachmentsarray, optionalAt most 20 files, 10 MB in all, decoded.
  • Attachments.Namestring, requiredThe file name. Unique in the message, at most 255 characters, with no / or \.
  • Attachments.Contentstring, requiredThe file as base64.
  • Attachments.ContentTypestring, requiredThe media type, for example application/pdf.
  • Attachments.ContentIDstring, optionalFor an inline image. A cid: prefix is removed.
  • DisableMessageRetentionboolean, optionaltrue: the body is not kept. It is cleared when the send ends, and the message page never shows it. The message itself (recipient, subject, status, events) is kept as usual. Use it for email that carries a secret, such as a sign-in code.
  • TemplateAliasstring, optionalThe key of a template the workspace keeps in AcornDispatch, at most 64 characters. Sends that template in place of a body: see Send with a template.
  • TemplateModelobject, optionalTemplate send only. The data the template reads.
  • Identifiersobject, optionalTemplate send only. Links the message to a person who exists in the workspace. Send id, email or both.
  • Identifiers.idstring, one of requiredYour app's id of the person, 1 to 255 characters.
  • Identifiers.emailstring, one of requiredThe person's address, 1 to 255 characters.
  • SendAtstring, optionalTemplate send only. An ISO 8601 time with a zone, within 90 days, for example 2026-11-20T09:00:00Z. A time in the past sends now.
  • Topicstring, optionalThe topic key, 1 to 64 characters. It replaces the topics of the stream and the template for this email. Give each kind of email its own topic. Unknown: 422 topic_not_found. Archived: 422 topic_archived. Nothing is stored for either.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unsupported_field422Cc or Bcc has a value, To holds more than one address, or a template send sets TrackOpens or TrackLinks.
  • from_invalid422From is not one valid mailbox. See From address.
  • from_domain_not_allowed422The From domain is not the sending domain or a subdomain of it.
  • sending_domain_taken409Another workspace uses the From domain.
  • from_required422A template send has no From, the template has no sender, and the workspace has no default sender.
  • template_not_found422TemplateAlias names no template of the workspace.
  • template_archived422TemplateAlias names a template that is archived. Nothing is stored.
  • topic_not_found422Topic names no topic of the workspace. Nothing is stored.
  • topic_archived409 or 422The topic is archived. A send that names it gets 422, and nothing is stored. A change to it gets 409.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • stream_archived422A send or a webhook's streams names an archived stream. A default stream is never archived.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • link_domain_missing422The message needs the workspace link domain, and the workspace has none. See Unsubscribe links and tracking.
  • list_unsubscribe_not_allowed422Headers sets List-Unsubscribe or List-Unsubscribe-Post on a broadcast stream. AcornDispatch sets both there.
  • recipient_inactive422The recipient cannot get this message. error.reason is suppressed, address_not_found or unsubscribed. The message is stored as skipped, so the answer also has its MessageID, To and SubmittedAt.
  • idempotency_conflict409The Idempotency-Key was used with a different request. See Idempotency.
  • payload_too_large413The body is over the route's limit. See Body size.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • internal_error500Something failed on our side. Retry with the same Idempotency-Key. In a batch, only that entry has it.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/email' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: welcome:42' \
  -d '{
    "From": "App <hello@your-domain.com>",
    "To": "person@example.com",
    "Subject": "Hello from AcornDispatch",
    "HtmlBody": "<p>It works.</p>",
    "TextBody": "It works.",
    "MessageStream": "your-stream-key",
    "Tag": "welcome",
    "Metadata": {
      "user_id": "42"
    },
    "TrackLinks": "None"
  }'
Response, HTTP 200
{
  "To": "person@example.com",
  "SubmittedAt": "2026-11-11T09:30:00.000Z",
  "MessageID": "0b6f2c1e-5d4a-4c8e-9f3b-2a1d7e6c5b4a",
  "ErrorCode": 0,
  "Message": "OK"
}

The answer

  • MessageID is a lower-case UUID. Store it: the message read, webhooks and idempotent replays all use it.
  • To is the address only, without a display name.
  • A refusal uses the error form of Errors. For recipient_inactive the message is stored as skipped, so the answer also has its MessageID, To and SubmittedAt.
  • Send an Idempotency-Key header to make a retry safe: see Idempotency.

Field rules

Field names are case-sensitive. A field that is not in the list gets 400 invalid_request ("Unknown field: X").

An empty string ("") counts as not sent for HtmlBody, TextBody, ReplyTo, Tag, MessageStream, TemplateAlias, TemplateModel, Identifiers and SendAt.

Cc and Bcc ignore "", null and []. Any other field refuses "" with 400 invalid_request: leave the field out, or send null. In a template send, From and Subject count "" as not sent too.

Send with a template

Send TemplateAlias in place of HtmlBody and TextBody to send a template the workspace keeps in AcornDispatch (Templates). The template is the content. The call names the recipient, the stream and the data.

{
  "MessageStream": "password-resets",
  "TemplateAlias": "password_reset",
  "TemplateModel": { "name": "Ana", "reset_url": "https://acme.example/reset/abc" },
  "To": "ana@example.com"
}
  • TemplateAlias is the key of the template. An unknown key gets 422 template_not_found. An archived template gets 422 template_archived, and nothing is stored.
  • TemplateModel is the data the template reads, as message_data (and trigger), for example {{ message_data.name }}. Not sent: {}.
  • MessageStream works as in a body send. Any stream can send any template. On a broadcast stream the message is broadcast mail: it gets the unsubscribe headers and, when the template has no {{ unsubscribe_url }} link, the footer (Unsubscribe links and tracking).
  • From is optional. Sent: the From address rules apply. Not sent: the template's sender, else the workspace's default sender. With neither, the call gets 422 from_required.
  • Subject and ReplyTo are optional. They replace the template's own.
  • Headers, Tag, Metadata and Attachments follow the rules of a body send. Tag and Metadata are stored, read back on the message and sent in webhooks.
  • Identifiers links the message to a person who exists in the workspace, by your app's id (id) or by address (email). AcornDispatch never creates a person from a send.
  • SendAt sends the message later, at most 90 days ahead. A time in the past sends now.
  • Tracking follows the stream's track_opens and track_links, for every message on it. A stream that tracks needs the workspace link domain (422 link_domain_missing). Keep sign-in, reset and verification email on a stream with link tracking off.
  • The answer is the answer of a body send: the same five fields and a UUID MessageID. A template archived after the call ends the message as skipped with skip_reason canceled.
  • How long AcornDispatch keeps the data you send is a setting of the template.

Headers AcornDispatch owns

Headers refuses these names with 400 invalid_request: From, To, Cc, Bcc, Reply-To, Sender, Subject, Date, Message-ID, Return-Path, MIME-Version, Received, every Content-*, DKIM-*, Resent-* and X-AD-* name, every other List-Unsubscribe* name, and a few other reserved names. Three names have their own rules.

Feedback-ID

The mail servers that send your message write this header. AcornDispatch gives them up to two fields, and the servers fill the rest:

Feedback-ID: <identifier>:<stream key>:<server id>:<server name>
  • Your app may give the first field. Send one Feedback-ID header (the name in any case) whose value is one identifier: 1 to 32 characters from A-Z, a-z, 0-9, ., _ and -, with no colon. It goes out with each . changed to -. Your value never goes out as a header of its own.
  • Any other value gets 400 invalid_request.
  • Without the header, the first field is the Tag: each character outside A-Z, a-z, 0-9, _ and - becomes -, and it is cut to 32 characters. With no Tag either, the first field is empty.
  • The second field is the stream key of the message, with the same character rule. The sending servers can write their own value there instead, so do not rely on it.
  • There is no workspace field. Mailbox providers such as Gmail report per sending domain, and each sending domain belongs to one workspace.
  • The header is part of the request for idempotency: the same Idempotency-Key with another Feedback-ID gets 409 idempotency_conflict.

For example, { "Name": "Feedback-ID", "Value": "reset.v2" } on the stream outbound goes out as Feedback-ID: reset-v2:outbound:<server id>:<server name>, or with the servers' own value in the second field.

List-Unsubscribe and List-Unsubscribe-Post

  • On a transactional stream your app may set them in Headers (the names in any case). They go out with these names and your values.
  • List-Unsubscribe: one or more <https:...> or <mailto:...> URIs, separated by commas.
  • List-Unsubscribe-Post: exactly List-Unsubscribe=One-Click, and only beside a List-Unsubscribe that has an https: URI (one-click unsubscribe, RFC 8058).
  • A value that breaks these rules gets 400 invalid_request. The message says which rule.
  • On a broadcast stream AcornDispatch sets both headers itself. A message that sets either one gets 422 list_unsubscribe_not_allowed. Leave them out and put {{{ unsubscribe_url }}} in the body for the link.
"Headers": [
  { "Name": "List-Unsubscribe", "Value": "<https://acme.example/unsubscribe/abc>, <mailto:unsubscribe@acme.example>" },
  { "Name": "List-Unsubscribe-Post", "Value": "List-Unsubscribe=One-Click" }
]

Send a batch

Send up to 500 messages in one request, each with its own result.

Send a batch

POST/api/v1/email/batch

Needsemail:send

Sends 1 to 500 messages in one call. The body is a JSON array; each message takes the fields of Send an email, and MessageStream is required. The answer is a JSON array with one result per message, in request order.

  • A body that is not an array, an empty array or more than 500 messages gets 400 invalid_request for the whole request.
  • Every message names its stream in MessageStream. A message without it gets 422 stream_required; the other messages go on.
  • Send TemplateAlias, or at least one of HtmlBody and TextBody. Both, or neither, gets 400 invalid_request.
  • TemplateModel, Identifiers and SendAt need TemplateAlias. Without it they get 400 invalid_request.
  • A template send refuses TrackOpens and TrackLinks with 422 unsupported_field: the stream decides.
  • In a template send, From and Subject are optional.

Body

A JSON array of 1 to 500 items. Each item:

  • Fromstring, requiredOne mailbox on your sending domain or a subdomain of it: addr or Name <addr>. See From address. Optional in a template send.
  • Tostring, requiredExactly one address: addr or Name <addr>, at most 320 characters. A list or a group gets 422 unsupported_field. Send one message per recipient.
  • Ccstring or array, optionalNot supported. A value gets 422 unsupported_field. null, "" and [] are ignored.
  • Bccstring or array, optionalNot supported, as Cc.
  • Subjectstring, requiredAt most 2,000 characters, one line: no control characters except tab. Optional in a template send, where it replaces the template's subject.
  • HtmlBodystring, one of requiredAt least one of HtmlBody and TextBody, unless you send TemplateAlias. Sent as you wrote it: no template language runs on it, so braces are safe.
  • TextBodystring, one of requiredSent as you wrote it.
  • ReplyTostring, optionalOne address: addr or Name <addr>. In a template send it replaces the template's reply-to.
  • Headersarray, optionalAt most 20 headers, each name once in any case. Some names are refused, and three have their own rules: see Headers AcornDispatch owns.
  • Headers.Namestring, requiredA letter or digit first, then letters, digits and hyphens. At most 64 characters.
  • Headers.Valuestring, requiredAt most 998 characters, no line breaks.
  • Tagstring, optionalAt most 1,000 characters, one line. Stored on the message, read back on it and sent in webhooks.
  • Metadataobject, optionalA flat object of string values: at most 20 keys, each key 1 to 80 characters, each value at most 1,000 characters, one line each. Stored on the message, read back on it and sent in webhooks.
  • MessageStreamstring, requiredA stream key, required on every message of a batch. Not sent: 422 stream_required for that message. Unknown: 422 stream_not_found. Archived: 422 stream_archived. The Mailings or Automations stream: 422 stream_reserved.
  • TrackOpensboolean, optionalNot sent, or null: the stream's track_opens. Adds an open pixel to the HTML part only. A template send refuses it.
  • TrackLinksstring, optionalNot sent, or null: the stream's track_links. Links are rewritten in the HTML part only: HtmlAndText and TextOnly act as HtmlOnly, and links in TextBody are never tracked. A template send refuses it.string: None, HtmlAndText, HtmlOnly or TextOnly
  • Attachmentsarray, optionalAt most 20 files, 10 MB in all, decoded.
  • Attachments.Namestring, requiredThe file name. Unique in the message, at most 255 characters, with no / or \.
  • Attachments.Contentstring, requiredThe file as base64.
  • Attachments.ContentTypestring, requiredThe media type, for example application/pdf.
  • Attachments.ContentIDstring, optionalFor an inline image. A cid: prefix is removed.
  • DisableMessageRetentionboolean, optionaltrue: the body is not kept. It is cleared when the send ends, and the message page never shows it. The message itself (recipient, subject, status, events) is kept as usual. Use it for email that carries a secret, such as a sign-in code.
  • TemplateAliasstring, optionalThe key of a template the workspace keeps in AcornDispatch, at most 64 characters. Sends that template in place of a body: see Send with a template.
  • TemplateModelobject, optionalTemplate send only. The data the template reads.
  • Identifiersobject, optionalTemplate send only. Links the message to a person who exists in the workspace. Send id, email or both.
  • Identifiers.idstring, one of requiredYour app's id of the person, 1 to 255 characters.
  • Identifiers.emailstring, one of requiredThe person's address, 1 to 255 characters.
  • SendAtstring, optionalTemplate send only. An ISO 8601 time with a zone, within 90 days, for example 2026-11-20T09:00:00Z. A time in the past sends now.
  • Topicstring, optionalThe topic key, 1 to 64 characters. It replaces the topics of the stream and the template for this email. Give each kind of email its own topic. Unknown: 422 topic_not_found. Archived: 422 topic_archived. Nothing is stored for either.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unsupported_field422Cc or Bcc has a value, To holds more than one address, or a template send sets TrackOpens or TrackLinks.
  • from_invalid422From is not one valid mailbox. See From address.
  • from_domain_not_allowed422The From domain is not the sending domain or a subdomain of it.
  • sending_domain_taken409Another workspace uses the From domain.
  • from_required422A template send has no From, the template has no sender, and the workspace has no default sender.
  • template_not_found422TemplateAlias names no template of the workspace.
  • template_archived422TemplateAlias names a template that is archived. Nothing is stored.
  • topic_not_found422Topic names no topic of the workspace. Nothing is stored.
  • topic_archived409 or 422The topic is archived. A send that names it gets 422, and nothing is stored. A change to it gets 409.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • stream_archived422A send or a webhook's streams names an archived stream. A default stream is never archived.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • link_domain_missing422The message needs the workspace link domain, and the workspace has none. See Unsubscribe links and tracking.
  • list_unsubscribe_not_allowed422Headers sets List-Unsubscribe or List-Unsubscribe-Post on a broadcast stream. AcornDispatch sets both there.
  • recipient_inactive422The recipient cannot get this message. error.reason is suppressed, address_not_found or unsubscribed. The message is stored as skipped, so the answer also has its MessageID, To and SubmittedAt.
  • idempotency_conflict409The Idempotency-Key was used with a different request. See Idempotency.
  • payload_too_large413The body is over the route's limit. See Body size.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • internal_error500Something failed on our side. Retry with the same Idempotency-Key. In a batch, only that entry has it.
  • stream_required422A message of a batch has no MessageStream. A batch names the stream of every message; a single send without it uses the default transactional stream.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/email/batch' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: batch:42' \
  -d '[
    {
      "From": "App <hello@your-domain.com>",
      "To": "person@example.com",
      "Subject": "Batch message 1",
      "HtmlBody": "<p>Message 1 of the batch.</p>",
      "TextBody": "Message 1 of the batch.",
      "MessageStream": "your-stream-key",
      "TrackLinks": "None"
    },
    {
      "From": "App <hello@your-domain.com>",
      "To": "person@example.com",
      "Subject": "Batch message 2",
      "HtmlBody": "<p>Message 2 of the batch.</p>",
      "TextBody": "Message 2 of the batch.",
      "MessageStream": "your-stream-key",
      "TrackLinks": "None"
    }
  ]'
Response, HTTP 200
[
  {
    "To": "person@example.com",
    "SubmittedAt": "2026-11-11T09:30:00.000Z",
    "MessageID": "0b6f2c1e-5d4a-4c8e-9f3b-2a1d7e6c5b4a",
    "ErrorCode": 0,
    "Message": "OK"
  },
  {
    "To": "person@example.com",
    "SubmittedAt": "2026-11-11T09:30:00.000Z",
    "MessageID": "7c1e9a2b-3f4d-4e5a-8b6c-9d0e1f2a3b4c",
    "ErrorCode": 0,
    "Message": "OK"
  }
]

Read every result

Each message is accepted on its own, so one bad message never stops the others. HTTP 200 does not mean every message was accepted.

[
  { "To": "ana@example.com", "SubmittedAt": "2026-11-11T09:30:00.000Z", "MessageID": "0b6f2c1e-5d4a-4c8e-9f3b-2a1d7e6c5b4a", "ErrorCode": 0, "Message": "OK" },
  { "ErrorCode": 422, "Message": "To takes exactly one address. Send one message per recipient.", "error": { "code": "unsupported_field", "message": "To takes exactly one address. Send one message per recipient." } }
]
  • An accepted message has ErrorCode 0.
  • A refused message has ErrorCode set to the HTTP status the single send would answer, a Message, and the error object of Errors. For recipient_inactive it also has MessageID, To and SubmittedAt.
  • An unexpected failure of one message gives that entry ErrorCode 500 and internal_error.
  • With an Idempotency-Key, the key counts per position: see Idempotency.

Messages

Read one message and its events, or list the messages of the workspace.

List messages

GET/api/v1/messages

Needsemail:send

Lists the messages of the workspace, newest first by submitted_at. It lists every message, not only those your app sent. Each item is the message object without events.

Query

  • statusstring, optionalOne or more values, separated by commas: status=bounced,complained.string: queued, sending, sent, delivered, bounced, complained, skipped, failed or unknown
  • streamstring, optionalA stream key. Unknown: 422 stream_not_found.
  • tagstring, optionalAn exact Tag. Only messages your app sent have one: api messages and template sends.
  • sincestring, optionalAn ISO 8601 date-time with Z or an offset, such as 2026-11-01T00:00:00Z. Filters on submitted_at, included. Must be before until.
  • untilstring, optionalAn ISO 8601 date-time with Z or an offset, such as 2026-11-01T00:00:00Z. Filters on submitted_at, not included.
  • limitinteger, optional1 to 100. Default 20.
  • cursorstring, optionalThe next_cursor of the previous page. Send the same filters with it. See Pagination.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -G 'https://api.acorndispatch.com/api/v1/messages' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  --data-urlencode 'status=delivered,bounced' \
  --data-urlencode 'limit=20'
Response, HTTP 200
{
  "data": [
    {
      "message_id": "0b6f2c1e-5d4a-4c8e-9f3b-2a1d7e6c5b4a",
      "source": "api",
      "stream": "outbound",
      "to": "ana@example.com",
      "from": "Acme <notify@mail.acme.example>",
      "subject": "Reset your password",
      "tag": "password-reset",
      "metadata": {
        "user_id": "42"
      },
      "status": "delivered",
      "skip_reason": null,
      "failure": null,
      "submitted_at": "2026-11-11T09:30:00.000Z",
      "sent_at": "2026-11-11T09:30:01.000Z",
      "delivered_at": "2026-11-11T09:30:03.000Z",
      "first_open_at": null,
      "first_click_at": null,
      "bounced_at": null,
      "complained_at": null,
      "bounce": null
    },
    {
      "message_id": "7c1e9a2b-3f4d-4e5a-8b6c-9d0e1f2a3b4c",
      "source": "api",
      "stream": "outbound",
      "to": "ben@example.com",
      "from": "Acme <notify@mail.acme.example>",
      "subject": "Your receipt",
      "tag": "receipt",
      "metadata": {
        "order_id": "1001"
      },
      "status": "bounced",
      "skip_reason": null,
      "failure": null,
      "submitted_at": "2026-11-10T14:00:00.000Z",
      "sent_at": "2026-11-10T14:00:01.000Z",
      "delivered_at": null,
      "first_open_at": null,
      "first_click_at": null,
      "bounced_at": "2026-11-10T14:00:04.000Z",
      "complained_at": null,
      "bounce": {
        "type": "hard",
        "smtp_code": "550 5.1.1"
      }
    }
  ],
  "next_cursor": null
}

Read a message

GET/api/v1/messages/{id}

Needsemail:send

Reads one message of the workspace with its events. Read it after a send until status is delivered, or to learn why it is skipped, bounced or failed.

Path

  • idstring, requiredThe MessageID of a send (any case), or the message_id of any message of the workspace. An id of another workspace gets 404 not_found.

Errors

  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/messages/your-message-id' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "message_id": "0b6f2c1e-5d4a-4c8e-9f3b-2a1d7e6c5b4a",
  "source": "api",
  "stream": "outbound",
  "to": "ana@example.com",
  "from": "Acme <notify@mail.acme.example>",
  "subject": "Reset your password",
  "tag": "password-reset",
  "metadata": {
    "user_id": "42"
  },
  "status": "delivered",
  "skip_reason": null,
  "failure": null,
  "submitted_at": "2026-11-11T09:30:00.000Z",
  "sent_at": "2026-11-11T09:30:01.000Z",
  "delivered_at": "2026-11-11T09:30:03.000Z",
  "first_open_at": null,
  "first_click_at": null,
  "bounced_at": null,
  "complained_at": null,
  "bounce": null,
  "events": [
    {
      "type": "send",
      "subtype": null,
      "machine": false,
      "occurred_at": "2026-11-11T09:30:01.000Z"
    },
    {
      "type": "delivery",
      "subtype": null,
      "machine": false,
      "occurred_at": "2026-11-11T09:30:03.000Z"
    }
  ]
}

The message object

  • message_idThe MessageID of a message your app sent, else the AcornDispatch id of the message.
  • sourceapi, template, mailing, automation or test. api is a message your app sent with a body; a template send through this API is template.
  • streamThe stream key. The Mailings and Automations streams show here too. A message with no stream shows the default stream of its kind.
  • toThe recipient address.
  • from, subjectSet for api messages only, else null.
  • tag, metadataSet for the messages your app sends: api messages and template sends through this API. Else null.
  • statusqueued, sending, sent, delivered, bounced, complained, skipped, failed or unknown.
  • skip_reasonWith status skipped: suppressed, address_not_found or unsubscribed (the recipient is blocked), or stream_paused (the stream stayed paused for 7 days). Other messages of the workspace can show other reasons, such as canceled. Else null.
  • failureWith status failed: { "code", "message" }. See Failures. Else null.
  • submitted_at, sent_at, delivered_at, first_open_at, first_click_at, bounced_at, complained_atISO 8601 times, or null until it happens.
  • bounceThe latest bounce of the message, else null. { "type", "smtp_code" }: type is hard, soft, policy or undetermined; smtp_code holds the codes of the receiving server only (for example 550 5.1.1), or null.
  • eventsRead a message only. Oldest first, each { "type", "subtype", "machine", "occurred_at" }. type is send, delivery, bounce, complaint, reject, delay, open, click or unsubscribe. machine is true for an open or click that AcornDispatch judged to be made by a machine (for example a mail scanner), not a person.

There is no bounces endpoint. To list bounced messages, use GET /api/v1/messages with status=bounced. To see what blocks an address, check its suppressions.

Failures

A message that was accepted can still fail before it goes out. It then has status failed and a failure.code:

  • render_failedThe message could not be built.
  • send_failedThe message could not be sent.
  • attachments_lostThe attachments were lost before sending.
  • from_domain_not_allowedThe From domain was no longer allowed at send time.
  • sending_domain_takenThe From domain moved to another workspace before the send.
  • link_domain_missingThe workspace link domain was gone at send time.

Stats

Sent, delivered, bounced, complained, opened and clicked counts for a time window, per sending group and per stream, with the reputation rates of each group.

Read sending stats

GET/api/v1/stats

Needsemail:send

Counts the messages of the workspace that were sent in a time window, per sending group and per stream, with the reputation rates of each group.

Query

  • sincestring, optionalAn ISO 8601 date-time with Z or an offset, such as 2026-11-01T00:00:00Z. Filters on sent_at, included. Not sent: 30 days before until. Must be before until.
  • untilstring, optionalAn ISO 8601 date-time with Z or an offset, such as 2026-11-01T00:00:00Z. Filters on sent_at, not included. Not sent: now.
  • streamstring, optionalA stream key: count that stream only, in its group. Unknown: 422 stream_not_found.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -G 'https://api.acorndispatch.com/api/v1/stats' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  --data-urlencode 'since=2026-11-01T00:00:00Z' \
  --data-urlencode 'until=2026-11-08T00:00:00Z'
Response, HTTP 200
{
  "since": "2026-11-01T00:00:00.000Z",
  "until": "2026-11-08T00:00:00.000Z",
  "marketing": {
    "sent": 50250,
    "delivered": 50150,
    "bounced": 120,
    "complained": 4,
    "opened": 9800,
    "clicked": 760,
    "reputation": {
      "bounce_rate": 0.0016,
      "complaint_rate": 0.0009,
      "as_of": "2026-11-08T05:00:00.000Z"
    }
  },
  "transactional": {
    "sent": 3900,
    "delivered": 3890,
    "bounced": 12,
    "complained": 0,
    "opened": 1200,
    "clicked": 300,
    "reputation": {
      "bounce_rate": 0.0038,
      "complaint_rate": 0,
      "as_of": "2026-11-08T05:00:00.000Z"
    }
  },
  "streams": [
    {
      "stream": "newsletter",
      "sent": 250,
      "delivered": 248,
      "bounced": 5,
      "complained": 1,
      "opened": 150,
      "clicked": 40,
      "bounce_rate": 0.02
    },
    {
      "stream": "outbound",
      "sent": 3900,
      "delivered": 3890,
      "bounced": 12,
      "complained": 0,
      "opened": 1200,
      "clicked": 300,
      "bounce_rate": 0.0031
    },
    {
      "stream": "promotions",
      "sent": 50000,
      "delivered": 49902,
      "bounced": 115,
      "complained": 3,
      "opened": 9650,
      "clicked": 720,
      "bounce_rate": 0.0023
    }
  ]
}

What the counts mean

  • Every count is a number of messages. sent counts the messages sent in the window. delivered and complained count those of them that were delivered or got a spam report.
  • bounced counts the emails that could not be delivered for good: the address does not exist, or the receiving server refused the email for good. Emails with only a temporary problem are not in it.
  • delivered and bounced can overlap: a mail provider can accept an email and bounce it later. Do not add them up to sent.
  • opened and clicked count messages with at least one open or click by a person. Opens and clicks made by a machine are left out.
  • The answer has one object per sending group: marketing (mailings, automations and broadcast streams) and transactional (transactional streams). Each holds the counts of its group and its reputation.
  • reputation holds the rates mail providers use to judge your sending, per group, over a representative volume of recent email: bounce_rate and complaint_rate, fractions from 0 to 1. as_of is the time of the figure. A quiet group keeps its last figure, with an old as_of. All three are null when there is no figure yet, or when the figure is not available. reputation uses the window of the mail providers, not since and until.
  • On a stream row, bounce_rate is bounced divided by sent, a fraction from 0 to 1, null when sent is 0. A stream row has no reputation, and a group object has no rate of its own. complained is a count: the only spam report rate is the one in reputation.
  • streams lists each stream with sends in the window, ordered by key. With stream, it lists that stream, also when it has no sends. A message with no stream counts under the default stream of its kind.
  • With stream, the answer holds only the group of that stream, with counts for that stream. Its reputation stays for the whole group, because mail providers give no rate per stream. Without stream, the answer holds both groups, also with no sends.
  • Test sends and messages that were never sent (queued, skipped or failed) are not counted.
  • List messages with status=bounced also lists emails with a temporary problem, so it can list more than bounced counts.

The answer for stream=newsletter:

{
  "since": "2026-11-01T00:00:00.000Z",
  "until": "2026-11-08T00:00:00.000Z",
  "marketing": {
    "sent": 250,
    "delivered": 248,
    "bounced": 5,
    "complained": 1,
    "opened": 150,
    "clicked": 40,
    "reputation": {
      "bounce_rate": 0.0016,
      "complaint_rate": 0.0009,
      "as_of": "2026-11-08T05:00:00.000Z"
    }
  },
  "streams": [
    {
      "stream": "newsletter",
      "sent": 250,
      "delivered": 248,
      "bounced": 5,
      "complained": 1,
      "opened": 150,
      "clicked": 40,
      "bounce_rate": 0.02
    }
  ]
}

Streams

A stream groups the mail of one purpose, transactional or broadcast. Name it in MessageStream when you send.

List streams

GET/api/v1/streams

Needsstreams:writeoremail:send

Lists the active streams of the workspace. The Mailings and Automations streams are not listed.

Query

  • archivedboolean, optionaltrue: the archived streams only. Not sent or false: the active ones. Any other value gets 400 invalid_request.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/streams' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "data": [
    {
      "key": "default_transactional",
      "name": "Default transactional",
      "description": null,
      "kind": "transactional",
      "is_default": true,
      "track_opens": false,
      "track_links": false,
      "auto_pause": false,
      "paused": null,
      "archived_at": null,
      "created_at": "2026-10-01T08:00:00.000Z",
      "updated_at": "2026-10-01T08:00:00.000Z"
    },
    {
      "key": "receipts",
      "name": "Receipts",
      "description": "Order receipts",
      "kind": "transactional",
      "is_default": false,
      "track_opens": false,
      "track_links": false,
      "auto_pause": false,
      "paused": null,
      "archived_at": null,
      "created_at": "2026-11-11T09:00:00.000Z",
      "updated_at": "2026-11-11T09:00:00.000Z"
    }
  ]
}

Create a stream

POST/api/v1/streams

Needsstreams:write

Creates a stream and answers 201 with the stream object.

  • is_default is read only: a body with it gets 400 invalid_request, as does any other field not listed. visible, default_subscribed and position are gone: what a recipient can choose is now set on topics.
  • Flags not sent take the defaults of the kind. A broadcast stream: track_opens on, track_links on, auto_pause on. A transactional stream: track_opens off, track_links off, auto_pause off.

Body

  • keystring, requiredThe value for MessageStream. 1 to 40 lower-case letters, digits, hyphens or underscores. Fixed after create.
  • namestring, requiredThe name recipients see on the unsubscribe and preference pages.
  • kindstring, requiredFixed after create.string: transactional or broadcast
  • descriptionstring or null, optionalAt most 500 characters. null clears it.
  • track_opensboolean, optionalThe default for TrackOpens and the tracking of template sends.
  • track_linksboolean, optionalThe default for TrackLinks and the tracking of template sends.
  • auto_pauseboolean, optionalBroadcast streams only (422 stream_auto_pause_transactional on a transactional stream). Stored; automatic pausing is not active yet.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • stream_key_invalid422The stream key breaks the key rule. See the stream object.
  • stream_key_taken409Another stream of the workspace has this key. Archived streams count.
  • stream_auto_pause_transactional422Only a broadcast stream can have auto_pause.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/streams' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "key": "receipts",
    "name": "Receipts",
    "kind": "transactional",
    "description": "Order receipts"
  }'
Response, HTTP 201
{
  "key": "receipts",
  "name": "Receipts",
  "description": "Order receipts",
  "kind": "transactional",
  "is_default": false,
  "track_opens": false,
  "track_links": false,
  "auto_pause": false,
  "paused": null,
  "archived_at": null,
  "created_at": "2026-11-11T09:00:00.000Z",
  "updated_at": "2026-11-11T09:00:00.000Z"
}

Change a stream

PATCH/api/v1/streams/{key}

Needsstreams:write

Changes the fields you send and answers the stream object.

  • is_default is read only: a body with it gets 400 invalid_request, as does any other field not listed. visible, default_subscribed and position are gone: what a recipient can choose is now set on topics.
  • The key and the kind never change. A different key gets 422 stream_key_immutable, a different kind 422 stream_kind_immutable. The same value sent back is no change.

Path

  • keystring, requiredThe stream key. Unknown: 404 not_found. The Mailings or Automations stream: 422 stream_reserved.

Body

  • keystring, optionalAccepted only with the current key. Another key gets 422 stream_key_immutable.
  • namestring, optionalThe name recipients see on the unsubscribe and preference pages.
  • kindstring, optionalAccepted only with the current kind. Another kind gets 422 stream_kind_immutable.string: transactional or broadcast
  • descriptionstring or null, optionalAt most 500 characters. null clears it.
  • track_opensboolean, optionalThe default for TrackOpens and the tracking of template sends.
  • track_linksboolean, optionalThe default for TrackLinks and the tracking of template sends.
  • auto_pauseboolean, optionalBroadcast streams only (422 stream_auto_pause_transactional on a transactional stream). Stored; automatic pausing is not active yet.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • stream_key_immutable422The key of a stream never changes after the stream is created.
  • stream_kind_immutable422A stream cannot change its kind.
  • stream_auto_pause_transactional422Only a broadcast stream can have auto_pause.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X PATCH 'https://api.acorndispatch.com/api/v1/streams/your-stream-key' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Order receipts"
  }'
Response, HTTP 200
{
  "key": "receipts",
  "name": "Order receipts",
  "description": "Order receipts",
  "kind": "transactional",
  "is_default": false,
  "track_opens": false,
  "track_links": false,
  "auto_pause": false,
  "paused": null,
  "archived_at": null,
  "created_at": "2026-11-11T09:00:00.000Z",
  "updated_at": "2026-11-12T10:00:00.000Z"
}

Pause a stream

POST/api/v1/streams/{key}/pause

Needsstreams:write

Pauses the stream and answers the stream object. No body. Calling it twice is safe.

Path

  • keystring, requiredThe stream key. Unknown: 404 not_found. The Mailings or Automations stream: 422 stream_reserved.

Errors

  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/streams/your-stream-key/pause' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "key": "receipts",
  "name": "Receipts",
  "description": "Order receipts",
  "kind": "transactional",
  "is_default": false,
  "track_opens": false,
  "track_links": false,
  "auto_pause": false,
  "paused": {
    "at": "2026-11-12T10:00:00.000Z",
    "reason": "manual"
  },
  "archived_at": null,
  "created_at": "2026-11-11T09:00:00.000Z",
  "updated_at": "2026-11-12T10:00:00.000Z"
}

Resume a stream

POST/api/v1/streams/{key}/resume

Needsstreams:write

Resumes the stream and answers the stream object. No body. Calling it twice is safe.

Path

  • keystring, requiredThe stream key. Unknown: 404 not_found. The Mailings or Automations stream: 422 stream_reserved.

Errors

  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • stream_reserved422A send, a PATCH, a pause or a resume names the Mailings or the Automations stream. Those two streams carry the workspace's mailings and automations. See Streams.
  • stream_under_review409A resume names a stream that AcornDispatch paused while it reviews delivery. Only AcornDispatch resumes it.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/streams/your-stream-key/resume' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "key": "receipts",
  "name": "Receipts",
  "description": "Order receipts",
  "kind": "transactional",
  "is_default": false,
  "track_opens": false,
  "track_links": false,
  "auto_pause": false,
  "paused": null,
  "archived_at": null,
  "created_at": "2026-11-11T09:00:00.000Z",
  "updated_at": "2026-11-12T10:30:00.000Z"
}

The stream object

  • keyThe value for MessageStream. 1 to 40 lower-case letters, digits, hyphens or underscores. Fixed after create.
  • nameThe name recipients see on the unsubscribe and preference pages.
  • descriptionOptional text, at most 500 characters.
  • kindtransactional or broadcast. Fixed after create.
  • is_defaultThe default stream of its kind: a send with no MessageStream goes to the default transactional stream. Fixed: one per kind, set when the workspace is created. It never moves and is never archived. Read only.
  • track_opens, track_linksDefaults for TrackOpens and TrackLinks.
  • auto_pauseStored; automatic pausing is not active yet.
  • paused{ "at", "reason" } while the stream is paused, else null. reason is manual for a pause by a person or a key, or provider_review while AcornDispatch reviews delivery. Only AcornDispatch resumes that one (409 stream_under_review).
  • archived_at, created_at, updated_atISO 8601 times. archived_at is null for an active stream.

Pausing

A paused stream still accepts messages and holds them. They go out within about 15 minutes of the resume. A message held for 7 days ends as skipped (stream_paused).

The Mailings and Automations streams

  • A workspace can have two more broadcast streams that hold the mail of its mailings and of its automations. Their keys are mailings and automations, or the next free key when one was taken, such as mailings-2.
  • GET /api/v1/streams does not list them. A send, a PATCH, a pause or a resume that names one gets 422 stream_reserved.
  • They show in the data you read: the stream of a message, the MessageStream of a webhook event, a row of stats and the stream of a suppression entry carry their key, and ?stream= filters by it. A webhook's streams may name them.

Topics

A topic is a kind of email a person can turn off, such as product tips. Name it in Topic when you send.

List topics

GET/api/v1/topics

Needstopics:writeoremail:send

Lists the active topics of the workspace, in the order of the preferences page.

Query

  • archivedboolean, optionaltrue: the archived topics only. Not sent or false: the active ones. Any other value gets 400 invalid_request.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/topics' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "data": [
    {
      "key": "weekly-summary",
      "name": "Weekly summary",
      "description": null,
      "visible": false,
      "default_subscribed": true,
      "archived_at": null,
      "created_at": "2026-11-20T08:00:00.000Z",
      "updated_at": "2026-11-20T08:00:00.000Z"
    },
    {
      "key": "product-tips",
      "name": "Product tips",
      "description": "Tips for getting more out of the product.",
      "visible": true,
      "default_subscribed": true,
      "archived_at": null,
      "created_at": "2026-11-21T09:30:00.000Z",
      "updated_at": "2026-11-21T09:30:00.000Z"
    }
  ]
}

Create a topic

POST/api/v1/topics

Needstopics:write

Creates a topic and answers 201 with the topic object.

  • A field not listed gets 400 invalid_request. What a topic covers (its streams, mailings, automations and templates) is set on the Topics page only.
  • Without key, the key is made from the name, with a number when it is taken (product-tips-2). The answer carries it.

Body

  • keystring, optionalThe value for Topic on a send. 1 to 64 lower-case letters, digits, hyphens or underscores. Made from name when not sent. Fixed after create.
  • namestring, required1 to 60 characters. Recipients see it on the preferences page when the topic is visible.
  • descriptionstring or null, optionalAt most 140 characters. null clears it.
  • visibleboolean, optionalShown on the preferences page. Default true.
  • default_subscribedboolean, optionalfalse makes an opt-in topic: email goes only to people who turned it on. Default true. Fixed once the topic covers email or a person has made a choice (409 topic_default_fixed).

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • topic_key_invalid422The topic key breaks the key rule. See the topic object.
  • topic_key_taken409Another topic of the workspace has this key. Archived topics count.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/topics' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "key": "product-tips",
    "name": "Product tips",
    "description": "Tips for getting more out of the product."
  }'
Response, HTTP 201
{
  "key": "product-tips",
  "name": "Product tips",
  "description": "Tips for getting more out of the product.",
  "visible": true,
  "default_subscribed": true,
  "archived_at": null,
  "created_at": "2026-11-21T09:30:00.000Z",
  "updated_at": "2026-11-21T09:30:00.000Z"
}

Get a topic

GET/api/v1/topics/{key}

Needstopics:writeoremail:send

Answers the topic object, archived or not.

Path

  • keystring, requiredThe topic key. Unknown: 404 not_found.

Errors

  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/topics/your-topic-key' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "key": "product-tips",
  "name": "Product tips",
  "description": "Tips for getting more out of the product.",
  "visible": true,
  "default_subscribed": true,
  "archived_at": null,
  "created_at": "2026-11-21T09:30:00.000Z",
  "updated_at": "2026-11-21T09:30:00.000Z"
}

Change a topic

PATCH/api/v1/topics/{key}

Needstopics:write

Changes the fields you send and answers the topic object.

  • A field not listed gets 400 invalid_request. What a topic covers (its streams, mailings, automations and templates) is set on the Topics page only.
  • The key never changes: your app sends it. The same key sent back is no change. An archived topic does not change (409 topic_archived).

Path

  • keystring, requiredThe topic key. Unknown: 404 not_found.

Body

  • keystring, optionalAccepted only with the current key. Another key gets 409 topic_key_fixed.
  • namestring, optional1 to 60 characters. Recipients see it on the preferences page when the topic is visible.
  • descriptionstring or null, optionalAt most 140 characters. null clears it.
  • visibleboolean, optionalShown on the preferences page.
  • default_subscribedboolean, optionalfalse makes an opt-in topic: email goes only to people who turned it on. Fixed once the topic covers email or a person has made a choice (409 topic_default_fixed).

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • topic_key_fixed409The key of a topic never changes after the topic is created.
  • topic_default_fixed409default_subscribed cannot change once the topic covers email or a person has made a choice.
  • topic_archived409 or 422The topic is archived. A send that names it gets 422, and nothing is stored. A change to it gets 409.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X PATCH 'https://api.acorndispatch.com/api/v1/topics/your-topic-key' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Tips and tricks"
  }'
Response, HTTP 200
{
  "key": "product-tips",
  "name": "Tips and tricks",
  "description": "Tips for getting more out of the product.",
  "visible": true,
  "default_subscribed": true,
  "archived_at": null,
  "created_at": "2026-11-21T09:30:00.000Z",
  "updated_at": "2026-11-22T10:00:00.000Z"
}

Archive a topic

DELETE/api/v1/topics/{key}

Needstopics:write

Archives the topic and answers the topic object. No body. Calling it twice is safe.

  • An archived topic leaves the preferences page and cannot be turned back on. The people who turned it off stay off, and a send with it as Topic is refused. Its key stays taken. There is no unarchive.

Path

  • keystring, requiredThe topic key. Unknown: 404 not_found.

Errors

  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X DELETE 'https://api.acorndispatch.com/api/v1/topics/your-topic-key' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "key": "product-tips",
  "name": "Product tips",
  "description": "Tips for getting more out of the product.",
  "visible": true,
  "default_subscribed": true,
  "archived_at": "2026-11-22T11:00:00.000Z",
  "created_at": "2026-11-21T09:30:00.000Z",
  "updated_at": "2026-11-22T11:00:00.000Z"
}

The topic object

  • keyThe value for Topic on a send. 1 to 64 lower-case letters, digits, hyphens or underscores. Fixed after create.
  • nameThe name recipients see on the preferences page.
  • descriptionOptional text under the name on the preferences page.
  • visibletrue: recipients can turn it on or off on the preferences page. false: hidden, for email a recipient should not choose, such as account email.
  • default_subscribedtrue: on until a person turns it off. false: off until a person turns it on.
  • archived_at, created_at, updated_atISO 8601 times. archived_at is null for an active topic.

Suppressions

Check what blocks an address from getting your mail, add a block, and lift what may be lifted.

Check an address

GET/api/v1/suppressions

Needssuppressions:writeoremail:send

Tells you what blocks an address. A sending key may call it, so your app can check before it sends.

Query

  • emailstring, requiredThe address. Percent-encode it (encodeURIComponent): a + must be sent as %2B, or it reads as a space and the address is refused (400 invalid_request).
  • streamstring, optionalA stream key: what blocks that stream only. Not sent: every stream. Unknown: 422 stream_not_found.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -G 'https://api.acorndispatch.com/api/v1/suppressions' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  --data-urlencode 'email=person@example.com'
Response, HTTP 200
{
  "email": "person@example.com",
  "stream": null,
  "active": true,
  "suppressions": [
    {
      "reason": "hard_bounce",
      "scope": "all",
      "stream": null,
      "created_at": "2026-10-02T08:00:00.000Z",
      "liftable": true
    }
  ]
}

Add a suppression

POST/api/v1/suppressions

Needssuppressions:write

Stops email to an address. The new entry has the reason api. The answer lists what blocks the address now.

  • The body is strict: any other field gets 400 invalid_request.
  • created is false when a suppression already blocks what you asked for. An all entry also covers a marketing add.
  • A lift with Lift suppressions removes it again.

Body

  • emailstring, requiredThe address. Not a valid address: 400 invalid_request.
  • scopestring, optionalall blocks every email. marketing blocks broadcast streams only. Not sent: all.string: all or marketing

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/suppressions' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "person@example.com",
    "scope": "all"
  }'
Response, HTTP 200
{
  "email": "person@example.com",
  "scope": "all",
  "created": true,
  "suppressions": [
    {
      "reason": "api",
      "scope": "all",
      "stream": null,
      "created_at": "2026-11-17T09:30:00.000Z",
      "liftable": true
    }
  ]
}

Lift suppressions

DELETE/api/v1/suppressions

Needssuppressions:write

Lifts what may be lifted for an address and answers what was lifted and what remains.

  • The body is strict: any other field gets 400 invalid_request.

Body

  • emailstring, requiredThe address. Not a valid address: 400 invalid_request.
  • streamstring or null, optionalA stream key: what blocks that stream only. Not sent: every stream. Unknown: 422 stream_not_found.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X DELETE 'https://api.acorndispatch.com/api/v1/suppressions' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "person@example.com"
  }'
Response, HTTP 200
{
  "email": "person@example.com",
  "stream": null,
  "lifted": [
    {
      "reason": "hard_bounce",
      "scope": "all",
      "stream": null,
      "created_at": "2026-10-02T08:00:00.000Z",
      "liftable": true
    }
  ],
  "remaining": []
}

Suppression entries

A check and a lift answer email (the address as AcornDispatch stores it) and stream (the key you sent, or null). An add answers email, scope, created and suppressions. A check adds active (true when anything blocks the address) and suppressions; a lift adds lifted and remaining. Each is a list of entries:

  • reasonhard_bounce, soft_bounce_repeat, repeated_block, complaint, manual, api, imported_bounce, imported_complaint, address_not_found or unsubscribed. address_not_found means the address does not exist.
  • scopeall, marketing (broadcast streams), stream (one stream) or global.
  • streamThe stream key of a stream entry, else null.
  • created_atAn ISO 8601 time. null for a global entry and a stream opt-out.
  • liftableWhether a lift can remove it.
  • A spam complaint, an unsubscribe and a stream opt-out are never lifted. Only the recipient can undo them, so they stay in remaining.
  • A lift sends a SubscriptionChange webhook (Origin Customer, MessageID null) for each stream the address can now receive again. Lifting the address_not_found entry sends none.

People

Add, update and delete the people your mailings and automations go to.

Add or update a person

PUT/api/v1/customers/{identifier}

Needspeople:write

Adds the person, or updates the one this identifier names. Every key of the body other than email and unsubscribed is stored as an attribute.

  • The body is a JSON object of at most 1 MB.
  • Any other key is an attribute. A null value deletes that attribute.
  • The answer is {} once the call is stored. AcornDispatch applies it within seconds, in the order the calls for one person arrive.

Path

  • identifierstring, requiredThe person's email address, or your app's own id for them. 1 to 255 characters. Percent-encode it (encodeURIComponent). It cannot start with cio_. See Identifiers.

Body

  • emailstring or null, optionalSets the person's address. null clears it.
  • unsubscribedboolean, optionaltrue unsubscribes the person from marketing email. false is ignored: the API never subscribes a person again.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X PUT 'https://api.acorndispatch.com/api/v1/customers/person@example.com' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "person@example.com",
    "first_name": "Sam",
    "plan": "pro"
  }'
Response, HTTP 200
{}

Delete a person

DELETE/api/v1/customers/{identifier}

Needspeople:write

Deletes the person and their attributes and events. An identifier with no person changes nothing.

  • The answer is {} whether or not the person exists. AcornDispatch applies it within seconds.

Path

  • identifierstring, requiredThe person's email address, or your app's own id for them. 1 to 255 characters. Percent-encode it (encodeURIComponent). It cannot start with cio_. See Identifiers.

Errors

  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • unauthorized401The API key is missing or wrong.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.

Example

Any shell with curl.
curl -sS -X DELETE 'https://api.acorndispatch.com/api/v1/customers/person@example.com' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{}

Identifiers

  • An identifier with @ is an email address. It finds the person with that address, whatever its case.
  • Any other identifier is your app's own id for the person.
  • Events about a person come from your site or app through the Activity API, with a track key. It has its own reference.

Webhooks

AcornDispatch posts events about your messages to your HTTPS endpoint. Create, list, turn off and delete those endpoints here. Every route needs the webhooks:write scope.

List webhooks

GET/api/v1/webhooks

Needswebhooks:write

The workspace's webhooks, newest first.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/webhooks' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "data": [
    {
      "id": "whk_3Jd8sLq2Vn7Ry0Pe",
      "url": "https://your-domain.com/hooks/acorndispatch",
      "events": [
        "Delivery",
        "Bounce",
        "SpamComplaint",
        "Open",
        "Click",
        "SubscriptionChange"
      ],
      "streams": null,
      "http_auth": {
        "username": "hook"
      },
      "headers": [
        {
          "name": "X-Source"
        }
      ],
      "enabled": true,
      "disabled_reason": null,
      "last_delivery": {
        "at": "2026-11-15T09:42:07.000Z",
        "status": "delivered"
      },
      "created_at": "2026-11-02T16:20:11.000Z"
    }
  ]
}

Create a webhook

POST/api/v1/webhooks

Needswebhooks:write

Adds an endpoint. The answer holds signing_secret (whsec_ and 40 characters). It is shown only now: store it as a secret.

  • A stream key that does not exist gets 422 stream_not_found. An archived one gets 422 stream_archived.
  • An empty event list, an unknown event, more than 20 headers or an unknown field gets 400 invalid_request.
  • A refused URL, auth or header gets 422 validation_failed. So does a host that cannot be found or that is not public.

Body

  • urlstring, requiredhttps only, the standard port, a public host, at most 2,000 characters, no user name or password in it. AcornDispatch's own hosts are refused.
  • eventsarray of strings, requiredOne or more events. A repeat is dropped.array of strings: Delivery, Bounce, SpamComplaint, Open, Click or SubscriptionChange
  • streamsarray of strings or null, optionalStream keys. Leave it out, or send null, for every stream. An empty list is refused.
  • http_authobject or null, optionalBasic auth, sent with each request.
  • http_auth.usernamestring, required1 to 200 characters, no :.
  • http_auth.passwordstring, required1 to 200 characters.
  • headersarray of objects, optionalAt most 20 extra headers, each name once. Not allowed: authorization, user-agent, content-type, content-length, host, connection, transfer-encoding, keep-alive, upgrade, te, expect, proxy-* and x-acorndispatch-*. Use http_auth for authorization.
  • headers.namestring, requiredA header name.
  • headers.valuestring, requiredAt most 1,000 characters, no line breaks.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • stream_not_found422MessageStream, a stream value or a webhook's streams names no stream of the workspace.
  • stream_archived422A send or a webhook's streams names an archived stream. A default stream is never archived.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/webhooks' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://your-domain.com/hooks/acorndispatch",
    "events": [
      "Delivery",
      "Bounce",
      "SpamComplaint",
      "Open",
      "Click",
      "SubscriptionChange"
    ],
    "http_auth": {
      "username": "hook",
      "password": "your-password"
    },
    "headers": [
      {
        "name": "X-Source",
        "value": "acorndispatch"
      }
    ]
  }'
Response, HTTP 201
{
  "id": "whk_3Jd8sLq2Vn7Ry0Pe",
  "url": "https://your-domain.com/hooks/acorndispatch",
  "events": [
    "Delivery",
    "Bounce",
    "SpamComplaint",
    "Open",
    "Click",
    "SubscriptionChange"
  ],
  "streams": null,
  "http_auth": {
    "username": "hook"
  },
  "headers": [
    {
      "name": "X-Source"
    }
  ],
  "enabled": true,
  "disabled_reason": null,
  "last_delivery": null,
  "created_at": "2026-11-15T10:03:52.000Z",
  "signing_secret": "whsec_your_signing_secret"
}

Change a webhook

PATCH/api/v1/webhooks/{id}

Needswebhooks:write

Turns a webhook on or off, or rotates its signing secret. The answer is the webhook, plus signing_secret after a rotation.

  • Send enabled, rotate_signing_secret: true, or both. Both run together or not at all.

Path

  • idstring, requiredThe webhook id, from the list or the create answer.

Body

  • enabledboolean, optionalfalse turns it off and drops its pending deliveries. true turns it on again, also after a turn-off for failures.
  • rotate_signing_secretboolean, optionaltrue makes a new secret. The old one stops at once, with no overlap: deploy the new secret right after the call.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X PATCH 'https://api.acorndispatch.com/api/v1/webhooks/whk_3Jd8sLq2Vn7Ry0Pe' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "enabled": true
  }'
Response, HTTP 200
{
  "id": "whk_3Jd8sLq2Vn7Ry0Pe",
  "url": "https://your-domain.com/hooks/acorndispatch",
  "events": [
    "Delivery",
    "Bounce",
    "SpamComplaint",
    "Open",
    "Click",
    "SubscriptionChange"
  ],
  "streams": null,
  "http_auth": {
    "username": "hook"
  },
  "headers": [
    {
      "name": "X-Source"
    }
  ],
  "enabled": true,
  "disabled_reason": null,
  "last_delivery": {
    "at": "2026-11-15T09:42:07.000Z",
    "status": "delivered"
  },
  "created_at": "2026-11-02T16:20:11.000Z"
}

Delete a webhook

DELETE/api/v1/webhooks/{id}

Needswebhooks:write

Deletes a webhook and its pending deliveries.

Path

  • idstring, requiredThe webhook id, from the list or the create answer.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X DELETE 'https://api.acorndispatch.com/api/v1/webhooks/whk_3Jd8sLq2Vn7Ry0Pe' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "id": "whk_3Jd8sLq2Vn7Ry0Pe",
  "deleted": true
}

The webhook object

  • idThe webhook id.
  • urlWhere events go.
  • eventsThe events it gets.
  • streamsStream keys, or null for every stream.
  • http_authThe Basic auth user name as { "username" }, or null.
  • headersThe extra header names as [{ "name" }].
  • enabledfalse when the webhook is off.
  • disabled_reasonmanual (turned off by you), failing (turned off after failed deliveries), or null.
  • last_delivery{ "at", "status" } of the last attempt (delivered or failed), or null.
  • created_atISO 8601 time.

A webhook never shows a password, a header value or the signing secret. The secret leaves only in the answer to a create or a rotation.

Webhook events

What AcornDispatch posts to your webhook, how to check that it came from us, and how retries work.

How events arrive

  • Each request is a POST with a JSON body of one event. Field names follow the common webhook names, so one handler can read every event by RecordType.
  • Events of every message of the workspace are sent: your app's, mailings and automations, filtered by the webhook's streams. Test sends are not.
  • Opens and clicks judged to be made by a machine, for example a mail scanner, are not sent.
  • An event can arrive more than once and out of order. Drop duplicates by X-AcornDispatch-Delivery and order by the time fields.

Events and payload fields

Each event and the fields of its body. One handler can read every event by RecordType.

  • DeliveryRecordType, MessageStream, MessageID, Recipient, Tag, Metadata, DeliveredAt and Details
  • BounceRecordType, MessageStream, MessageID, Recipient, Email, Tag, Metadata, Type, TypeCode, Name, Description, Details, Inactive and BouncedAt
  • SpamComplaintRecordType, MessageStream, MessageID, Recipient, Email, Tag, Metadata, Type, TypeCode, Name, Description, Details, Inactive, BouncedAt and TopicsTurnedOff
  • OpenRecordType, MessageStream, MessageID, Recipient, Tag, Metadata, ReceivedAt, FirstOpen and UserAgent
  • ClickRecordType, MessageStream, MessageID, Recipient, Tag, Metadata, ReceivedAt, OriginalLink, ClickLocation and UserAgent
  • SubscriptionChangeRecordType, MessageStream, MessageID, Recipient, Tag, Metadata, ChangedAt, Origin, SuppressSending and SuppressionReason

Delivery

The receiving server took the message.

  • RecordTypestring: DeliveryThe event name.
  • MessageStreamstring or nullThe stream key. null when unknown.
  • MessageIDstringThe message id, as the send answer gave it.
  • RecipientstringThe recipient's address.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • DeliveredAtstringWhen the receiving server took it, as an ISO 8601 string.
  • DetailsstringThe receiving server's answer, or "".
{
  "RecordType": "Delivery",
  "MessageStream": "default_transactional",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "password-reset",
  "Metadata": {
    "user_id": "4821"
  },
  "DeliveredAt": "2026-11-15T09:42:07.000Z",
  "Details": "250 2.0.0 OK"
}

Bounce

The receiving server refused the message, at once or later.

  • RecordTypestring: BounceThe event name.
  • MessageStreamstring or nullThe stream key. null when unknown.
  • MessageIDstringThe message id, as the send answer gave it.
  • RecipientstringThe recipient's address.
  • EmailstringThe same address as Recipient.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • Typestring: HardBounce, SoftBounce, Blocked or UnknownThe bounce type.
  • TypeCodeintegerHardBounce is 1, SoftBounce is 4096, Blocked is 100006, Unknown is 2048.
  • NamestringA short name of the type.
  • DescriptionstringOne sentence about the type.
  • DetailsstringThe receiving server's answer, or "".
  • Inactivebooleantrue when the address is now blocked on the message's stream.
  • BouncedAtstringWhen it bounced, as an ISO 8601 string.
{
  "RecordType": "Bounce",
  "MessageStream": "default_transactional",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "password-reset",
  "Metadata": {
    "user_id": "4821"
  },
  "Email": "ana@example.com",
  "Type": "HardBounce",
  "TypeCode": 1,
  "Name": "Hard bounce",
  "Description": "The address does not exist, or the receiving server refused it for good.",
  "Details": "550 5.1.1 The email account that you tried to reach does not exist.",
  "Inactive": true,
  "BouncedAt": "2026-11-15T09:42:09.000Z"
}

SpamComplaint

The recipient marked the message as spam.

  • RecordTypestring: SpamComplaintThe event name.
  • MessageStreamstring or nullThe stream key. null when unknown.
  • MessageIDstringThe message id, as the send answer gave it.
  • RecipientstringThe recipient's address.
  • EmailstringThe same address as Recipient.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • Typestring: SpamComplaintAlways SpamComplaint.
  • TypeCodeintegerAlways 100001.
  • NamestringA short name of the type.
  • DescriptionstringOne sentence about the type.
  • DetailsstringAlways "".
  • Inactivebooleantrue when a new send of this message to the address would now be skipped.
  • BouncedAtstringWhen the complaint came in, as an ISO 8601 string.
  • TopicsTurnedOffarray of stringsThe keys of the topics the complaint turned off for the address: the Topic of the send, else the topics of its mailing or automation, its template and its stream, in that order. [] when the message had no topic: the address then gets no more emails without a topic.
{
  "RecordType": "SpamComplaint",
  "MessageStream": "default_broadcast",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "",
  "Metadata": {},
  "Email": "ana@example.com",
  "Type": "SpamComplaint",
  "TypeCode": 100001,
  "Name": "Spam complaint",
  "Description": "The recipient marked the message as spam.",
  "Details": "",
  "Inactive": true,
  "BouncedAt": "2026-11-15T11:03:40.000Z",
  "TopicsTurnedOff": [
    "newsletter"
  ]
}

Open

The recipient opened the message.

  • RecordTypestring: OpenThe event name.
  • MessageStreamstring or nullThe stream key. null when unknown.
  • MessageIDstringThe message id, as the send answer gave it.
  • RecipientstringThe recipient's address.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • ReceivedAtstringWhen it happened, as an ISO 8601 string.
  • FirstOpenbooleantrue for the first open of the message.
  • UserAgentstringThe recipient's user agent, or "".
{
  "RecordType": "Open",
  "MessageStream": "default_transactional",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "password-reset",
  "Metadata": {
    "user_id": "4821"
  },
  "ReceivedAt": "2026-11-15T09:47:31.000Z",
  "FirstOpen": true,
  "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) AppleWebKit/605.1.15"
}

Click

The recipient clicked a link in the message.

  • RecordTypestring: ClickThe event name.
  • MessageStreamstring or nullThe stream key. null when unknown.
  • MessageIDstringThe message id, as the send answer gave it.
  • RecipientstringThe recipient's address.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • ReceivedAtstringWhen it happened, as an ISO 8601 string.
  • OriginalLinkstringThe link as your app wrote it.
  • ClickLocationstring: HTMLAlways HTML.
  • UserAgentstringThe recipient's user agent, or "".
{
  "RecordType": "Click",
  "MessageStream": "default_transactional",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "password-reset",
  "Metadata": {
    "user_id": "4821"
  },
  "ReceivedAt": "2026-11-15T09:48:02.000Z",
  "OriginalLink": "https://acme.example/reset?token=abc123",
  "ClickLocation": "HTML",
  "UserAgent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) AppleWebKit/605.1.15"
}

SubscriptionChange

An address was blocked or unblocked on a stream. One event per stream whose state changed.

  • RecordTypestring: SubscriptionChangeThe event name.
  • MessageStreamstringThe stream whose state changed.
  • MessageIDstring or nullThe message that caused the change, or null when none did: a suppression added or lifted by hand or by API.
  • RecipientstringThe recipient's address.
  • TagstringThe message's tag, or "" when it had none. Only messages your app sends carry one.
  • MetadataobjectThe message's metadata, or {} when it had none. Only messages your app sends carry it.
  • ChangedAtstringWhen it changed, as an ISO 8601 string.
  • Originstring: Recipient or CustomerRecipient: the recipient acted. Customer: your workspace or your app acted, including a lift through DELETE /api/v1/suppressions.
  • SuppressSendingbooleantrue when the address is now blocked on that stream.
  • SuppressionReasonstring or null: HardBounce, SpamComplaint or ManualSuppressionWhy it is blocked. null when SuppressSending is false.
{
  "RecordType": "SubscriptionChange",
  "MessageStream": "default_broadcast",
  "MessageID": null,
  "Recipient": "ana@example.com",
  "Tag": "",
  "Metadata": {},
  "ChangedAt": "2026-11-15T12:15:00.000Z",
  "Origin": "Customer",
  "SuppressSending": true,
  "SuppressionReason": "ManualSuppression"
}

Verify the signature

Every request has these headers:

  • X-AcornDispatch-Signaturet=<unix>,v1=<hex>: t is the send time in Unix seconds, v1 the lower-case hex HMAC-SHA256 of <t>.<raw body>, keyed by the signing secret.
  • X-AcornDispatch-DeliveryThe delivery id. It is the same on every retry of one event: use it to drop duplicates.
  • content-typeapplication/json
  • user-agentAcornDispatch-Webhooks/1.0 (+https://acorndispatch.com)
  • authorizationBasic ..., when the webhook has http_auth.
  • Check the signature over the raw body text, before you parse it.
  • Refuse a t more than 300 seconds from your clock, either side.
  • Compare the HMAC in constant time.

The receivers below do all three, read the secret from ACORNDISPATCH_WEBHOOK_SECRET, and answer 200, or 400 when the check fails.

Delivery and retries

  • Answer with a 2xx within 10 seconds. Do the work after you answer. AcornDispatch reads at most 64 KB of the answer and keeps none of it.
  • A 408, a 429, a 5xx, a timeout or a connection error is retried after 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours and 6 hours, then every 6 hours. 24 hours after the event, the delivery stops for good.
  • A 3xx is not followed and is not retried. Any other 4xx is not retried. Neither is a host that no longer points to a public address.
  • When every delivery to a webhook has failed for 48 hours, AcornDispatch turns the webhook off (disabled_reason failing) and drops its pending deliveries. Turn it on again with PATCH /api/v1/webhooks/{id} and { "enabled": true }.

Receivers

A small server in each language. It checks the signature, reads the secret from ACORNDISPATCH_WEBHOOK_SECRET and answers 200, or 400 when the check fails.

Example

Node 18 or later. No packages.
// Node.js 18 or later, no packages. Run: node receiver.mjs
import { createHmac, timingSafeEqual } from 'node:crypto'
import { createServer } from 'node:http'

const SECRET = process.env.ACORNDISPATCH_WEBHOOK_SECRET
if (!SECRET) throw new Error('Set ACORNDISPATCH_WEBHOOK_SECRET')
const TOLERANCE_SECONDS = 300

function verify(header, rawBody) {
  const m = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header ?? '')
  if (!m) return false
  if (Math.abs(Date.now() / 1000 - Number(m[1])) > TOLERANCE_SECONDS) return false
  const expected = createHmac('sha256', SECRET).update(`${m[1]}.`).update(rawBody).digest()
  return timingSafeEqual(expected, Buffer.from(m[2], 'hex'))
}

createServer((req, res) => {
  const chunks = []
  req.on('data', (chunk) => chunks.push(chunk))
  req.on('end', () => {
    const rawBody = Buffer.concat(chunks)
    if (req.method !== 'POST' || !verify(req.headers['x-acorndispatch-signature'], rawBody)) {
      res.writeHead(400).end()
      return
    }
    const event = JSON.parse(rawBody.toString('utf8'))
    console.log(event.RecordType, event.MessageID, req.headers['x-acorndispatch-delivery'])
    res.writeHead(200).end()
  })
}).listen(Number(process.env.PORT ?? 3000))
Request body, Delivery
{
  "RecordType": "Delivery",
  "MessageStream": "default_transactional",
  "MessageID": "6f1c2a9e-3b7d-4c55-9a0e-8d2f41b7c3e6",
  "Recipient": "ana@example.com",
  "Tag": "password-reset",
  "Metadata": {
    "user_id": "4821"
  },
  "DeliveredAt": "2026-11-15T09:42:07.000Z",
  "Details": "250 2.0.0 OK"
}

Mailings

Write a mailing, send it to yourself, check it and hand it to a person to schedule. Reads need mailings:read, writes mailings:write, the report reports:read.

List mailings

GET/api/v1/mailings

Needsmailings:read

Mailings, newest first, one page at a time.

Query

  • statusstring, optionalOne status, or a comma-separated list.string: draft, scheduled, sending, sent, paused or canceled
  • limitinteger, optional1 to 100 mailings per page. Default 20.
  • cursorstring, optionalnext_cursor of the page before.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.

Example

Any shell with curl.
curl -sS -G 'https://api.acorndispatch.com/api/v1/mailings' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  --data-urlencode 'status=draft'
Response, HTTP 200
{
  "data": [
    {
      "id": "brd_8fK2mQ9xLp3vT7wZ",
      "name": "November newsletter",
      "status": "draft",
      "subject": "What is new in November",
      "preheader": "Three new templates and a faster editor",
      "sender_identity_id": null,
      "reply_to": null,
      "audience_id": "aud_N4tq8ZbW2rYc6Hkx",
      "topic": null,
      "html": "<h1>What is new in November</h1><p>Three new templates and a faster editor.</p>",
      "template_version": 1,
      "lint": {
        "errors": [],
        "warnings": []
      },
      "last_test_sent_at": null,
      "scheduled_at": null,
      "proposed_send_at": null,
      "created_at": "2026-11-15T10:12:44.000Z",
      "updated_at": "2026-11-15T10:12:44.000Z"
    }
  ],
  "next_cursor": null
}

Create a mailing

POST/api/v1/mailings

Needsmailings:write

Creates a draft. It goes out on the Mailings stream.

  • A mailing names no stream: a stream field gets 400 invalid_request, as any unknown field does.
  • An unknown audience or sender, or a Reply-To that is not an address, gets 422 validation_failed.

Body

  • namestring, requiredA name for your team. Recipients never see it.
  • subjectstring, requiredThe subject line. Not blank.
  • htmlstring, requiredThe full HTML of the email. Not blank. Liquid works.
  • preheaderstring or null, optionalThe preview text after the subject in the inbox.
  • audience_idstring or null, optionalAn audience id from GET /api/v1/audiences. null: no audience yet. Left out: the audience with the key newsletter, when there is one.
  • sender_identity_idstring or null, optionalA sender of this workspace. null: the workspace default when it sends.
  • reply_tostring or null, optionalA Reply-To address. null or "": none.
  • topicstring or null, optionalThe key of a topic recipients can choose. null: none. An unknown, hidden or archived key gets 400 invalid_request.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/mailings' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "November newsletter",
    "subject": "What is new in November",
    "preheader": "Three new templates and a faster editor",
    "html": "<h1>What is new in November</h1><p>Three new templates and a faster editor.</p>"
  }'
Response, HTTP 201
{
  "id": "brd_8fK2mQ9xLp3vT7wZ",
  "name": "November newsletter",
  "status": "draft",
  "subject": "What is new in November",
  "preheader": "Three new templates and a faster editor",
  "sender_identity_id": null,
  "reply_to": null,
  "audience_id": "aud_N4tq8ZbW2rYc6Hkx",
  "topic": null,
  "html": "<h1>What is new in November</h1><p>Three new templates and a faster editor.</p>",
  "template_version": 1,
  "lint": {
    "errors": [],
    "warnings": []
  },
  "last_test_sent_at": null,
  "scheduled_at": null,
  "proposed_send_at": null,
  "created_at": "2026-11-15T10:12:44.000Z",
  "updated_at": "2026-11-15T10:12:44.000Z"
}

Get a mailing

GET/api/v1/mailings/{id}

Needsmailings:read

One mailing, with its variants and A/B test when it has more than one variant.

Path

  • idstring, requiredThe mailing id.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "id": "brd_8fK2mQ9xLp3vT7wZ",
  "name": "November newsletter",
  "status": "draft",
  "subject": "What is new in November",
  "preheader": "Three new templates and a faster editor",
  "sender_identity_id": null,
  "reply_to": null,
  "audience_id": "aud_N4tq8ZbW2rYc6Hkx",
  "topic": null,
  "html": "<h1>What is new in November</h1><p>Three new templates and a faster editor.</p>",
  "template_version": 1,
  "lint": {
    "errors": [],
    "warnings": []
  },
  "last_test_sent_at": null,
  "scheduled_at": null,
  "proposed_send_at": null,
  "created_at": "2026-11-15T10:12:44.000Z",
  "updated_at": "2026-11-15T10:12:44.000Z"
}

Change a mailing

PATCH/api/v1/mailings/{id}

Needsmailings:write

Changes a draft. Send only the fields you change.

  • Drafts only. Any other status gets 409 conflict.
  • status or scheduled_at in the body gets 403 forbidden: only a person schedules.
  • A content field saves a new template_version.

Path

  • idstring, requiredThe mailing id.

Body

  • namestring, optionalA name for your team. Recipients never see it.
  • subjectstring, optionalThe subject line. Not blank.
  • htmlstring, optionalThe full HTML of the email. Not blank. Liquid works.
  • preheaderstring or null, optionalThe preview text after the subject in the inbox.
  • audience_idstring or null, optionalAn audience id from GET /api/v1/audiences. null: no audience yet.
  • sender_identity_idstring or null, optionalA sender of this workspace. null: the workspace default when it sends.
  • reply_tostring or null, optionalA Reply-To address. null or "": none.
  • topicstring or null, optionalThe key of a topic recipients can choose. null: none. An unknown, hidden or archived key gets 400 invalid_request.
  • base_versioninteger or null, optionalThe template_version you started from. When a newer version was saved since, the change gets 409 conflict.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X PATCH 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "subject": "Three new templates, one faster editor"
  }'
Response, HTTP 200
{
  "id": "brd_8fK2mQ9xLp3vT7wZ",
  "name": "November newsletter",
  "status": "draft",
  "subject": "Three new templates, one faster editor",
  "preheader": "Three new templates and a faster editor",
  "sender_identity_id": null,
  "reply_to": null,
  "audience_id": "aud_N4tq8ZbW2rYc6Hkx",
  "topic": null,
  "html": "<h1>What is new in November</h1><p>Three new templates and a faster editor.</p>",
  "template_version": 2,
  "lint": {
    "errors": [],
    "warnings": []
  },
  "last_test_sent_at": null,
  "scheduled_at": null,
  "proposed_send_at": null,
  "created_at": "2026-11-15T10:12:44.000Z",
  "updated_at": "2026-11-15T10:31:05.000Z"
}

Send a test

POST/api/v1/mailings/{id}/test

Needsmailings:write

Sends the current content to you and your team. The subject starts with [TEST], or [TEST B] for variant B of an A/B test. A test counts in no stats.

  • Each address must be a workspace member or on the test allowlist. Anyone else gets 422 address_not_allowed.
  • A variant the mailing does not have gets 404 not_found.

Path

  • idstring, requiredThe mailing id.

Body

  • toarray of strings, required1 to 10 different addresses, in a list of at most 50.
  • variantstring, optionalThe variant to test. Default A.string: A, B, C, D, E, F, G or H

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • address_not_allowed422A mailing test send names an address that is not a workspace member or on the test list. The send routes never answer it.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/test' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "to": [
      "you@your-domain.com"
    ]
  }'
Response, HTTP 202
{
  "sent": [
    "you@your-domain.com"
  ]
}

Prepare a schedule

POST/api/v1/mailings/{id}/prepare-schedule

Needsmailings:write

Runs the checks for a send time and stores it as a proposal. It never schedules: a person opens review_url and schedules there.

  • Drafts only. Any other status gets 409 conflict.
  • A time in the past or too far ahead gets 422 validation_failed.
  • A failed check is data, not an error: ready is false and the check has a fix. The checks, in order: content, test, sending_domain, link_domain, sending_account and audience.
  • The answer holds at the time of the call only. The checks run again when a person schedules.

Path

  • idstring, requiredThe mailing id.

Body

  • send_atstring, requiredAn ISO 8601 time with an offset, after now and at most 90 days ahead.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/prepare-schedule' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "send_at": "2026-12-01T09:00:00-08:00"
  }'
Response, HTTP 200
{
  "ready": false,
  "checks": [
    {
      "key": "content",
      "passed": true,
      "fix": null
    },
    {
      "key": "test",
      "passed": false,
      "fix": "Send a test of this version"
    },
    {
      "key": "sending_domain",
      "passed": true,
      "fix": null
    },
    {
      "key": "link_domain",
      "passed": true,
      "fix": null
    },
    {
      "key": "sending_account",
      "passed": true,
      "fix": null
    },
    {
      "key": "audience",
      "passed": true,
      "fix": null
    }
  ],
  "final_count": 45822,
  "proposed_send_at": "2026-12-01T17:00:00.000Z",
  "review_url": "https://app.acorndispatch.com/mailings/brd_8fK2mQ9xLp3vT7wZ/review"
}

Get a report

GET/api/v1/mailings/{id}/report

Needsreports:read

How a mailing did: who it went to, deliveries, bounces, opens, clicks and links. Rates are fractions from 0 to 1, or null before there is anything to count.

Path

  • idstring, requiredThe mailing id.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/report' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "mailing_id": "brd_8fK2mQ9xLp3vT7wZ",
  "status": "sent",
  "started_at": "2026-11-18T17:00:00.000Z",
  "finished_at": "2026-11-18T17:41:12.000Z",
  "at_start": {
    "audience": 48210,
    "unsubscribed": 1310,
    "topic_opted_out": 402,
    "suppressed": 655,
    "invalid_email": 21,
    "final": 45822,
    "ad_recipients": 45822
  },
  "skipped_at_send": [],
  "pending": 0,
  "attempted": 45822,
  "delivered": 45390,
  "bounced": {
    "hard": 212,
    "soft": 160,
    "policy": 38,
    "other": 4
  },
  "bounced_total": 236,
  "no_result_yet": 18,
  "failed": 0,
  "complaints": 9,
  "unique_opens": {
    "all": 21480,
    "human": 17312
  },
  "unique_clicks": {
    "all": 3204,
    "human": 2981
  },
  "unsubscribes": 97,
  "archived": false,
  "links": [
    {
      "url": "https://acme.example/templates",
      "label": "See the new templates",
      "unique_clicks": 2140,
      "total_clicks": 2655
    }
  ],
  "delivered_rate": 0.9906,
  "bounce_rate": 0.0052,
  "skipped_rate": 0,
  "failed_rate": 0,
  "rates_over_delivered": {
    "unique_opens_human": 0.3814,
    "unique_opens_all": 0.4732,
    "unique_clicks_human": 0.0657,
    "unique_clicks_all": 0.0706,
    "unsubscribes": 0.0021
  },
  "progress": {
    "done": 45822,
    "total": 45822,
    "rate_per_second": null,
    "estimated_finish_at": null,
    "held": null
  }
}

Add a variant

POST/api/v1/mailings/{id}/variants

Needsmailings:write

Adds a variant with the next free key and the name Variant <key>. The first one added also sets a default A/B test.

  • Send copy_of with from: copy, and only then.
  • Drafts only. Any other status gets 409 conflict.
  • A mailing with 8 variants gets 422 validation_failed.

Path

  • idstring, requiredThe mailing id.

Body

  • fromstring, requiredblank starts empty with the From and Reply-To of A. copy copies a variant.string: blank or copy
  • copy_ofstring, optionalThe variant to copy.string: A, B, C, D, E, F, G or H

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/variants' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "copy",
    "copy_of": "A"
  }'
Response, HTTP 201
{
  "key": "B",
  "name": "Variant B"
}

Change a variant

PATCH/api/v1/mailings/{id}/variants/{key}

Needsmailings:write

Changes the content of one variant. Each change saves a new version.

  • Drafts only. Any other status gets 409 conflict.
  • Send at least one content field. An empty change gets 422 validation_failed.

Path

  • idstring, requiredThe mailing id.
  • keystring, requiredThe variant key, A to H. Any other key gets 404 not_found.string: A, B, C, D, E, F, G or H

Body

  • subjectstring, optionalThe subject line. Not blank.
  • htmlstring, optionalThe full HTML of the email. Not blank. Liquid works.
  • preheaderstring or null, optionalThe preview text after the subject in the inbox.
  • sender_identity_idstring or null, optionalA sender of this workspace. null: the workspace default when it sends.
  • reply_tostring or null, optionalA Reply-To address. null or "": none.
  • base_versioninteger or null, optionalThe template_version you started from. When a newer version was saved since, the change gets 409 conflict.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X PATCH 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/variants/B' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "subject": "Your November update is here"
  }'
Response, HTTP 200
{
  "key": "B",
  "template_version": 2,
  "lint": {
    "errors": [],
    "warnings": []
  }
}

Delete a variant

DELETE/api/v1/mailings/{id}/variants/{key}

Needsmailings:write

Removes one variant. When it was the fallback, the fallback becomes leader.

  • Drafts only. Any other status gets 409 conflict.
  • Variant A cannot be removed: 422 validation_failed.

Path

  • idstring, requiredThe mailing id.
  • keystring, requiredThe variant key, A to H. Any other key gets 404 not_found.string: A, B, C, D, E, F, G or H

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X DELETE 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/variants/B' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "key": "B",
  "removed": true
}

Set up the A/B test

PUT/api/v1/mailings/{id}/ab-test

Needsmailings:write

Sets how the test runs. The answer is the saved settings; fields the mode does not use are null.

  • Drafts only. Any other status gets 409 conflict.
  • Add a variant first. A mailing with one variant gets 409 conflict.
  • A value out of range, or a field the mode needs and did not get, gets 422 validation_failed with the field named in the message.

Path

  • idstring, requiredThe mailing id.

Body

  • shareinteger, requiredThe percent of the audience in the test group, 1 to 100. At 100, everyone gets a variant and there is no winner.
  • winner_modestring or null, requiredauto picks the winner after the wait. manual: a person picks it in the app. Needed when share is under 100.string or null: auto or manual
  • metricstring or null, optionalWhat the winner is judged on. Needed with auto.string or null: human_opens, all_opens or clicks
  • wait_minutesinteger or null, optionalHow long the test runs, 15 to 10,080 minutes. Needed with auto.
  • fallbackstring or null, optionalWith no clear winner: leader sends the variant ahead, variant sends fallback_key, wait waits for a person. Needed with auto.string or null: leader, variant or wait
  • fallback_keystring or null, optionalA variant of this mailing. Needed with fallback: variant.string or null: A, B, C, D, E, F, G or H

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.
  • conflict409The change does not fit the current state, for example an edit of a mailing that is no longer a draft.
  • not_found404The message, stream, webhook or mailing does not exist in this workspace. An id of another workspace gets this too.

Example

Any shell with curl.
curl -sS -X PUT 'https://api.acorndispatch.com/api/v1/mailings/brd_8fK2mQ9xLp3vT7wZ/ab-test' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "share": 20,
    "winner_mode": "auto",
    "metric": "human_opens",
    "wait_minutes": 60,
    "fallback": "leader"
  }'
Response, HTTP 200
{
  "share": 20,
  "winner_mode": "auto",
  "metric": "human_opens",
  "wait_minutes": 60,
  "fallback": "leader",
  "fallback_key": null
}

Scheduling and sending

Scheduling and sending need a person in the app: an API key always gets 403 forbidden there. Use prepare-schedule and pass its review_url to that person.

The mailing object

  • idThe mailing id.
  • nameThe name your team sees.
  • statusdraft, scheduled, sending, sent, paused or canceled
  • subject, preheader, htmlThe current content (of variant A in an A/B test).
  • sender_identity_id, reply_toThe sender and Reply-To, or null.
  • audience_idThe audience, or null.
  • topicThe mailing's topic key, or null.
  • template_versionThe content version. Each content change saves a new one.
  • linterrors and warnings, each { code, message }. An error blocks scheduling.
  • last_test_sent_atWhen the last test went out, or null.
  • scheduled_atWhen it sends, once a person scheduled it.
  • proposed_send_atThe time the last prepare-schedule proposed.
  • created_at, updated_atISO 8601 times.

Bounces in a report

bounced_total: emails that could not be delivered, every bounce the receiving server gave as final. bounce_rate is bounced_total over attempted. bounced splits every bounced email by reason, temporary problems included, so its sum can be higher.

A/B tests

  • A mailing can have up to 8 variants, A to H. Variant writes work on drafts only.
  • With more than one variant, the mailing gets variants (each with key, name, subject, preheader, sender_identity_id, reply_to, html, version) and ab_test. The report gets variants, rest and decision, and prepare-schedule gets differences. A mailing with one variant has none of these fields.
  • No route picks the winner. With winner_mode auto, the leader wins when it is ahead with 95% confidence; else the fallback decides. With manual, a person picks it in the app.

Images

Upload an image and use its URL in a mailing. Needs the assets:write scope.

Upload an image

POST/api/v1/assets

Needsassets:write

Stores one image and answers its public URL. The same file again gives the same URL.

  • Send multipart/form-data with one file field. Anything else gets 400 invalid_request.
  • The type comes from the bytes. An SVG, an empty file, a file that is not an image, or a declared type that does not match gets 422 validation_failed.
  • A file over 5 MB gets 422 validation_failed, or 413 payload_too_large when the whole body is over the limit.

Body

A multipart form.

  • filefile, requiredA PNG, JPEG, GIF or WebP image, at most 5 MB.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".
  • invalid_request400The body or a value breaks a rule: not JSON, an unknown field, a missing Subject, a bad Idempotency-Key, a bad query value. The message names the field.
  • payload_too_large413The body is over the route's limit. See Body size.
  • validation_failed422A change breaks a rule of the resource, for example a webhook URL that is refused. The message says which rule.

Example

Any shell with curl.
curl -sS -X POST 'https://api.acorndispatch.com/api/v1/assets' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY" \
  -F 'file=@./logo.png;type=image/png'
Response, HTTP 201
{
  "url": "https://assets.acorndispatch.com/acme/3f8a1c0e9b7d4e2f6a5c8b1d0e9f7a6c5b4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f.png",
  "bytes": 18342,
  "width": 600,
  "height": 200,
  "content_type": "image/png"
}

Audiences

The audiences a mailing can go to. Needs the audiences:read scope.

List audiences

GET/api/v1/audiences

Needsaudiences:read

Every audience you can use, by name. count is how many people match now. An audience whose rule no longer works is left out.

Errors

  • unauthorized401The API key is missing or wrong.
  • rate_limited429Over 60 requests per minute for this key, on a route with the limit. Wait the retry-after seconds, then retry.
  • forbidden403The key lacks the scope the route needs. The message names it, for example "This API key needs the email:send scope".

Example

Any shell with curl.
curl -sS 'https://api.acorndispatch.com/api/v1/audiences' \
  -H "Authorization: Bearer $ACORNDISPATCH_API_KEY"
Response, HTTP 200
{
  "data": [
    {
      "id": "aud_N4tq8ZbW2rYc6Hkx",
      "name": "Newsletter",
      "description": "Everyone who gets the weekly newsletter",
      "count": 48210
    },
    {
      "id": "aud_7Gm2Qx9Lr4Vw1Tc8",
      "name": "Trial users",
      "description": null,
      "count": 1312
    }
  ]
}