Send API

Send messages

Queue one or more complete email messages.

Prerequisite

This endpoint requires an existing Delivery account, a configured sending domain, and a Send API bearer token created for that Delivery account.

POST/v1/send

Authorization

ApiBearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

messages*Message[]
Array item: Message
from*AddressAddress

Single email address. Accepts an RFC 5322 mailbox string such as Sender Name <sender@example.com> or an object with address and optional name.

Fields: string | object
address*string

Email address.

name?string
to?AddressListAddressList

Recipient list. Accepts one RFC 5322 mailbox string, a comma-separated RFC 5322 string, one address object, or an array of address strings/objects.

Array item: Address
address*string

Email address.

name?string
cc?AddressListAddressList

Recipient list. Accepts one RFC 5322 mailbox string, a comma-separated RFC 5322 string, one address object, or an array of address strings/objects.

Array item: Address
address*string

Email address.

name?string
bcc?AddressListAddressList

Recipient list. Accepts one RFC 5322 mailbox string, a comma-separated RFC 5322 string, one address object, or an array of address strings/objects.

Array item: Address
address*string

Email address.

name?string
reply_to?AddressListAddressList

Recipient list. Accepts one RFC 5322 mailbox string, a comma-separated RFC 5322 string, one address object, or an array of address strings/objects.

Array item: Address
address*string

Email address.

name?string
subject*string
text_body?string

Required when html_body is absent.

html_body?string

Required when text_body is absent.

headers?object

Custom headers. Values can be string, number, boolean, or arrays of those primitive values.

attachments?Attachment[]
Array item: Attachment
filename*string
content_type*string
content*string

Base64 encoded content.

Format byte
disposition?string

Defaults to inline when content_id is provided; otherwise defaults to attachment.

Default attachmentValues attachment | inline
content_id?string

Required for inline attachments; if provided, disposition must be inline. Used as CID.

tags?string[]
metadata?object

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/send" \  -H "X-Api-Token: YOUR_API_TOKEN" \  -H "Accept: application/json" \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "from": "sender@example.com",        "to": [          "john@example.com"        ],        "subject": "Hello",        "text_body": "Hello from delivery-api"      }    ]  }'
{  "error_code": 0,  "message": "OK",  "request_id": "string",  "queued_messages": 0,  "messages": [    {      "error_code": 0,      "message": "OK",      "request_id": "string",      "message_id": "string",      "submitted_at": "2019-08-24T14:15:22Z",      "to": "string"    }  ],  "suppression_summary": {    "status": "checked",    "checked_recipients": 0,    "accepted_recipients": 0,    "suppressed_recipients": 0,    "suppressed_emails": [      "user@example.com"    ]  }}