Skip to Content
Pouch
Emails

Send an email

POST
/v1/emails

Auth: Bearer key scoped to the from domain.

html or text is required; at least one must be set. Accepts an Idempotency-Key header — a repeat within 24 hours returns the original response. layout is a boolean or an object: true uses the domain's layout as configured, an object of { name, logo, accent, footer } (all optional) overrides those fields for this send only.

Authorization

bearer
headerAuthorizationBearer <token>

An API key in the Authorization header.

Request Body

application/json
  1. body
from*string

Sender as Name <address> or a bare address. The domain must be verified and in the key's scope.

Length3 <= length
to*|array<string>

One or more recipient addresses.

cc?|array<string>

One or more carbon-copy addresses.

bcc?|array<string>

One or more blind carbon-copy addresses.

reply_to?|array<string>

One or more reply-to addresses.

subject*string

Subject line.

Match^[^\x00-\x1F\x7F\u0085\u2028\u2029]*$
Length1 <= length <= 998
html?string

HTML body. At least one of html or text is required.

text?string

Plain-text body. At least one of html or text is required.

headers?

Custom headers. Reserved headers are rejected. Mailpace domains reject custom headers entirely.

tags?array<>

Free-form tags, filterable in the dashboard.

Itemsitems <= 20
attachments?array<>

Files to attach, base64-encoded.

Itemsitems <= 20
layout?|

Wrap html in the domain's layout. The domain must have one. true uses it as configured; an object of name, logo, accent and footer overrides those fields for this send only, falling back to the domain's value for anything omitted. Default false.

subscribe?array<>

List ids to add every address in to to, as an api membership recording this message's id. Each list must be on the sending domain. This is the only door a send can grow a list through — omit it and a send never touches a list.

Itemsitems <= 20
sensitive?boolean

Withhold the body from every read: the API, MCP, exports and the dashboard. Its key is shredded once it leaves the queue, and it can't be resent. Default false.

Response Body

The queued message. A Location header points at its url. Acceptance means persisted, not delivered.

application/json
  1. response
id?string

Opaque id, prefixed msg_.

url?string

Where this message can be read at.

status?string

Lifecycle status.

Value in"queued""sent""delivered""deferred""bounced""complained""failed"
from?string

Sender, as Name when a name was given.

to?array<string>

Recipient addresses.

cc?array<string>

Carbon-copy addresses.

bcc?array<string>

Blind carbon-copy addresses.

reply_to?array<string>

Reply-to addresses.

subject?string

Subject line.

tags?array<string>

Tags as sent.

headers?

Custom headers as accepted. Empty when the send had none.

layout?|

As the send asked for it: false, true for the domain's layout as configured, or the fields it overrode for this send.

key_id?|

The key that sent it, prefixed key_. Null for mail sent without a key, from the dashboard or by the service itself.

batch_id?|

The batch it was sent in, prefixed bat_. Null for a single send.

test_mode?boolean

Whether the sending key was test-mode.

sensitive?boolean

Whether the body is withheld from every read: the send set sensitive, or the message carried a credential.

warnings?array<>

Hints from the recipient's send history, as they stood when this message was accepted. Empty when there's nothing worth flagging. Never changes whether the message was accepted.

provider_message_id?|

The provider's own id for the message, once sent.

reason?|

The provider's reason for the current status, when there is one.

attempts?integer

Delivery attempts made so far.

next_attempt_at?|

When the service next tries to send it, as an ISO 8601 timestamp. Null unless status is queued. A time in the past means it's due now.

created_at?string

ISO 8601 timestamp.

sent_at?|

ISO 8601 timestamp, or null.

delivered_at?|

ISO 8601 timestamp, or null.

abandoned_at?|

When the service stopped waiting on a sent message the provider never reported back on. status stays sent. Null otherwise.

size?

Bytes as accepted. body_bytes is the UTF-8 size of the html and text parts before the domain's layout, attachment_bytes the decoded size of the attachments, 0 with none. Each is null on a message accepted before sizes were recorded.

resent_from?|

The message this one was resent from, prefixed msg_. Null for an original send.

Example Request
curl -X POST 'https://pouch.example.com/v1/emails' \  -H 'Content-Type: application/json' \  -d '{  "from": "string",  "to": "string",  "subject": "string"}'
Example Response
{  "id": "string",  "url": "string",  "status": "queued",  "from": "string",  "to": [    "string"  ],  "cc": [    "string"  ],  "bcc": [    "string"  ],  "reply_to": [    "string"  ],  "subject": "string",  "tags": [    "string"  ],  "headers": {},  "layout": true,  "key_id": "string",  "batch_id": "string",  "test_mode": true,  "sensitive": true,  "warnings": [    {      "code": "previously_bounced",      "address": "string",      "message": "string",      "detail": {}    }  ],  "provider_message_id": "string",  "reason": "string",  "attempts": 0,  "next_attempt_at": "string",  "created_at": "string",  "sent_at": "string",  "delivered_at": "string",  "abandoned_at": "string",  "size": {    "body_bytes": 0,    "attachment_bytes": 0  },  "resent_from": "string"}