CLI: Mail

The commands of the doorman command line under Mail. Threads, messages, raw and HTML bodies, attachments and their extracted text.

doorman inboxes threads list

Command

doorman inboxes threads list <inboxId> [flags]

Sends inboxes.threads.list: GET /v1/inboxes/{inboxId}/threads

List threads. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --inbox-idstringoptional

    The same as the argument <inboxId>, for a script that names everything.

  • --is-read"true" | "false"optional

    Only read or only unread threads.

  • --qstringoptional

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

  • --labelstringoptional

    Only threads containing this exact, case-sensitive label.

  • --limitintegeroptional

    Page size, 1 to 100. Defaults to 50.

  • --offsetintegeroptional

    Rows to skip. Defaults to 0.

Example

doorman inboxes threads list inb_01jc4q7w9k2m5n8p3r6t1v4x7z

doorman threads get

Command

doorman threads get <threadId> [flags]

Sends threads.get: GET /v1/threads/{threadId}

Read a thread. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --thread-idstringoptional

    The same as the argument <threadId>, for a script that names everything.

Example

doorman threads get thr_01jc5a1b2c3d4e5f6g7h8j9k0m

doorman threads update

Command

doorman threads update <threadId> [flags]

Sends threads.update: PATCH /v1/threads/{threadId}

Update a thread. Access any: any API key, or a console session. An app token needs mail:write and mail:read.

Flags
  • --thread-idstringoptional

    The same as the argument <threadId>, for a script that names everything.

  • --is-readbooleanoptional

  • --metadataobject of string | number | boolean | nulloptional

    Extension state: at most 20 keys and 2048 bytes of UTF-8 JSON. Keys are 1 to 64 ASCII letters, digits, underscores, dots, colons or hyphens, starting with a letter or digit. Values are strings, finite numbers, booleans or null. Replaced as a whole; {} clears it. Do not store secrets.

  • --labelsstring[]optional

    At most 20 unique labels. Replaced as a whole; [] clears the labels.

  • --jsonobjectoptional

    The request body as one JSON object. A flag given beside it replaces the field of the same name.

Example

doorman threads update thr_01jc5a1b2c3d4e5f6g7h8j9k0m \
  --is-read true

doorman threads trash

Command

doorman threads trash <threadId> [flags]

Sends threads.trash: DELETE /v1/threads/{threadId}

Trash a thread. Access any: any API key, or a console session. An app token needs mail:write and mail:read.

Flags
  • --thread-idstringoptional

    The same as the argument <threadId>, for a script that names everything.

Example

doorman threads trash thr_01jc5a1b2c3d4e5f6g7h8j9k0m

doorman threads messages

Command

doorman threads messages <threadId> [flags]

Sends threads.messages: GET /v1/threads/{threadId}/messages

Read a thread's messages. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --thread-idstringoptional

    The same as the argument <threadId>, for a script that names everything.

Example

doorman threads messages thr_01jc5a1b2c3d4e5f6g7h8j9k0m

doorman inboxes messages list

Command

doorman inboxes messages list <inboxId> [flags]

Sends inboxes.messages.list: GET /v1/inboxes/{inboxId}/messages

List messages. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --inbox-idstringoptional

    The same as the argument <inboxId>, for a script that names everything.

  • --direction"inbound" | "outbound"optional

    Only received or only sent messages.

  • --limitintegeroptional

    Page size, 1 to 100. Defaults to 50.

  • --offsetintegeroptional

    Rows to skip. Defaults to 0.

Example

doorman inboxes messages list inb_01jc4q7w9k2m5n8p3r6t1v4x7z

doorman messages get

Command

doorman messages get <messageId> [flags]

Sends messages.get: GET /v1/messages/{messageId}

Read a message. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --message-idstringoptional

    The same as the argument <messageId>, for a script that names everything.

Example

doorman messages get msg_01jc5a6g7h8j9k0m1n2p3q4r5s

doorman messages raw

Command

doorman messages raw <messageId> [flags]

Sends messages.raw: GET /v1/messages/{messageId}/raw

Download the original message. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --message-idstringoptional

    The same as the argument <messageId>, for a script that names everything.

  • --outpathoptional

    Write the answer to this file instead of standard output.

Example

doorman messages raw msg_01jc5a6g7h8j9k0m1n2p3q4r5s

doorman messages html

Command

doorman messages html <messageId> [flags]

Sends messages.html: GET /v1/messages/{messageId}/html

Read the HTML body. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --message-idstringoptional

    The same as the argument <messageId>, for a script that names everything.

  • --outpathoptional

    Write the answer to this file instead of standard output.

Example

doorman messages html msg_01jc5a6g7h8j9k0m1n2p3q4r5s

doorman attachments download

Command

doorman attachments download <messageId> <filename> [flags]

Sends attachments.download: GET /v1/attachments/{messageId}/{filename}

Download an attachment. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --message-idstringoptional

    The same as the argument <messageId>, for a script that names everything.

  • --filenamestringoptional

    The same as the argument <filename>, for a script that names everything.

  • --outpathoptional

    Write the answer to this file instead of standard output.

Example

doorman attachments download msg_01jc5a6g7h8j9k0m1n2p3q4r5s invoice.pdf

doorman attachments text

Command

doorman attachments text <messageId> <filename> [flags]

Sends attachments.text: GET /v1/attachments/{messageId}/{filename}/text

Read an attachment's text. Access any: any API key, or a console session. An app token needs mail:read.

Flags
  • --message-idstringoptional

    The same as the argument <messageId>, for a script that names everything.

  • --filenamestringoptional

    The same as the argument <filename>, for a script that names everything.

Example

doorman attachments text msg_01jc5a6g7h8j9k0m1n2p3q4r5s invoice.pdf

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