Mail

Threads, messages, raw and HTML bodies, attachments and their extracted text.

List threads

GET/v1/inboxes/{inboxId}/threads

Access any: any API key, or a console session.

The inbox's threads, newest activity first. Filter by read state, or search the subject and participants. Trashed threads are left out.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.inboxes.threads.list in TypeScript, client.inboxes.threads.list in Python, the inboxes_threads_list tool and doorman inboxes threads list on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • inboxIdstring, in pathrequired

    The inbox. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z.

  • isRead"true" | "false", in queryoptional

    Only read or only unread threads.

  • qstring, in queryoptional

    Keep the threads whose subject or a participant address contains this text, case-insensitively.

  • labelstring, in queryoptional

    Only threads containing this exact, case-sensitive label. Example: needs-review.

  • limitinteger, in queryoptional

    Page size, 1 to 100. Defaults to 50.

  • offsetinteger, in queryoptional

    Rows to skip. Defaults to 0.

Answers 200: A page of threads.

Response 200: ThreadPage

A page of an inbox's threads, newest activity first. Trashed threads are left out.

  • dataThread[]required

  • limitintegerrequired

    The page size that was applied.

  • offsetintegerrequired

    The offset that was applied.

  • totalintegerrequired

    How many threads match, across every page.

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/threads" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

List threads a person has or has not seen

GET/v1/inboxes/{inboxId}/threads/by-seen

Access session: a console session only; an API key gets 403 session_required.

The inbox's threads, newest activity first, kept by a person's own mark: those somebody looked at in the console since mail last arrived in them, or those nobody has. It is the console's list of what is new to a person, and says nothing about isRead, which agents poll. Trashed threads are left out.

OAuth: not available to delegated app tokens.

Also available as client.inboxes.threads.listBySeen in TypeScript and client.inboxes.threads.list_by_seen in Python.

Organizations: a member's console session needs mail:read. See Roles and permissions.

Parameters
  • inboxIdstring, in pathrequired

    The inbox. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z.

  • isSeen"true" | "false", in queryrequired

    false for the threads nobody has looked at, true for the others.

  • qstring, in queryoptional

    Keep the threads whose subject or a participant address contains this text, case-insensitively.

  • labelstring, in queryoptional

    Only threads containing this exact, case-sensitive label. Example: needs-review.

  • limitinteger, in queryoptional

    Page size, 1 to 100. Defaults to 50.

  • offsetinteger, in queryoptional

    Rows to skip. Defaults to 0.

Answers 200: A page of threads.

Response 200: ThreadPage

A page of an inbox's threads, newest activity first. Trashed threads are left out.

  • dataThread[]required

  • limitintegerrequired

    The page size that was applied.

  • offsetintegerrequired

    The offset that was applied.

  • totalintegerrequired

    How many threads match, across every page.

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403session_requiredAccount keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/threads/by-seen" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Read a thread

GET/v1/threads/{threadId}

Access any: any API key, or a console session.

One thread's summary. Its messages are at /v1/threads/{threadId}/messages.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.threads.get in TypeScript, client.threads.get in Python, the threads_get tool and doorman threads get on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Answers 200: The thread.

Response 200: Thread

A conversation: the messages that reply to each other, or share a subject and a participant.

  • idstringrequired

    A thread identifier. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m

  • inboxIdstringrequired

    An inbox identifier. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z

  • subjectstringrequired

    The subject of the first message. Example: Invoice 2847

  • participantsstring[]required

    Every address seen in the thread other than the inbox's own, sorted. Example: ["sam@example.com"]

  • messageCountintegerrequired

  • isReadbooleanrequired

    False until the thread is marked read or a reply is sent.

  • isSeenbooleanoptional

    Whether a person has looked at the thread in the console since mail last arrived in it. It is the console's own mark and says nothing about isRead, which is what an agent polls: a person looking at a thread does not mark it read. Older deployments omit it.

  • metadataMetadataoptional

  • labelsThreadLabelsoptional

  • riskLevel"low" | "medium" | "high" | "critical" | nulloptional

    The highest risk level among the thread's inbound messages that the owner has not marked safe; null when none was assessed. Older deployments omit it.

  • firstMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageIdstring | nullrequired

  • createdAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "subject": "Invoice 2847",
  "participants": [
    "sam@example.com"
  ],
  "messageCount": 1,
  "isRead": false,
  "metadata": {},
  "labels": [],
  "riskLevel": "low",
  "firstMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "createdAt": "2026-11-05T10:05:00.000Z"
}
curl -s "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Update a thread

