Skip to Content
SendlySendly
API ReferenceCompatibility

Send a batch of emails (Postmark dialect)

POST
/api/compat/postmark/email/batch

Drop-in for Postmark's POST /email/batch. The body is a JSON ARRAY of the objects POST /api/compat/postmark/email takes; a body that is not an array answers 422 (ErrorCode 300), while a body that is not JSON answers 422 with ErrorCode 402.

Unlike the Resend batch this one is PER ENTRY: the request answers 200 and each entry gets its own result in order, a failed entry carrying its { ErrorCode, Message } inline while the others still send. Four things fail the WHOLE request instead: authentication, a body that is not an array, one with too many entries, and content review. Review runs over every entry that translates BEFORE any send, and a refusal rejects the entire batch, because one template repeated across recipients is exactly what review exists to stop. The array carries at most 100 messages, as on the native batch; a longer one answers 422 (ErrorCode 300) and nothing is sent.

PostmarkServerToken
headerX-Postmark-Server-Token<token>

Postmark-style authentication for the /api/compat/postmark/* operations only: a Sendly API key (sk_*, or a pk_* send-only key) sent in the X-Postmark-Server-Token header, exactly where the postmark SDK puts its server token.

application/json
  1. body
[index: integer]?

A Postmark /email body. From and To are required, and so is one of HtmlBody or TextBody (else 422).

Response Body

One result per entry, in input order. An entry that is not a JSON object (null, an array, a string, a number, a boolean) is answered inline with ErrorCode 300 and Batch entry N must be a JSON object., N being its position; the other entries still send.

application/json
  1. response

One entry per input message, in order: a send result, or — for an entry that failed on its own — a { ErrorCode, Message } object, with the request still answering 200 and the other entries still sent.

[index: integer]?|
Example Request
curl -X POST 'https://api.sendly.now/api/compat/postmark/email/batch' \  -H 'Content-Type: application/json' \  -d '[  {    "From": "string",    "To": "string",    "Subject": "string"  }]'
Example Response
[  {    "To": "string",    "SubmittedAt": "2019-08-24T14:15:22Z",    "MessageID": "b00f6a43-1bdc-4bbc-ad5d-b5c0d7272191",    "ErrorCode": 0,    "Message": "OK"  }]