Retrieve email content
Get the stored HTML, text, headers and attachment list of an email.
/v1/emails/{id}/contentAPI keyBodies are stored in R2, separately from the email record, and deleted after 30 days by the bucket's lifecycle rule. Within that window this endpoint returns them. After it, the call fails with 404 content_expired, while the email record itself stays available.
Attachment contents are not returned, only their names, types and sizes.
Path parameters
The email ID.
Response
The HTML body as it was accepted, after any template was rendered.
The plain text body.
The HTML that was actually sent when open or click tracking was on: links rewritten to /t/c/… and the tracking pixel added. null when tracking was off or the email hasn't been sent yet.
The custom headers that were sent. Broadcast emails include List-Unsubscribe and List-Unsubscribe-Post. Headers Cloudflare adds itself are not listed.
One entry per attachment. type is the MIME type or null, and size is the decoded size in bytes.
Errors
| Status | Code | When |
|---|---|---|
| 404 | email_not_found | No email with that ID in this project. |
| 404 | content_expired | The body is older than 30 days and has been deleted. |