PATCH/v1/threads/{threadId}

Access any: any API key, or a console session.

Sets read state, metadata or labels. Omitted fields stay unchanged; metadata and labels replace the whole value, with {} or [] clearing it. Sending a reply marks the thread read as well. Actual changes emit thread.updated.

OAuth: allowed with all of mail:write, mail:read. App permissions apply in addition to account and resource checks.

Also available as client.threads.update in TypeScript, client.threads.update in Python, the threads_update tool and doorman threads update on the command line.

Organizations: a member's console session needs mail:write and mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Request body (application/json): UpdateThread

Changes to the thread's read state, metadata or labels. Omitted fields stay as they are; metadata and labels replace the entire value.

Answers 200: The thread as it is now.

Response 200: Thread

A conversation: the messages that reply to each other, or share a subject and a participant.

  • idstringrequired

    A thread identifier. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m

  • inboxIdstringrequired

    An inbox identifier. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z

  • subjectstringrequired

    The subject of the first message. Example: Invoice 2847

  • participantsstring[]required

    Every address seen in the thread other than the inbox's own, sorted. Example: ["sam@example.com"]

  • messageCountintegerrequired

  • isReadbooleanrequired

    False until the thread is marked read or a reply is sent.

  • isSeenbooleanoptional

    Whether a person has looked at the thread in the console since mail last arrived in it. It is the console's own mark and says nothing about isRead, which is what an agent polls: a person looking at a thread does not mark it read. Older deployments omit it.

  • metadataMetadataoptional

  • labelsThreadLabelsoptional

  • riskLevel"low" | "medium" | "high" | "critical" | nulloptional

    The highest risk level among the thread's inbound messages that the owner has not marked safe; null when none was assessed. Older deployments omit it.

  • firstMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageIdstring | nullrequired

  • createdAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "subject": "Invoice 2847",
  "participants": [
    "sam@example.com"
  ],
  "messageCount": 1,
  "isRead": false,
  "metadata": {},
  "labels": [],
  "riskLevel": "low",
  "firstMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "createdAt": "2026-11-05T10:05:00.000Z"
}
curl -s -X PATCH "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "isRead": true
  }'

Trash a thread

DELETE/v1/threads/{threadId}

Access any: any API key, or a console session.

The thread and its messages leave every list and read, a reply to it answers 404 thread_not_found, and a later message in the same conversation starts a new thread. Where the deployment erases, it is erased 30 days later.

OAuth: allowed with all of mail:write, mail:read. App permissions apply in addition to account and resource checks.

Also available as client.threads.trash in TypeScript, client.threads.trash in Python, the threads_trash tool and doorman threads trash on the command line.

Organizations: a member's console session needs mail:write and mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Answers 204: Trashed.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s -X DELETE "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Restore a trashed thread

POST/v1/threads/{threadId}/restore

Access session: a console session only; an API key gets 403 session_required.

Takes a thread back out of the trash: it and its messages return to every list and read, and thread.updated says so. A thread that is not in the trash is answered as it is. Mail that was held, discarded or still waits for a scan is in the trash to keep it from agents and is not restored this way (404): only releasing held mail delivers it. A message that arrived in the same conversation while the thread was trashed started a thread of its own, and stays there.

OAuth: not available to delegated app tokens.

Also available as client.threads.restore in TypeScript and client.threads.restore in Python.

Organizations: a member's console session needs mail:write and mail:read. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Answers 200: The thread, out of the trash.

