FlaresendDocs
Emails

Retrieve email content

Get the stored HTML, text, headers and attachment list of an email.

GET/v1/emails/{id}/contentAPI key

Bodies 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

idstringpathrequired

The email ID.

Response

htmlstring | null

The HTML body as it was accepted, after any template was rendered.

textstring | null

The plain text body.

trackedHtmlstring | null

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.

headersRecord<string, string>

The custom headers that were sent. Broadcast emails include List-Unsubscribe and List-Unsubscribe-Post. Headers Cloudflare adds itself are not listed.

attachmentsArray<{ filename, type, size }>

One entry per attachment. type is the MIME type or null, and size is the decoded size in bytes.

Errors

StatusCodeWhen
404email_not_foundNo email with that ID in this project.
404content_expiredThe body is older than 30 days and has been deleted.