Skip to Content
Pouch
Emails

Read a message

GET
/v1/emails/{id}

Auth: Bearer key scoped to the message's domain.

Authorization

bearer
headerAuthorizationBearer <token>

An API key in the Authorization header.

Path Parameters

id*string

An opaque, type-prefixed id.

Query Parameters

include?string

Comma-separated expansions to add: events (every lifecycle transition, oldest first, returned by default); occurrences (what happened without changing the status: retries, backoffs, suppressions, a shredded body, webhook deliveries, oldest first); stall (what holds a queued message, or null, returned by default); body (html, text and attachments with download links that expire, or null and why); rendered (the html as the recipient got it, framed in the domain's layout, or null and why); resends (the copies resent from this message, oldest first, returned by default).

fields?string

Comma-separated top-level keys to return in place of the defaults. id always comes back. Valid: id, url, status, from, to, cc, bcc, reply_to, subject, tags, headers, layout, key_id, batch_id, test_mode, sensitive, warnings, provider_message_id, reason, attempts, next_attempt_at, created_at, sent_at, delivered_at, abandoned_at, size, resent_from, events, occurrences, stall, body, rendered, body_unavailable, resends.

Response Body

The message, with its full event history.

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.

resends?array<>

The copies resent from this message, oldest first. Returned by GET /v1/emails/:id, and by the list with include=resends.

events?array<>

Every lifecycle transition, oldest first. Returned by GET /v1/emails/:id, and by the list with include=events.

occurrences?array<>

With include=occurrences. What happened without changing the status, oldest first. kind is retry ({ attempt, next_attempt_at }), backoff ({ until, count }), suppressed ({ address, suppression_reason }), body_shredded ({ retention_days }), webhook_delivered ({ event_type, host, status_code }) or abandoned ({}).

stall?|

Returned by GET /v1/emails/:id only. Null unless status is queued and held. kind is "domain" when the message's own domain is paused, or "organization" when its organization is suspended for reputation or by the provider. reason is provider_paused under a provider suspension. reason, message and stalled_at otherwise match a domain response's stall field.

body?|

With include=body. html as accepted, before the domain's layout wraps it. Each download_url is a signed link valid for 15 minutes, minted on every read. Null when the body can't be read, and body_unavailable says why.

rendered?|

With include=rendered. html is the html part as the recipient got it, framed in the domain's layout when the send asked for one. frame_changed is true when the layout or its template changed after the message was accepted, so the frame isn't the one sent, and null when that can't be told. Null when the body can't be read, and body_unavailable says why.

body_unavailable?|

With include=body or include=rendered. Null when body is there. reason is withheld (the message is sensitive and its body is never returned), shredded (past retention, key destroyed), expired (past retention) or unavailable (storage didn't answer; read again). ended_at is when the body stopped being readable, or null.

Example Request
curl -X GET 'https://pouch.example.com/v1/emails/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",  "resends": [    {      "id": "string",      "status": "string",      "created_at": "string"    }  ],  "events": [    {      "id": "string",      "status": "string",      "reason": "string",      "occurred_at": "string"    }  ],  "occurrences": [    {      "id": "string",      "kind": "retry",      "reason": "string",      "occurred_at": "string",      "detail": {}    }  ],  "stall": {    "kind": "domain",    "reason": "string",    "message": "string",    "stalled_at": "string"  },  "body": {    "html": "string",    "text": "string",    "attachments": [      {        "filename": "string",        "content_type": "string",        "size": 0,        "download_url": "string"      }    ]  },  "rendered": {    "html": "string",    "framed": true,    "frame_changed": true  },  "body_unavailable": {    "reason": "withheld",    "message": "string",    "ended_at": "string"  }}