Response 200: Thread

A conversation: the messages that reply to each other, or share a subject and a participant.

  • idstringrequired

    A thread identifier. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m

  • inboxIdstringrequired

    An inbox identifier. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z

  • subjectstringrequired

    The subject of the first message. Example: Invoice 2847

  • participantsstring[]required

    Every address seen in the thread other than the inbox's own, sorted. Example: ["sam@example.com"]

  • messageCountintegerrequired

  • isReadbooleanrequired

    False until the thread is marked read or a reply is sent.

  • isSeenbooleanoptional

    Whether a person has looked at the thread in the console since mail last arrived in it. It is the console's own mark and says nothing about isRead, which is what an agent polls: a person looking at a thread does not mark it read. Older deployments omit it.

  • metadataMetadataoptional

  • labelsThreadLabelsoptional

  • riskLevel"low" | "medium" | "high" | "critical" | nulloptional

    The highest risk level among the thread's inbound messages that the owner has not marked safe; null when none was assessed. Older deployments omit it.

  • firstMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageIdstring | nullrequired

  • createdAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403session_requiredAccount keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "subject": "Invoice 2847",
  "participants": [
    "sam@example.com"
  ],
  "messageCount": 1,
  "isRead": false,
  "metadata": {},
  "labels": [],
  "riskLevel": "low",
  "firstMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "createdAt": "2026-11-05T10:05:00.000Z"
}
curl -s -X POST "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m/restore" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Mark a thread seen

PUT/v1/threads/{threadId}/seen

Access session: a console session only; an API key gets 403 session_required.

Records that a person looked at the thread in the console, or that they want it shown as new again. It moves isSeen and nothing else: isRead, which agents poll, stays as it is, and no event is emitted. Mail that arrives in the thread clears it.

OAuth: not available to delegated app tokens.

Also available as client.threads.seen in TypeScript and client.threads.seen in Python.

Organizations: a member's console session needs mail:read. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Request body (application/json): SetThreadSeen

Whether a person has looked at the thread: true once they opened it, false to show it as new again.

  • seenbooleanrequired

Answers 200: The thread as it is now.

Response 200: Thread

A conversation: the messages that reply to each other, or share a subject and a participant.

  • idstringrequired

    A thread identifier. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m

  • inboxIdstringrequired

    An inbox identifier. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z

  • subjectstringrequired

    The subject of the first message. Example: Invoice 2847

  • participantsstring[]required

    Every address seen in the thread other than the inbox's own, sorted. Example: ["sam@example.com"]

  • messageCountintegerrequired

  • isReadbooleanrequired

    False until the thread is marked read or a reply is sent.

  • isSeenbooleanoptional

    Whether a person has looked at the thread in the console since mail last arrived in it. It is the console's own mark and says nothing about isRead, which is what an agent polls: a person looking at a thread does not mark it read. Older deployments omit it.

  • metadataMetadataoptional

  • labelsThreadLabelsoptional

  • riskLevel"low" | "medium" | "high" | "critical" | nulloptional

    The highest risk level among the thread's inbound messages that the owner has not marked safe; null when none was assessed. Older deployments omit it.

  • firstMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

  • lastMessageIdstring | nullrequired

  • createdAtstring (date-time)required

    Example: 2026-11-05T10:05:00.000Z

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403session_requiredAccount keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "subject": "Invoice 2847",
  "participants": [
    "sam@example.com"
  ],
  "messageCount": 1,
  "isRead": false,
  "metadata": {},
  "labels": [],
  "riskLevel": "low",
  "firstMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "createdAt": "2026-11-05T10:05:00.000Z"
}
curl -s -X PUT "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m/seen" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "seen": true
  }'

Read a thread's messages

GET/v1/threads/{threadId}/messages

Access any: any API key, or a console session.

The thread and its messages in order, oldest first, each with its text, classification and attachments.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.threads.messages in TypeScript, client.threads.messages in Python, the threads_messages tool and doorman threads messages on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • threadIdstring, in pathrequired

    The thread. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m.

