Skip to main content
include_headers=true adds the full list of headers. Emails of a removed account return 404, and so does an id that isn’t an email_… id.

The email object

string
Email. Drafts have Draft (see Drafts).
string
The engine’s email_… id. Stays the same when the email moves between folders.
string
The account it belongs to (acc_…).
string
The provider’s id for this message.
string
The Message-ID header, without angle brackets.
string
The conversation it belongs to. See Replies and threads.
date-time
When it was sent (the Date header), or received when that’s missing.
string
string
The start of the text, for previews.
string
HTML. For text-only emails, the text wrapped in HTML.
string
The plain-text version.
attendee
{ display_name, identifier }.
attendee[]
Recipients. bcc_attendees is only known for emails this account sent.
object | null
The email this one answers: { "message_id": "…", "id": "email_…" }. id is set when the account has that email, otherwise null.
string[]
The References header: the conversation’s earlier Message-IDs.
string[]
The folder it’s in. Over IMAP, Gmail shows each label as a folder, so an email with several labels is synced once per label (see Gmail).
string[]
The same folders, by fld_… id.
string
The main role: INBOX, SENT, DRAFTS, TRASH, SPAM, ARCHIVE or UNKNOWN.
boolean
boolean
Flagged in IMAP, starred in Gmail.
boolean
object[]
Each { id, name, extension, size, mime, cid, inline }. inline images are referenced from the HTML by cid. Download with the attachment endpoint.
integer
Message size in bytes.
string
api when the email was sent through this API (including drafts sent through the API), otherwise external.
string | null
The trk_… id when open and click tracking is on for this email, otherwise null.
object[]
With include_headers=true: every header as { name, value }.

Example

Emails are a synced copy. When the user changes something in Gmail or their email app directly, the engine updates the email and sends a webhook (email.update, or email.delete when it’s deleted for good).