Get a Message
const url = 'https://example.com/api/v1/mail/messages/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/mail/messages/example \ --header 'Authorization: Bearer <token>'Requires a signed-in User. It returns the Message, its text and HTML body, external links and attachments. Remote images and sender fonts follow the User’s saved Load remote content preference. It returns 404 when the Message is missing. Route: /api/v1/mail/messages/{id}. Inputs: id. Safe reads can use bounded retries.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”object
object
Sanitized content. Clients must render it in a sandboxed frame with a CSP that denies scripts, forms, navigation, and all network resources.
Explicit links are opened by the client outside the isolated frame.
Internal loading state; no reader prompt or spinner (#726).
object
The User’s Load remote content preference when this body was read. Readers drop retained bodies that disagree with the current value (#736).
Examplegenerated
{ "attachments": [ { "content_type": "example", "filename": "example", "section_id": "example", "size_bytes": 1 } ], "body_html": "example", "body_links": [ "example" ], "body_text": "example", "content_pending": true, "message": { "account_id": "example", "attachment_count": 1, "bcc": [ "example" ], "body_truncated": true, "category": "example", "cc": [ "example" ], "flags": [ "example" ], "folder_id": "example", "from": [ "example" ], "id": "example", "labels": [ "example" ], "preview": "example", "received_ms": 1, "sent_date_ms": 1, "subject": "example", "thread_id": "example", "to": [ "example" ] }, "remote_content_allowed": true}The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}