Answers 200: The thread and its messages.

Response 200: ThreadMessages

A thread with its messages in order.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/threads/thr_01jc5a1b2c3d4e5f6g7h8j9k0m/messages" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

List messages

GET/v1/inboxes/{inboxId}/messages

Access any: any API key, or a console session.

The inbox's messages across threads, newest first, inbound and outbound alike unless filtered. Messages in trashed threads are left out.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.inboxes.messages.list in TypeScript, client.inboxes.messages.list in Python, the inboxes_messages_list tool and doorman inboxes messages list on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • inboxIdstring, in pathrequired

    The inbox. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z.

  • direction"inbound" | "outbound", in queryoptional

    Only received or only sent messages.

  • limitinteger, in queryoptional

    Page size, 1 to 100. Defaults to 50.

  • offsetinteger, in queryoptional

    Rows to skip. Defaults to 0.

Answers 200: A page of messages.

Response 200: MessageList

A page of an inbox's messages, newest first.

  • dataMessage[]required

  • limitintegerrequired

    The page size that was applied.

  • offsetintegerrequired

    The offset that was applied.

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/messages" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Read a message

GET/v1/messages/{messageId}

Access any: any API key, or a console session.

One message with its text, headers, classification and attachments.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.messages.get in TypeScript, client.messages.get in Python, the messages_get tool and doorman messages get on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • messageIdstring, in pathrequired

    The message. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s.

Answers 200: The message.

Response 200: Message

One message, inbound or outbound, with its text, headers, classification and attachments.

  • idstringrequired

    A message identifier. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s

  • inboxIdstringrequired

    An inbox identifier. Example: inb_01jc4q7w9k2m5n8p3r6t1v4x7z

  • threadIdstringrequired

    A thread identifier. Example: thr_01jc5a1b2c3d4e5f6g7h8j9k0m

  • direction"inbound" | "outbound"required

  • rfcMessageIdstring | nullrequired

    The Message-ID header of inbound mail; null for mail this API sent. Example: <a1b2c3@example.com>

  • inReplyTostring | nullrequired

    The In-Reply-To header, when the message is a reply.

  • referencesstring[]required

    The References chain, oldest first.

  • fromNamedAddressrequired

  • toNamedAddress[]required

  • ccNamedAddress[]required

  • bccNamedAddress[]required

    Only outbound mail carries blind copies.

  • replyTostring | nullrequired

    The Reply-To address, when one was given.

  • deliveryRole"to" | "cc" | "bcc" | nullrequired

    How the inbox received the message: as a to, cc or bcc recipient. Null for outbound mail.

  • subjectstringrequired

    Example: Invoice 2847

  • textstring | nullrequired

    The plain-text body, or text derived from the HTML when there was none.

  • hasHtmlbooleanrequired

    Whether an HTML body is stored; read it at /v1/messages/{messageId}/html.

  • rawUrlstring | nullrequired

    Where to download the original message/rfc822; null for outbound mail.

  • sizeBytesintegerrequired

  • category"personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious"required

    What kind of mail this is; ordinary outbound mail is personal and rule-generated mail is automated.

  • autoReplyablebooleanrequired

    False for anything an agent should not answer on its own.

  • verdict"clean" | "unverified" | "suspicious" | nullrequired

    From the authentication results; null for outbound mail.

  • spamScorenumber | nullrequired

    How likely the message is junk, from 0 to 1, when it was assessed; null otherwise.

  • authenticationAuthenticationResults | nullrequired

  • serviceMessageService | nulloptional

    The outside service the message came from, for the inbox's passport; null for any other mail and for outbound mail. Older deployments omit it.

  • riskRiskAssessment | nulloptional

    Doorman's assessment of an inbound message (ADR-019). Null for outbound mail and for mail that was not assessed. Older deployments omit it.

  • redactionRedactionoptional

    What the account's healthcare guardrails found in the message (ADR-027), and whether subject, text and the attachments' parsedText carry placeholders in place of it. Absent where no guardrail applies.

  • occurredAtstring (date-time)required

    When the message arrived or was sent. Example: 2026-11-05T10:05:00.000Z

  • attachmentsAttachment[]required

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "direction": "inbound",
  "rfcMessageId": "<a1b2c3@example.com>",
  "inReplyTo": null,
  "references": [],
  "from": {
    "address": "sam@example.com",
    "name": "Sam Rivera"
  },
  "to": [
    {
      "address": "concierge@doorman.example",
      "name": null
    }
  ],
  "cc": [],
  "bcc": [],
  "replyTo": null,
  "deliveryRole": "to",
  "subject": "Invoice 2847",
  "text": "Hi, invoice 2847 is attached.",
  "hasHtml": true,
  "rawUrl": "https://api.doorman.example/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/raw",
  "sizeBytes": 48120,
  "category": "personal",
  "autoReplyable": true,
  "verdict": "clean",
  "spamScore": 0.02,
  "authentication": {
    "spf": "pass",
    "dkim": "pass",
    "dmarc": "pass"
  },
  "risk": {
    "score": 6,
    "level": "low",
    "labels": [],
    "reasons": [],
    "sender": {
      "standing": "known",
      "authenticated": true
    },
    "action": "delivered",
    "analysis": "full",
    "review": null
  },
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "attachments": [
    {
      "filename": "invoice.pdf",
      "contentType": "application/pdf",
      "sizeBytes": 45000,
      "url": "https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf",
      "parsedText": "Invoice 2847. Line 3: Setup fee, billed twice. Total 1,480.",
      "extractionMethod": "pdf"
    }
  ]
}
curl -s "https://api.doorman.fyi/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Download the original message

