Skip to content

Recent email threads across all connected accounts

GET
/api/v1/email/threads
curl --request GET \
--url 'http://localhost:11044/api/v1/email/threads?days=14&maxPerAccount=50' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'
days
integer format: int32
default: 14

How far back to look, in whole days ending now; defaults to 14, and zero or negative is refused with 400

maxPerAccount
integer format: int32
default: 50

Most threads taken from each connected account, so the response holds at most this many per account; defaults to 50, and zero or negative is refused with 400

Days or maxPerAccount is not positive. The reason is carried in the body’s error field, alongside an empty threads list

Media type*/*

The answer of GET /email/threads: recent threads from every connected account, or an error and an empty list.

object
error

Why the request failed, a bad parameter or a provider failure; null on success

string
threads
required

Threads from every connected account with messages in the requested window, at most maxPerAccount per account; empty when error is set

Array<object>

A whole email conversation from one of the signed-in user’s connected accounts, messages oldest first. Returned in the threads list of GET /email/threads.

object
account

The connected account the thread was read from; set on every thread GET /email/threads returns, null only in older cached data

object
accountId
required

The provider’s stable identifier for the account, typically its email address

string
displayName
required

Label recorded for the account when it was connected, for showing in a UI

string
provider
required

Key of the OAuth provider the account was connected through, such as google-workspace or microsoft-graph

string
lastMessageAt
required

When the newest message arrived, an ISO-8601 instant

string format: date-time
messages
required

The messages of the conversation, oldest first

Array<object>

One message in an email thread, with a plain-text body. Found in EmailThread.messages.

object
attachments
required

Attachments whose text was extracted, for supported types within the size limit; empty when none were. Only Gmail accounts fill it

Array<object>

The text extracted from one email attachment; it carries no bytes and no download link. Found in EmailMessage.attachments.

object
extractedText
required

Plain text extracted from the attachment

string
filename
required

The attachment’s file name as the message gives it

string
mimeType
required

MIME type of the attachment, such as application/pdf

string
sizeBytes
required

Size of the original attachment in bytes, as the provider reports it

integer format: int32
autoSubmitted
required

True when the headers mark the message machine-generated, such as an auto-reply or bulk mail. Always false for Microsoft accounts, whose headers are not read

boolean
body
required

Plain-text body, decoded from the message’s text part or stripped from its HTML, with signatures and quoted earlier messages removed

string
cc
required

Cc recipients, in the same form as the To recipients

Array<string>
from
required

The sender as one display string, Name <address> or a bare address; empty when unknown

string
hasAttachments
required

True when the provider reports any attachment on the message, whether or not its text was extracted

boolean
labels
required

Provider labels and folders: Gmail label ids, plus GMAIL_LABEL:<name> for a user label; for Outlook, entries prefixed OUTLOOK_CATEGORY:, OUTLOOK_INFERENCE:, OUTLOOK_FOLDER: or OUTLOOK_FOLDER_ID:

Array<string>
messageId
required

The provider’s id for this message; empty when the provider gave none

string
receivedAt
required

When the message arrived, an ISO-8601 instant; its sent time when the provider gives no received time

string format: date-time
subject
required

Subject line; (no subject) when the message has none

string
to
required

To recipients, each a display string such as Name <address> or a bare address

Array<string>
participants
required

Every distinct sender and recipient across the messages, as display strings such as Name <address>

Array<string>
source
required

Mail system and web link for the thread

object
provider
required

Mail system the thread was read from: gmail or exchange

string
url

Link that opens the thread in the provider’s web mail; null when none is known

string
subject
required

Subject of the earliest message; (no subject) when it has none

string
threadId
required

The provider’s id for the conversation: a Gmail thread id or an Exchange conversation id

string

The email providers could not be read. The reason is carried in the body’s error field, alongside an empty threads list

Media type*/*

The answer of GET /email/threads: recent threads from every connected account, or an error and an empty list.

object
error

Why the request failed, a bad parameter or a provider failure; null on success

string
threads
required

Threads from every connected account with messages in the requested window, at most maxPerAccount per account; empty when error is set

Array<object>

A whole email conversation from one of the signed-in user’s connected accounts, messages oldest first. Returned in the threads list of GET /email/threads.

object
account

The connected account the thread was read from; set on every thread GET /email/threads returns, null only in older cached data

object
accountId
required

The provider’s stable identifier for the account, typically its email address

string
displayName
required

Label recorded for the account when it was connected, for showing in a UI

string
provider
required

Key of the OAuth provider the account was connected through, such as google-workspace or microsoft-graph

string
lastMessageAt
required

When the newest message arrived, an ISO-8601 instant

string format: date-time
messages
required

The messages of the conversation, oldest first

Array<object>

One message in an email thread, with a plain-text body. Found in EmailThread.messages.

object
attachments
required

Attachments whose text was extracted, for supported types within the size limit; empty when none were. Only Gmail accounts fill it

Array<object>

The text extracted from one email attachment; it carries no bytes and no download link. Found in EmailMessage.attachments.

object
extractedText
required

Plain text extracted from the attachment

string
filename
required

The attachment’s file name as the message gives it

string
mimeType
required

MIME type of the attachment, such as application/pdf

string
sizeBytes
required

Size of the original attachment in bytes, as the provider reports it

integer format: int32
autoSubmitted
required

True when the headers mark the message machine-generated, such as an auto-reply or bulk mail. Always false for Microsoft accounts, whose headers are not read

boolean
body
required

Plain-text body, decoded from the message’s text part or stripped from its HTML, with signatures and quoted earlier messages removed

string
cc
required

Cc recipients, in the same form as the To recipients

Array<string>
from
required

The sender as one display string, Name <address> or a bare address; empty when unknown

string
hasAttachments
required

True when the provider reports any attachment on the message, whether or not its text was extracted

boolean
labels
required

Provider labels and folders: Gmail label ids, plus GMAIL_LABEL:<name> for a user label; for Outlook, entries prefixed OUTLOOK_CATEGORY:, OUTLOOK_INFERENCE:, OUTLOOK_FOLDER: or OUTLOOK_FOLDER_ID:

Array<string>
messageId
required

The provider’s id for this message; empty when the provider gave none

string
receivedAt
required

When the message arrived, an ISO-8601 instant; its sent time when the provider gives no received time

string format: date-time
subject
required

Subject line; (no subject) when the message has none

string
to
required

To recipients, each a display string such as Name <address> or a bare address

Array<string>
participants
required

Every distinct sender and recipient across the messages, as display strings such as Name <address>

Array<string>
source
required

Mail system and web link for the thread

object
provider
required

Mail system the thread was read from: gmail or exchange

string
url

Link that opens the thread in the provider’s web mail; null when none is known

string
subject
required

Subject of the earliest message; (no subject) when it has none

string
threadId
required

The provider’s id for the conversation: a Gmail thread id or an Exchange conversation id

string