Send a batch of emails (Postmark dialect)
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.
Authorization
PostmarkServerToken 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.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A Postmark /email body. From and To are required, and so is one of HtmlBody or TextBody (else 422).
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/compat/postmark/email/batch" \ -H "Content-Type: application/json" \ -d '[ { "From": "string", "To": "string", "Subject": "string" } ]'[
{
"To": "string",
"SubmittedAt": "2019-08-24T14:15:22Z",
"MessageID": "b00f6a43-1bdc-4bbc-ad5d-b5c0d7272191",
"ErrorCode": 0,
"Message": "OK"
}
]{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}{
"ErrorCode": 0,
"Message": "string"
}