GET/v1/messages/{messageId}/raw

Access any: any API key, or a console session.

The message as it arrived, message/rfc822. Outbound messages have no raw copy and answer 404. One with a malicious attachment is served to a console session only (403 risk_blocked otherwise).

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.messages.raw in TypeScript, client.messages.raw in Python and doorman messages raw on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • messageIdstring, in pathrequired

    The message. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s.

Answers 200 as message/rfc822: The original message.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403risk_blockedThe send or the download was refused; guard says why: reply when the thread holds a flagged message whose sender is not trusted, recipient when a recipient is not one the inbox knows, content when an attachment did not pass the check of its bytes (reasons lists what was found), guardrail when a healthcare guardrail found what may not be sent (entities lists the kinds). For reply and recipient a person can send from the console, mark the message safe or trust the sender. For content, a program or a file dressed as another kind is refused for every caller; a locked or damaged file, a script, or a document with macros, is refused for keys and app tokens only. A link that delivered harmful software when it was opened in isolation is refused for every caller.
403guardrail_blockedA healthcare guardrail keeps this content from keys and apps: the original message, its HTML body or an attachment's bytes carry what the account's guardrails redact, and bytes cannot be redacted. entities lists the kinds that were found, never the text. The message's text is available with the findings replaced; a person with phi:read reads the original in the console.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/raw" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -o downloaded.bin

Read the HTML body

GET/v1/messages/{messageId}/html

Access any: any API key, or a console session.

The stored HTML body, served as text/html under cache-control: private, no-store, x-content-type-options: nosniff and a content security policy that allows images and inline styles only, under sandbox. 404 when the message has no HTML body.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.messages.html in TypeScript, client.messages.html in Python and doorman messages html on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • messageIdstring, in pathrequired

    The message. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s.

Answers 200 as text/html: The HTML body.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403guardrail_blockedA healthcare guardrail keeps this content from keys and apps: the original message, its HTML body or an attachment's bytes carry what the account's guardrails redact, and bytes cannot be redacted. entities lists the kinds that were found, never the text. The message's text is available with the findings replaced; a person with phi:read reads the original in the console.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/html" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Download an attachment

GET/v1/attachments/{messageId}/{filename}

