List messages
const url = 'https://api.inboxcnx.com/v1/messages?q=invoice&from=alice%40example.com&to=bob%40example.com&after=2026-08-01T00%3A00%3A00Z&before=2026-09-01T00%3A00%3A00Z&minSize=1024&maxSize=10485760&hasAttachment=true&keyword=%24flagged¬Keyword=%24seen&label=inbox¬Label=trash&providerThreadId=18c9a2f1b3d4e5f6&sourceMeta=%7B%22priority%22%3A%22high%22%7D&application=%7B%22crmId%22%3A%2242%22%7D&sort=receivedAt&order=asc&include=total';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://api.inboxcnx.com/v1/messages?q=invoice&from=alice%40example.com&to=bob%40example.com&after=2026-08-01T00%3A00%3A00Z&before=2026-09-01T00%3A00%3A00Z&minSize=1024&maxSize=10485760&hasAttachment=true&keyword=%24flagged¬Keyword=%24seen&label=inbox¬Label=trash&providerThreadId=18c9a2f1b3d4e5f6&sourceMeta=%7B%22priority%22%3A%22high%22%7D&application=%7B%22crmId%22%3A%2242%22%7D&sort=receivedAt&order=asc&include=total' \ --header 'Authorization: Bearer <token>'Lists the stored mail of your grants, newest first, filtered by sender, date, folder, search text and more. Returns messages matching every given query parameter (all parameters are combined with AND). Omit every parameter to list all messages the caller can see.
Results are paginated: pass the previous response’s nextCursor or prevCursor back as cursor to fetch the next or previous page; null means there is none. include=total adds the number of matches. See the pagination guide.
To combine filters with OR or NOT, or to nest conditions, use POST /v1/messages/query instead: it accepts the same fields inside a filter tree.
Requires the read:messages scope.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Full-text search across subject, body, and every address field (from/to/cc/bcc). Matches inflected word forms in the message’s own language, not only the exact word typed.
Example
invoiceFull-text search across subject, body, and every address field (from/to/cc/bcc). Matches inflected word forms in the message’s own language, not only the exact word typed.
Exact sender address match (not a substring search). Matches only if this exact address appears in From.
Example
alice@example.comExact sender address match (not a substring search). Matches only if this exact address appears in From.
Exact recipient address match (not a substring search). Matches only if this exact address appears in To.
Example
bob@example.comExact recipient address match (not a substring search). Matches only if this exact address appears in To.
Only messages received at or after this instant (inclusive).
Example
2026-08-01T00:00:00ZOnly messages received at or after this instant (inclusive).
Only messages received strictly before this instant.
Example
2026-09-01T00:00:00ZOnly messages received strictly before this instant.
Only messages whose total size in bytes is at least this value.
Example
1024Only messages whose total size in bytes is at least this value.
Only messages whose total size in bytes is at most this value.
Example
10485760Only messages whose total size in bytes is at most this value.
Only messages carrying this JMAP keyword, e.g. $flagged or $seen.
Example
$flaggedOnly messages carrying this JMAP keyword, e.g. $flagged or $seen.
Only messages that do NOT carry this JMAP keyword.
Example
$seenOnly messages that do NOT carry this JMAP keyword.
Only messages carrying this label: either a system role (e.g. inbox, sent) or a source-specific custom label (e.g. a Gmail label).
Example
inboxOnly messages carrying this label: either a system role (e.g. inbox, sent) or a source-specific custom label (e.g. a Gmail label).
Only messages that do NOT carry this label, e.g. trash to leave out trashed mail.
Example
trashOnly messages that do NOT carry this label, e.g. trash to leave out trashed mail.
Only messages belonging to this source provider’s own thread id (Gmail/M365/IMAP thread id).
Example
18c9a2f1b3d4e5f6Only messages belonging to this source provider’s own thread id (Gmail/M365/IMAP thread id).
Only messages belonging to this InboxCNX thread id, as returned by GET /v1/threads.
Only messages belonging to this InboxCNX thread id, as returned by GET /v1/threads.
Only messages ingested through this connection grant.
Only messages ingested through this connection grant.
Only messages whose source-specific payload object contains this shape. Every field given here must be present in payload, matching at any nesting depth; extra fields elsewhere in payload do not disqualify a match. This checks containment only: ranges (greater/less than, between) and substring matches against nested values are not supported.
Only messages whose source-specific payload object contains this shape. Every field given here must be present in payload, matching at any nesting depth; extra fields elsewhere in payload do not disqualify a match. This checks containment only: ranges (greater/less than, between) and substring matches against nested values are not supported.
object
Example
{ "sourceMeta": { "priority": "high" }}Sort axis. relevance requires q and is reachable to at most 1000 results. Narrow the query instead of paging further. Default: receivedAt.
Sort axis. relevance requires q and is reachable to at most 1000 results. Narrow the query instead of paging further. Default: receivedAt.
Sort direction. Default: desc (newest, or best match, first).
Sort direction. Default: desc (newest, or best match, first).
Opaque pagination cursor: a previous response’s nextCursor or prevCursor, passed back verbatim. A cursor issued under one sort order is rejected if reused with another.
Opaque pagination cursor: a previous response’s nextCursor or prevCursor, passed back verbatim. A cursor issued under one sort order is rejected if reused with another.
Page size, between 1 and 200. Default 50.
Page size, between 1 and 200. Default 50.
total adds the number of matching results, counted up to 10000.
total adds the number of matching results, counted up to 10000.
Responses
Section titled “Responses”A page of message summaries, without body and attachments
object
object
object
object
object
object
object
object
object
object
object
object
object
Pass back as cursor for the next page. Null on the last page.
Pass back as cursor for the previous page. Null on the first page.
Present only when requested with include. exact is false once the count reaches 10000 (or the depth cap of a relevance search); count is then that cap.
object
Example
{ "data": [ { "id": "c4a7e2b9-1d3f-4e6a-8b0c-5f2d9e7a1b34", "grantId": "9b2f0c4e-6a1d-4f3b-8c55-0d7e2a91b3c4", "providerMessageId": "18f2c4a9b7d01e3f", "providerThreadId": "18f2b1c0a9e8d7f6", "source": "gmail", "receivedAt": "2026-10-23T07:58:12.000Z", "sentAt": "2026-10-23T07:58:09.000Z", "subject": "Invoice 2026-1042", "from": [ { "name": "Acme Accounts", "email": "accounts@example.com" } ], "sender": null, "to": [ { "name": null, "email": "owner@example.com" } ], "cc": null, "bcc": null, "replyTo": null, "messageId": [ "<20261023075809.4711@example.com>" ], "inReplyTo": null, "references": null, "size": 48213, "keywords": { "$seen": false }, "labels": { "system": [ "inbox" ], "custom": [] }, "language": "en", "preview": "Please find attached the invoice for October.", "hasAttachment": true, "raw": { "downloadUrl": "https://api.inboxcnx.com/v1/raw/c4a7e2b9-1d3f-4e6a-8b0c-5f2d9e7a1b34" }, "enrichment": null, "stateAt": "2026-10-23T07:58:12.000Z", "deletedAt": null } ], "nextCursor": "eyJ2IjoiMjAyNi0xMC0yM1QwNzo1ODoxMi4wMDBaIn0", "prevCursor": null}Invalid query, malformed cursor, or a page beyond the relevance depth limit
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The credential lacks the read:messages scope
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}The query exceeded the read timeout
object
object
Example generated
{ "error": { "code": "example", "message": "example" }}