Recent email threads across all connected accounts
const url = 'http://localhost:11044/api/v1/email/threads?days=14&maxPerAccount=50';const options = {method: 'GET', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:11044/api/v1/email/threads?days=14&maxPerAccount=50' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”How far back to look, in whole days ending now; defaults to 14, and zero or negative is refused with 400
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
Responses
Section titled “Responses”Days or maxPerAccount is not positive. The reason is carried in the body’s error field, alongside an empty threads list
The answer of GET /email/threads: recent threads from every connected account, or an error and an empty list.
object
Why the request failed, a bad parameter or a provider failure; null on success
Threads from every connected account with messages in the requested window, at most maxPerAccount per account; empty when error is set
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
The connected account the thread was read from; set on every thread GET /email/threads returns, null only in older cached data
object
The provider’s stable identifier for the account, typically its email address
Label recorded for the account when it was connected, for showing in a UI
Key of the OAuth provider the account was connected through, such as google-workspace or microsoft-graph
When the newest message arrived, an ISO-8601 instant
The messages of the conversation, oldest first
One message in an email thread, with a plain-text body. Found in EmailThread.messages.
object
Attachments whose text was extracted, for supported types within the size limit; empty when none were. Only Gmail accounts fill it
The text extracted from one email attachment; it carries no bytes and no download link. Found in EmailMessage.attachments.
object
Plain text extracted from the attachment
The attachment’s file name as the message gives it
MIME type of the attachment, such as application/pdf
Size of the original attachment in bytes, as the provider reports it
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
Plain-text body, decoded from the message’s text part or stripped from its HTML, with signatures and quoted earlier messages removed
Cc recipients, in the same form as the To recipients
The sender as one display string, Name <address> or a bare address; empty when unknown
True when the provider reports any attachment on the message, whether or not its text was extracted
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:
The provider’s id for this message; empty when the provider gave none
When the message arrived, an ISO-8601 instant; its sent time when the provider gives no received time
Subject line; (no subject) when the message has none
To recipients, each a display string such as Name <address> or a bare address
Every distinct sender and recipient across the messages, as display strings such as Name <address>
Mail system and web link for the thread
object
Mail system the thread was read from: gmail or exchange
Link that opens the thread in the provider’s web mail; null when none is known
Subject of the earliest message; (no subject) when it has none
The provider’s id for the conversation: a Gmail thread id or an Exchange conversation id
The email providers could not be read. The reason is carried in the body’s error field, alongside an empty threads list
The answer of GET /email/threads: recent threads from every connected account, or an error and an empty list.
object
Why the request failed, a bad parameter or a provider failure; null on success
Threads from every connected account with messages in the requested window, at most maxPerAccount per account; empty when error is set
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
The connected account the thread was read from; set on every thread GET /email/threads returns, null only in older cached data
object
The provider’s stable identifier for the account, typically its email address
Label recorded for the account when it was connected, for showing in a UI
Key of the OAuth provider the account was connected through, such as google-workspace or microsoft-graph
When the newest message arrived, an ISO-8601 instant
The messages of the conversation, oldest first
One message in an email thread, with a plain-text body. Found in EmailThread.messages.
object
Attachments whose text was extracted, for supported types within the size limit; empty when none were. Only Gmail accounts fill it
The text extracted from one email attachment; it carries no bytes and no download link. Found in EmailMessage.attachments.
object
Plain text extracted from the attachment
The attachment’s file name as the message gives it
MIME type of the attachment, such as application/pdf
Size of the original attachment in bytes, as the provider reports it
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
Plain-text body, decoded from the message’s text part or stripped from its HTML, with signatures and quoted earlier messages removed
Cc recipients, in the same form as the To recipients
The sender as one display string, Name <address> or a bare address; empty when unknown
True when the provider reports any attachment on the message, whether or not its text was extracted
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:
The provider’s id for this message; empty when the provider gave none
When the message arrived, an ISO-8601 instant; its sent time when the provider gives no received time
Subject line; (no subject) when the message has none
To recipients, each a display string such as Name <address> or a bare address
Every distinct sender and recipient across the messages, as display strings such as Name <address>
Mail system and web link for the thread
object
Mail system the thread was read from: gmail or exchange
Link that opens the thread in the provider’s web mail; null when none is known
Subject of the earliest message; (no subject) when it has none
The provider’s id for the conversation: a Gmail thread id or an Exchange conversation id

