---
title: "CLI: Sending"
description: "The commands of the doorman command line under Sending. New messages and replies from an inbox, with idempotent retries."
url: https://doorman.fyi/docs/cli/commands/sending
markdown: https://doorman.fyi/docs/cli/commands/sending.md
area: "SDKs and tools"
section: "Command line"
---

# CLI: Sending

The commands of the doorman command line under Sending. New messages and replies from an inbox, with idempotent retries.

Source: https://doorman.fyi/docs/cli/commands/sending

## doorman inboxes send

Command:
```sh
doorman inboxes send <inboxId> [flags]
```

Operation [`inboxes.send`](https://doorman.fyi/docs/reference/sending.md#inboxes-send): `POST /v1/inboxes/{inboxId}/send`

Send a message or reply. Access `any`: any API key, or a console session. An app token needs `mail:send` and `mail:read`.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--idempotency-key` | `string` | no | 1 to 255 printable ASCII characters. For 24 hours the same key with the same request replays the original answer with `Idempotent-Replayed: true`; the same key with a different request is refused with 422 `idempotency_key_reused`; a key whose first attempt is still running answers 409 `idempotency_in_progress`; a failed send releases the key. |
| `--to` | `string \| string[]` | no | Recipients. Optional on a reply, where it defaults to the last inbound message's Reply-To or sender. |
| `--cc` | `string \| string[]` | no |  |
| `--bcc` | `string \| string[]` | no |  |
| `--reply-to` | `string` | no | The address replies should go to instead of the inbox. |
| `--subject` | `string` | no | Required on a new message. A reply defaults to `Re: <thread subject>`. |
| `--text` | `string` | no | The plain-text body. |
| `--html` | `string` | no | The HTML body. Text is derived from it when `text` is absent. |
| `--body` | `string` | no | A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when `text` or `html` is given. |
| `--thread-id` | `string` | no | A thread id (thr_...). Makes the message a reply in this thread: threading headers, the default subject and recipient, and the quoted previous message come from it. An unknown, foreign or trashed thread answers 404 `thread_not_found`. |
| `--include-quote` | `boolean` | no | On a reply, quote the previous message under the text. Defaults to true. |
| `--attachments` | `object[]` | no |  |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman inboxes send inb_01jc4q7w9k2m5n8p3r6t1v4x7z \
  --to sam@example.com \
  --subject Thursday \
  --text 'Thursday works.'
```

## doorman inboxes drafts create

Command:
```sh
doorman inboxes drafts create <inboxId> [flags]
```

Operation [`inboxes.drafts.create`](https://doorman.fyi/docs/reference/sending.md#inboxes-drafts-create): `POST /v1/inboxes/{inboxId}/drafts`

Write a draft for the owner to send. Access `key`: an API key, or a correctly scoped app token where delegated access is allowed; console sessions are refused. An app token needs `mail:draft` and `mail:read`.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--inbox-id` | `string` | no | The same as the argument `<inboxId>`, for a script that names everything. |
| `--to` | `string \| string[]` | no | Recipients. Optional on a reply, where it defaults to the last inbound message's Reply-To or sender. |
| `--cc` | `string \| string[]` | no |  |
| `--bcc` | `string \| string[]` | no |  |
| `--reply-to` | `string` | no | The address replies should go to instead of the inbox. |
| `--subject` | `string` | no | Required on a new message. A reply defaults to `Re: <thread subject>`. |
| `--text` | `string` | no | The plain-text body. |
| `--html` | `string` | no | The HTML body. Text is derived from it when `text` is absent. |
| `--body` | `string` | no | A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when `text` or `html` is given. |
| `--thread-id` | `string` | no | A thread id (thr_...). Makes the message a reply in this thread: threading headers, the default subject and recipient, and the quoted previous message come from it. An unknown, foreign or trashed thread answers 404 `thread_not_found`. |
| `--include-quote` | `boolean` | no | On a reply, quote the previous message under the text. Defaults to true. |
| `--attachments` | `object[]` | no |  |
| `--json` | `object` | no | The request body as one JSON object. A flag given beside it replaces the field of the same name. |

Example:
```sh
doorman inboxes drafts create inb_01jc4q7w9k2m5n8p3r6t1v4x7z \
  --to sam@example.com \
  --subject Thursday \
  --text 'Thursday works.'
```

## doorman drafts delete

Command:
```sh
doorman drafts delete <heldSendId> [flags]
```

Operation [`drafts.delete`](https://doorman.fyi/docs/reference/sending.md#drafts-delete): `DELETE /v1/drafts/{heldSendId}`

Take a draft back. Access `key`: an API key, or a correctly scoped app token where delegated access is allowed; console sessions are refused. An app token needs `mail:draft`.

**Flags**

| Flag | Type | Required | Description |
| --- | --- | --- | --- |
| `--held-send-id` | `string` | no | The same as the argument `<heldSendId>`, for a script that names everything. |

Example:
```sh
doorman drafts delete hsd_01jc5f1a2b3c4d5e6f7g8h9j0k
```