Access any: any API key, or a console session.

The attachment's bytes, served with the attachment's own content type as a download. A malicious attachment is served to a console session only (403 risk_blocked otherwise).

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.attachments.download in TypeScript, client.attachments.download in Python and doorman attachments download on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • messageIdstring, in pathrequired

    The message. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s.

  • filenamestring, in pathrequired

    The attachment's file name, as the message lists it. Example: invoice.pdf.

Answers 200 as */*: The bytes, with the attachment's content type.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403risk_blockedThe send or the download was refused; guard says why: reply when the thread holds a flagged message whose sender is not trusted, recipient when a recipient is not one the inbox knows, content when an attachment did not pass the check of its bytes (reasons lists what was found), guardrail when a healthcare guardrail found what may not be sent (entities lists the kinds). For reply and recipient a person can send from the console, mark the message safe or trust the sender. For content, a program or a file dressed as another kind is refused for every caller; a locked or damaged file, a script, or a document with macros, is refused for keys and app tokens only. A link that delivered harmful software when it was opened in isolation is refused for every caller.
403guardrail_blockedA healthcare guardrail keeps this content from keys and apps: the original message, its HTML body or an attachment's bytes carry what the account's guardrails redact, and bytes cannot be redacted. entities lists the kinds that were found, never the text. The message's text is available with the findings replaced; a person with phi:read reads the original in the console.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -o downloaded.bin

Read an attachment's text

GET/v1/attachments/{messageId}/{filename}/text

Access any: any API key, or a console session.

The extracted text and how it was obtained, or why it was not.

OAuth: allowed with all of mail:read. App permissions apply in addition to account and resource checks.

Also available as client.attachments.text in TypeScript, client.attachments.text in Python, the attachments_text tool and doorman attachments text on the command line.

Organizations: a member's console session needs mail:read. API keys and app tokens are not held to member permissions. See Roles and permissions.

Parameters
  • messageIdstring, in pathrequired

    The message. Example: msg_01jc5a6g7h8j9k0m1n2p3q4r5s.

  • filenamestring, in pathrequired

    The attachment's file name, as the message lists it. Example: invoice.pdf.

Answers 200: The text.

Response 200: AttachmentText

The extracted text of an attachment and how it was obtained.

  • filenamestringrequired

  • contentTypestringrequired

  • extractionMethod"text" | "csv" | "pdf" | "ocr" | "office" | "unsupported" | "skipped" | "skipped_too_large" | "unavailable" | "timeout" | "pdf_error" | "ocr_error" | "office_error" | "html_error"required

  • textstring | nullrequired

    The text, or null when nothing was extracted; extractionMethod says why.

Errors
StatusErrorMeaning
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403risk_blockedThe send or the download was refused; guard says why: reply when the thread holds a flagged message whose sender is not trusted, recipient when a recipient is not one the inbox knows, content when an attachment did not pass the check of its bytes (reasons lists what was found), guardrail when a healthcare guardrail found what may not be sent (entities lists the kinds). For reply and recipient a person can send from the console, mark the message safe or trust the sender. For content, a program or a file dressed as another kind is refused for every caller; a locked or damaged file, a script, or a document with macros, is refused for keys and app tokens only. A link that delivered harmful software when it was opened in isolation is refused for every caller.
403insufficient_scopeThe app's token lacks a required scope, or the operation cannot be delegated.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403permission_deniedThe signed-in member's role in the organization lacks a permission the operation needs; permission names it. An admin of the organization can do it, or change the member's role.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
404not_foundNo such resource for this caller, or no such route.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
500internal_errorSomething went wrong on the server.

Example 200 response

{
  "filename": "invoice.pdf",
  "contentType": "application/pdf",
  "extractionMethod": "pdf",
  "text": "Invoice 2847. Total 1,480."
}
curl -s "https://api.doorman.fyi/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf/text" \
  -H "authorization: Bearer $DOORMAN_API_KEY"

Up Down to move, Enter to open, Esc to close