# MAX messenger CLI bot commands (/en/docs/max/commands-bot)

This reference covers bot commands and the Bot API. Use it to look up authentication, messages, events and method parameters for the bot you control.

Bot connection, messages, updates and the full Bot API.

## Global options [#global-options]

Apply to every command.

| Option | Purpose |
|---|---|
| `-V, --version` | output the version number. |
| `-v, --verbose` | more detail in what is shown: -v ids, -vv everything we know. Default: `0`. |
| `--json` | machine-readable output: one JSON value on stdout; --json=id,text keeps only those fields. |
| `--jsonl` | machine-readable output: one JSON object per line, for streaming and jq. |
| `--quiet` | diagnostics off. |
| `--trace` | one line per request on stderr: ids and timings, never message content. |
| `--debug` | on a failure, its whole record — cause and stack — in place of the short line. |
| `--timeout <duration>` | give up on the whole command after this — 30s, 2m, 500ms. |
| `--offline` | answer from what was recorded and never connect; fails if nothing was. |
| `--no-input` | never prompt or open interactive login; piped input remains available. |
| `--max-input-bytes <bytes>` | maximum buffered input bytes (default: 16777216). |
| `--max-output-bytes <bytes>` | maximum machine output bytes (default: 4194304; 0 disables). |
| `--brief` | found messages as reference, title, time, sender and excerpt only. |
| `--full` | found messages with their whole text and every provider field. |
| `--compact` | one line per item for an agent: reference first, text last, paging and next steps as # lines. |
| `--dry-run` | preview parsed arguments and permissions before running the action. |
| `--yes` | go ahead without the question an ask level puts before a write. |
| `--record` | keep this run under `max runs`, with the command as typed and secrets hidden; record_input false leaves the typed words out. |
| `--no-record` | do not keep this run, even if it fails. |
| `--serve` | start `max serve` in the background if it is not running (the default). |
| `--no-serve` | do not start it; log in on this command's own connection unless one is running. |

## Commands [#commands]

## `max bot` [#max-bot]

a MAX bot, through the official Bot API and a bot token — not your personal account

### `max bot auth` [#max-bot-auth]

the bot token this profile uses

#### `max bot auth set` [#max-bot-auth-set]

check a bot token with MAX, then keep it — typed at a hidden prompt or piped on stdin

**Changes something only on this computer.**

```sh
max bot auth set
```

**Returns:** check a bot token, then keep it; or keep a named secret beside it

**Example:** `max sales bot auth set`

#### `max bot auth show` [#max-bot-auth-show]

where this profile's bot token comes from, and which bot it is

```sh
max bot auth show
```

**Returns:** where this profile's bot token comes from, and which bot it is

**Example:** `max sales bot auth show`

#### `max bot auth remove` [#max-bot-auth-remove]

forget this profile's bot token

**Changes something only on this computer.**

```sh
max bot auth remove
```

**Returns:** forget this profile's bot token

**Example:** `max sales bot auth remove`

### `max bot list` [#max-bot-list]

every name on this machine that has a bot token; --check asks MAX which bot each is

```sh
max bot list [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--check` | ask the messenger who each bot is, with its token. |

**Returns:** bot profile — name, token, bot, id, problem; every field: max commands info bot list

**Example:** `max personal bot list`, `max personal bot list --check`

### `max bot chats` [#max-bot-chats]

the chats this bot is in — MAX gives a bot no list of them, so `list` shows the ones it has seen

#### `max bot chats list` [#max-bot-chats-list]

chats this bot has seen on this machine — not a complete list from MAX

```sh
max bot chats list [query]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms that narrow the list — the fields are below. |

**Returns:** bot seen chat — id, title, kind, unread_count, unread_mentions, last_message_at, participants_count, muted, and 9 more; every field: max commands info bot chats list

**Example:** `max sales bot chats list`

#### `max bot chats show` [#max-bot-chats-show]

one chat from MAX, and remember it

```sh
max bot chats show <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |

**Returns:** one chat from MAX, and remember it

**Example:** `max sales bot chats show Team`

#### `max bot chats leave` [#max-bot-chats-leave]

take the bot out of a chat; only an admin of the chat can bring it back

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats leave <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |

**Returns:** take the bot out of a chat; only an admin of the chat can bring it back

**Example:** `max sales bot chats leave Team`

#### `max bot chats action` [#max-bot-chats-action]

show what the bot is doing in a chat — typing, sending a photo — for a few seconds

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats action <chat> <action>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `action` | required | what the chat sees. One of: `typing`, `photo`, `video`, `voice`, `file`. |

**Returns:** show what the bot is doing in a chat, for a few seconds

**Example:** `max sales bot chats action Team typing`

#### `max bot chats admins` [#max-bot-chats-admins]

the admins of a chat the bot is an admin in

#### `max bot chats admins list` [#max-bot-chats-admins-list]

the chat's admins and what each may do

```sh
max bot chats admins list <chat> [query]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |
| `query` | optional | field:value terms; this list filters by none yet. |

**Returns:** bot admin — id, name, username, role, rights, title; every field: max commands info bot chats admins list

**Example:** `max sales bot chats admins list Team`

#### `max bot chats admins add` [#max-bot-chats-admins-add]

make a member an admin with these rights

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats admins add <chat> <person> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |
| `person` | required | the person's user id. |

| Option | Purpose |
|---|---|
| `--can <rights>` | what they may do, comma-separated: read, members, admins, info, pin, link, edit, delete. |
| `--title <title>` | the title shown beside their name. |

**Returns:** make a member an admin with these rights

**Example:** `max sales bot chats admins add Team 42 --title Helper`

#### `max bot chats admins remove` [#max-bot-chats-admins-remove]

take an admin's rights back; they stay a member

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats admins remove <chat> <person>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |
| `person` | required | the person's user id. |

**Returns:** take an admin's rights back; they stay a member

**Example:** `max sales bot chats admins remove Team 42`

#### `max bot chats members` [#max-bot-chats-members]

the people in a chat the bot is an admin in

#### `max bot chats members remove` [#max-bot-chats-members-remove]

take a person out of a chat; their messages stay

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats members remove <chat> <person> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |
| `person` | required | the person's user id. |

| Option | Purpose |
|---|---|
| `--block` | also keep them from coming back by the chat's link. |

**Returns:** take a person out of a chat; their messages stay

**Example:** `max sales bot chats members remove Team 42 --block`

#### `max bot chats members list` [#max-bot-chats-members-list]

members of a chat, a page at a time — --cursor takes the `page.next_cursor` the last page gave

```sh
max bot chats members list <chat> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--limit <n>` | how many, up to 100. |
| `--cursor <cursor>` | continue from here. |

**Returns:** max bot member — user_id, first_name, last_name, username, is_owner, is_admin; every field: max commands info bot chats members list

**Example:** `max personal bot chats members list Team`

#### `max bot chats members add` [#max-bot-chats-members-add]

add people to a chat by user id, at most 100; the bot must be an admin that may add members

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats members add <chat> <users>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | |
| `users` | required | |

**Returns:** add people to a chat by user id, at most 100; the bot must be an admin that may add…

**Example:** `max personal bot chats members add Team <users>`

#### `max bot chats rules` [#max-bot-chats-rules]

a chat's moderation rules for this bot, kept on this machine

#### `max bot chats rules show` [#max-bot-chats-rules-show]

the chat's rules; the defaults, marked not saved, if it has none yet

```sh
max bot chats rules show <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a group's id, or the title of a group this bot has seen. |

**Returns:** the chat's rules; the defaults, marked not saved, if it has none yet

**Example:** `max sales bot chats rules show Team`

#### `max bot chats rules set` [#max-bot-chats-rules-set]

change one rule — trusted, blocked, blockedNames, links, invites, forwards, blockedPeople, flood.messages, flood.minutes, flood.action, newAccount.days, newAccount.action, consent.delete, consent.remove

**Changes something only on this computer.**

```sh
max bot chats rules set <chat> <key> <value>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a group's id, or the title of a group this bot has seen. |
| `key` | required | the rule. |
| `value` | required | its new value. |

**Returns:** change one moderation rule of a chat

**Example:** `max sales bot chats rules set Team links delete`

#### `max bot chats rules unset` [#max-bot-chats-rules-unset]

put one rule back to its default

**Changes something only on this computer.**

```sh
max bot chats rules unset <chat> <key>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a group's id, or the title of a group this bot has seen. |
| `key` | required | the rule. |

**Returns:** put one rule back to its default

**Example:** `max sales bot chats rules unset Team links`

#### `max bot chats moderate` [#max-bot-chats-moderate]

judge a group's new messages and joins by its rules, and act as they allow — as the bot

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot chats moderate <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a group's id, or the title of a group this bot has seen. |

| Option | Purpose |
|---|---|
| `--since-time <time>` | judge what came after this ISO 8601 time, or 2h / 1d ago; the saved point stays. |
| `--dry-run` | judge and plan; do nothing. |
| `--allow-dangerous` | yes to every action whose level in the group's rules is ask. |
| `--no-block` | remove without banning; by default a removed person cannot come back by the link. |
| `--max-actions <n>` | at most this many actions in one run; 10 if not given. |

**Returns:** act on a group's new messages and joins by its rules, as the bot

**Example:** `max sales bot chats moderate Team --dry-run`

### `max bot messages` [#max-bot-messages]

the messages in the chats this bot is in

#### `max bot messages send` [#max-bot-messages-send]

send a message as the bot; without [text], the text is read from stdin

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot messages send <chat> [text] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `text` | optional | the message. |

| Option | Purpose |
|---|---|
| `--reply-to <message>` | answer this message, by its id in the same chat. |
| `--silent` | deliver without a notification. |
| `--md` | read this messenger's Markdown; see its formatting guide for supported syntax. |
| `--html` | the text is HTML: <b>, <i>, <a href>, <code>. |
| `--button <text=data>` | an inline button, as <text>=<data>; repeat for more in one row; the data (1 to 64 bytes) goes back to the bot. |
| `--file <file>` | attach a file; the text becomes its caption. |
| `--photo <file>` | attach a .jpg, .png or .webp as a photo; the text becomes its caption. |
| `--as-file` | send the --file as a file to download, a video included. |
| `--voice <file>` | send an Ogg Opus file as a voice message, alone, with no text. |
| `--allow-any-file` | send a file even from credential folders or this CLI's own folders. |

**Returns:** send a message as the bot; without [text], the text is read from stdin

**Example:** `max sales bot messages send Team "Doors open at 9"`, `max sales bot messages send Team "Here it is" --file report.pdf`

#### `max bot messages list` [#max-bot-messages-list]

the latest messages in a chat; where MAX gives a bot no history, and with --offline, the ones this bot has seen on this machine

```sh
max bot messages list <chat> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--limit <n>` | how many, the newest. |

**Returns:** message — ref, id, chat_id, sender_id, sender_name, sender_is_me, timestamp, edited_at, and 31 more; every field: max commands info bot messages list

**Next usually:** `max messages links <chat> <message>`, `max messages transcribe <chat> <message>`, `max bot messages show <chat> <message>`

**Example:** `max sales bot messages list Team --limit 20`

#### `max bot messages show` [#max-bot-messages-show]

one message by its id in a chat

```sh
max bot messages show <chat> <message>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `message` | required | message id. |

**Returns:** one message by its id in a chat

**Example:** `max sales bot messages show Team 101`

#### `max bot messages edit` [#max-bot-messages-edit]

replace the text of a message the bot sent; --button replaces its buttons, --no-buttons takes them off

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot messages edit <chat> <message> <text> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `message` | required | message id. |
| `text` | required | the new text. |

| Option | Purpose |
|---|---|
| `--md` | read this messenger's Markdown; see its formatting guide for supported syntax. |
| `--html` | the text is HTML: <b>, <i>, <a href>, <code>. |
| `--button <text=data>` | a button under the message, as <text>=<data>; replaces its buttons; repeat for more in one row. |
| `--no-buttons` | take the buttons off the message. |

**Returns:** replace the text or buttons of a message the bot sent

**Example:** `max sales bot messages edit Team 101 "Doors open at 10"`

#### `max bot messages delete` [#max-bot-messages-delete]

delete messages in a chat the bot can delete in; it cannot be undone

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot messages delete <chat> <messages> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `messages` | required | message ids. |

| Option | Purpose |
|---|---|
| `--allow-dangerous` | delete without asking. |

**Returns:** delete messages in a chat the bot can delete in; it cannot be undone

**Example:** `max sales bot messages delete Team 101`

#### `max bot messages pin` [#max-bot-messages-pin]

pin a message in a chat; quietly unless --notify

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot messages pin <chat> <message> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `message` | required | message id. |

| Option | Purpose |
|---|---|
| `--notify` | tell the chat's members. |

**Returns:** pin a message in a chat; quietly unless --notify

**Example:** `max sales bot messages pin Team 101`

#### `max bot messages unpin` [#max-bot-messages-unpin]

unpin a message in a chat

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot messages unpin <chat> <message>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, user:<id> for a person, or the title of a chat this bot has seen. |
| `message` | required | message id. |

**Returns:** unpin a message in a chat

**Example:** `max sales bot messages unpin Team 101`

#### `max bot messages between` [#max-bot-messages-between]

what two or more people wrote in the chats they have all written in — from the local copy, grouped by chat, oldest first; --limit counts per chat. Common chats are the ones this copy saw each of them write in, not a member list from MAX

```sh
max bot messages between <people> [options]
```

| Argument | | Meaning |
|---|---|---|
| `people` | required | two or more people — an id, @username or part of a name each. |

| Option | Purpose |
|---|---|
| `--all-bots` | also read every other bot's copy on this machine that read_other_bots allows. |
| `--bots <profiles>` | also read these bots' copies, comma separated — each allowed by read_other_bots. |
| `--limit <n>` | how many of the latest messages from each chat. |

**Returns:** what two or more people wrote in the chats they share, from the local copy

**Example:** `max sales bot messages between @ann @bob`

#### `max bot messages sync` [#max-bot-messages-sync]

fetch a chat's history into the bot's local copy, newest first; run it again to continue

**Changes something only on this computer.**

```sh
max bot messages sync <chat> [options]
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, or the title of a chat this bot has seen. |

| Option | Purpose |
|---|---|
| `--limit <n>` | at most this many messages in this run; 1000 if not given. |
| `--page-size <n>` | how many messages one request asks for; 100 if not given. |
| `--pause <duration>` | pause between pages, to stay under the messenger's limits. Default: `1s`. |
| `--since-time <time>` | stop once it reaches messages older than this: ISO 8601, or 2h / 1d ago. |
| `--last <n>` | stop once the newest n messages are held. |

**Returns:** fetch a chat's history into the bot's local copy, newest first; run it again…

**Example:** `max personal bot messages sync Team`

### `max bot search` [#max-bot-search]

find what this bot's local copy holds, by text

#### `max bot search messages` [#max-bot-search-messages]

search the messages this bot has read, sent or received on this machine — the local copy only, best match first; a Lucene query: every word must appear; "a phrase", -word, a OR b, from: chat: date: has:; by text, by --from, or both

```sh
max bot search messages [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | the words to find. |

| Option | Purpose |
|---|---|
| `--all-bots` | also read every other bot's copy on this machine that read_other_bots allows. |
| `--bots <profiles>` | also read these bots' copies, comma separated — each allowed by read_other_bots. |
| `--limit <n>` | how many. |
| `--page <n>` | which page, starting at 1. |
| `--newest` | newest first instead of best first. |
| `--from <person>` | only what this person wrote — an id, @username or part of a name; repeat it for any of several. |

**Returns:** search the messages this bot has seen, in the local copy, by text

**Example:** `max sales bot search messages refund`, `max sales bot search messages invoice --from @ann`

### `max bot recipients` [#max-bot-recipients]

the chats this bot may write to; with no list, every chat — `clear` removes the list

#### `max bot recipients list` [#max-bot-recipients-list]

the chats on the list, or nothing when there is no list

```sh
max bot recipients list [query]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms that narrow the list — the fields are below. |

**Returns:** recipient — id, title, added_at, partner_id; every field: max commands info bot recipients list

**Example:** `max sales bot recipients list`

#### `max bot recipients add` [#max-bot-recipients-add]

allow a chat: its id, `user:<id>`, or the title of a chat this bot has seen

**Changes something only on this computer.**

```sh
max bot recipients add <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | a chat id, `user:<id>`, or the title of a chat this bot has seen. |

**Returns:** allow a chat: its id, `user:<id>`, or the title of a chat this bot has seen

**Example:** `max sales bot recipients add Team`

#### `max bot recipients remove` [#max-bot-recipients-remove]

take a chat off the list

**Changes something only on this computer.**

```sh
max bot recipients remove <chat>
```

| Argument | | Meaning |
|---|---|---|
| `chat` | required | the chat id, or the title as the list shows it. |

**Returns:** take a chat off the list

**Example:** `max sales bot recipients remove Team`

#### `max bot recipients clear` [#max-bot-recipients-clear]

remove the list: the bot may write to any chat again

**Changes something only on this computer.**

```sh
max bot recipients clear
```

**Returns:** remove the list: the bot may write to any chat again

**Example:** `max sales bot recipients clear`

### `max bot sends` [#max-bot-sends]

what this bot sent, edited and deleted from this machine — ids and outcomes, never text

#### `max bot sends list` [#max-bot-sends-list]

every send, edit and delete this bot made from this machine, with its outcome

```sh
max bot sends list [query]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms that narrow the list — the fields are below. |

**Returns:** send attempt — at, profile, chat_id, outcome, kind, action, people, message_id, and 16 more; every field: max commands info bot sends list

**Example:** `max sales bot sends list`

### `max bot watch` [#max-bot-watch]

print new messages as they arrive and keep them, until Ctrl-C or --timeout (either ends it normally)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot watch [options]
```

| Option | Purpose |
|---|---|
| `--events` | also edits, deletions, buttons pressed and people coming and going; every line names its event. |
| `--types <types>` | only these update types, comma-separated, in the messenger's words. |
| `--public-url <url>` | receive by webhook at your tunnel's https address instead of polling, e.g. https://<name>.ts.net. |
| `--port <port>` | the local port behind the tunnel for --public-url (default 8766). |

**Returns:** print new messages as they arrive and keep them, until Ctrl-C

**Example:** `max sales bot watch --jsonl`, `max sales bot watch --events`

### `max bot callbacks` [#max-bot-callbacks]

answers to the buttons people press under the bot's messages

#### `max bot callbacks answer` [#max-bot-callbacks-answer]

answer a pressed button by its callback id: --notification shows the person a one-time note, --text replaces the message the button was on

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot callbacks answer <callback> [options]
```

| Argument | | Meaning |
|---|---|---|
| `callback` | required | the callback id `bot watch` printed. |

| Option | Purpose |
|---|---|
| `--text <text>` | the message's new text. |
| `--notification <text>` | a note only the person who pressed sees. |

**Returns:** answer a pressed button: a note to that person, or new message text

**Example:** `max sales bot callbacks answer 4385 --notification "Saved"`

### `max bot commands` [#max-bot-commands]

the bot's command menu — what people see after /

#### `max bot commands list` [#max-bot-commands-list]

the commands in the menu now

```sh
max bot commands list [query]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms; this list filters by none yet. |

**Returns:** bot menu entry — name, description; every field: max commands info bot commands list

**Example:** `max sales bot commands list`

#### `max bot commands set` [#max-bot-commands-set]

replace the whole menu: each command as name=description, e.g. start=Begin

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot commands set <commands>
```

| Argument | | Meaning |
|---|---|---|
| `commands` | required | name=description, one per command. |

**Returns:** replace the whole menu: each command as name=description, e.g. start=Begin

**Example:** `max sales bot commands set "start=Begin here" "help=What I can do"`

#### `max bot commands clear` [#max-bot-commands-clear]

empty the menu

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot commands clear
```

**Returns:** empty the menu

**Example:** `max sales bot commands clear`

### `max bot webhooks` [#max-bot-webhooks]

where the messenger pushes this bot's updates — while one is set, `bot watch` gets nothing

#### `max bot webhooks list` [#max-bot-webhooks-list]

the webhooks this bot has

```sh
max bot webhooks list [query]
```

| Argument | | Meaning |
|---|---|---|
| `query` | optional | field:value terms; this list filters by none yet. |

**Returns:** bot webhook — url, types; every field: max commands info bot webhooks list

**Example:** `max sales bot webhooks list`

#### `max bot webhooks set` [#max-bot-webhooks-set]

send this bot's updates to an HTTPS address; refused while another is set

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot webhooks set <url> [options]
```

| Argument | | Meaning |
|---|---|---|
| `url` | required | the HTTPS address. |

| Option | Purpose |
|---|---|
| `--types <types>` | only these update types, comma-separated, in the messenger's words. |
| `--secret-stdin` | a secret the messenger sends back with each update — asked for, or read from a pipe. |
| `--append` | keep the webhooks already set and add this one beside them. |

**Returns:** send this bot's updates to an HTTPS address; refused while another is set

**Example:** `max sales bot webhooks set https://bot.example.ts.net/`

#### `max bot webhooks delete` [#max-bot-webhooks-delete]

stop sending updates to this address; with none left, `bot watch` works again

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot webhooks delete <url>
```

| Argument | | Meaning |
|---|---|---|
| `url` | required | the address. |

**Returns:** stop sending updates to this address; with none left, `bot watch` works again

**Example:** `max sales bot webhooks delete https://bot.example.ts.net/`

### `max bot contacts` [#max-bot-contacts]

people this bot has seen write — from the local copy on this machine, never asking MAX unless told to

#### `max bot contacts show` [#max-bot-contacts-show]

one person: the chats they wrote in (with their last message there) and the latest messages of their private chat with the bot

```sh
max bot contacts show <who> [options]
```

| Argument | | Meaning |
|---|---|---|
| `who` | required | an id, @username or part of a name. |

| Option | Purpose |
|---|---|
| `--all-bots` | also read every other bot's copy on this machine that read_other_bots allows. |
| `--bots <profiles>` | also read these bots' copies, comma separated — each allowed by read_other_bots. |
| `--limit <n>` | how many messages from the private chat. |
| `--sync-first` | read the private chat with them again from the messenger first — one request. |

**Returns:** one person: the chats they wrote in and their chat with the bot

**Example:** `max sales bot contacts show @ann`

### `max bot mcp` [#max-bot-mcp]

serve this bot to an agent over MCP and set it up — `claude mcp add sales-bot -- max sales bot mcp serve`

#### `max bot mcp serve` [#max-bot-mcp-serve]

serve this bot to an agent over MCP, on stdin and stdout — `claude mcp add sales-bot -- max sales bot mcp serve`

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot mcp serve
```

**Returns:** serve this bot to an agent over MCP, on stdin and stdout

**Example:** `max sales bot mcp serve`

#### `max bot mcp config` [#max-bot-mcp-config]

print the mcpServers entry for Claude Desktop, Cursor and others, with full paths; writes nothing

```sh
max bot mcp config
```

**Returns:** print the mcpServers entry for an MCP client; writes nothing

**Example:** `max sales bot mcp config`

### `max bot me` [#max-bot-me]

the bot this profile's token belongs to: name, id, description, commands

```sh
max bot me
```

**Returns:** the bot this profile's token belongs to

**Example:** `max personal bot me`

### `max bot comments` [#max-bot-comments]

comments under a channel post — each command takes the post's message id (mid.…) first

#### `max bot comments list` [#max-bot-comments-list]

the comments under a post, newest last

```sh
max bot comments list <message> [query] [options]
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | |
| `query` | optional | field:value terms that narrow the list — the fields are below. |

| Option | Purpose |
|---|---|
| `--limit <n>` | how many, up to 100. |

**Returns:** max bot comment — id, text, timestamp, body; every field: max commands info bot comments list

**Example:** `max personal bot comments list 1234`

#### `max bot comments get` [#max-bot-comments-get]

one comment under a post

```sh
max bot comments get <message> <comment>
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | |
| `comment` | required | |

**Returns:** one comment under a post

**Example:** `max personal bot comments get 1234 <comment>`

#### `max bot comments send` [#max-bot-comments-send]

comment under a post as the bot; - reads stdin

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot comments send <message> <text> [options]
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | |
| `text` | required | |

| Option | Purpose |
|---|---|
| `--format <format>` | how the text is marked up. One of: `markdown`, `html`. |

**Returns:** comment under a post as the bot; - reads stdin

**Example:** `max personal bot comments send 1234 "on my way"`

#### `max bot comments edit` [#max-bot-comments-edit]

replace the text of a comment the bot wrote; - reads stdin

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot comments edit <message> <comment> <text> [options]
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | |
| `comment` | required | |
| `text` | required | |

| Option | Purpose |
|---|---|
| `--format <format>` | how the text is marked up. One of: `markdown`, `html`. |

**Returns:** replace the text of a comment the bot wrote; - reads stdin

**Example:** `max personal bot comments edit 1234 <comment> "on my way"`

#### `max bot comments delete` [#max-bot-comments-delete]

delete a comment under a post

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot comments delete <message> <comment> [options]
```

| Argument | | Meaning |
|---|---|---|
| `message` | required | |
| `comment` | required | |

| Option | Purpose |
|---|---|
| `--allow-dangerous` | skip confirmation for bot.messages.delete at level ask. |

**Returns:** delete a comment under a post

**Example:** `max personal bot comments delete 1234 <comment>`

### `max bot uploads` [#max-bot-uploads]

files uploaded to MAX, to attach to a message

#### `max bot uploads put` [#max-bot-uploads-put]

upload a file from disk and print the attachment to put in a message's `attachments` — `messages send --file` does both steps at once

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot uploads put <file> [options]
```

| Argument | | Meaning |
|---|---|---|
| `file` | required | |

| Option | Purpose |
|---|---|
| `--type <type>` | upload as this kind instead of guessing by extension. One of: `image`, `video`, `audio`, `file`. |
| `--allow-any-file` | upload a file even from credential folders or WireCat apps' folders. |

**Returns:** upload a file from disk and print the attachment to put in a message's `attachments` —…

**Example:** `max personal bot uploads put ./report.pdf`

### `max bot api` [#max-bot-api]

every operation of the official Bot API, generated from its schema — docs/dev/bot-api-coverage.md

```sh
max bot api [options]
```

| Option | Purpose |
|---|---|
| `--store-token <profile>` | keep a returned authentication token only in this bot profile's OS keyring; never print it. |

#### `max bot api get-my-info` [#max-bot-api-get-my-info]

Get current bot info — read (GET /me)

```sh
max bot api get-my-info
```

**Returns:** Get current bot info — read (GET /me)

**Example:** `max personal bot api get-my-info`

#### `max bot api edit-my-commands` [#max-bot-api-edit-my-commands]

Edit current bot commands — write (PATCH /me/commands)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api edit-my-commands [options]
```

| Option | Purpose |
|---|---|
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Edit current bot commands — write (PATCH /me/commands)

**Example:** `max personal bot api edit-my-commands`

#### `max bot api get-chat` [#max-bot-api-get-chat]

Get chat — read (GET /chats/{chatId})

```sh
max bot api get-chat [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Requested chat or channel identifier. |

**Returns:** Get chat — read (GET /chats/{chatId})

**Example:** `max personal bot api get-chat --chat-id <value>`

#### `max bot api edit-chat` [#max-bot-api-edit-chat]

Edit chat or channel info — write (PATCH /chats/{chatId})

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api edit-chat [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Edit chat or channel info — write (PATCH /chats/{chatId})

**Example:** `max personal bot api edit-chat --chat-id <value>`

#### `max bot api send-action` [#max-bot-api-send-action]

Send action — write (POST /chats/{chatId}/actions)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api send-action [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Send action — write (POST /chats/{chatId}/actions)

**Example:** `max personal bot api send-action --chat-id <value>`

#### `max bot api get-pinned-message` [#max-bot-api-get-pinned-message]

Get pinned message — read (GET /chats/{chatId}/pin)

```sh
max bot api get-pinned-message [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat identifier to get its pinned message. |

**Returns:** Get pinned message — read (GET /chats/{chatId}/pin)

**Example:** `max personal bot api get-pinned-message --chat-id <value>`

#### `max bot api pin-message` [#max-bot-api-pin-message]

Pin message — write (PUT /chats/{chatId}/pin)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api pin-message [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat identifier where message should be pinned. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Pin message — write (PUT /chats/{chatId}/pin)

**Example:** `max personal bot api pin-message --chat-id <value>`

#### `max bot api unpin-message` [#max-bot-api-unpin-message]

Unpin message — write (DELETE /chats/{chatId}/pin)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api unpin-message [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat identifier to remove pinned message. |

**Returns:** Unpin message — write (DELETE /chats/{chatId}/pin)

**Example:** `max personal bot api unpin-message --chat-id <value>`

#### `max bot api get-membership` [#max-bot-api-get-membership]

Get chat or channel membership — read (GET /chats/{chatId}/members/me)

```sh
max bot api get-membership [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |

**Returns:** Get chat or channel membership — read (GET /chats/{chatId}/members/me)

**Example:** `max personal bot api get-membership --chat-id <value>`

#### `max bot api leave-chat` [#max-bot-api-leave-chat]

Leave chat — destructive (DELETE /chats/{chatId}/members/me)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api leave-chat [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |

**Returns:** Leave chat — destructive (DELETE /chats/{chatId}/members/me)

**Example:** `max personal bot api leave-chat --chat-id <value>`

#### `max bot api get-admins` [#max-bot-api-get-admins]

Get chat or channel admins — read (GET /chats/{chatId}/members/admins)

```sh
max bot api get-admins [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |

**Returns:** Get chat or channel admins — read (GET /chats/{chatId}/members/admins)

**Example:** `max personal bot api get-admins --chat-id <value>`

#### `max bot api post-admins` [#max-bot-api-post-admins]

Set chat or channel admins — write (POST /chats/{chatId}/members/admins)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api post-admins [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Set chat or channel admins — write (POST /chats/{chatId}/members/admins)

**Example:** `max personal bot api post-admins --chat-id <value>`

#### `max bot api delete-admins` [#max-bot-api-delete-admins]

Revoke admin rights — write (DELETE /chats/{chatId}/members/admins/{userId})

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api delete-admins [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |
| `--user-id <value>` | User identifier. |

**Returns:** Revoke admin rights — write (DELETE /chats/{chatId}/members/admins/{userId})

**Example:** `max personal bot api delete-admins --chat-id <value> --user-id <value>`

#### `max bot api get-members` [#max-bot-api-get-members]

Get members — read (GET /chats/{chatId}/members)

```sh
max bot api get-members [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |
| `--user-ids <value>` | Comma-separated list of users identifiers to get their membership. When this parameter is passed, both `count` and `marker` are ignored. |
| `--marker <value>` | Marker. |
| `--count <value>` | Count. |

**Returns:** Get members — read (GET /chats/{chatId}/members)

**Example:** `max personal bot api get-members --chat-id <value>`

#### `max bot api add-members` [#max-bot-api-add-members]

Add members — write (POST /chats/{chatId}/members)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api add-members [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Add members — write (POST /chats/{chatId}/members)

**Example:** `max personal bot api add-members --chat-id <value>`

#### `max bot api remove-member` [#max-bot-api-remove-member]

Remove member — write (DELETE /chats/{chatId}/members)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api remove-member [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier. |
| `--user-id <value>` | User id to remove from chat or channel. |
| `--block <value>` | Set to `true` if user should be blocked in chat. |

**Returns:** Remove member — write (DELETE /chats/{chatId}/members)

**Example:** `max personal bot api remove-member --chat-id <value> --user-id <value>`

#### `max bot api get-subscriptions` [#max-bot-api-get-subscriptions]

Get subscriptions — read (GET /subscriptions)

```sh
max bot api get-subscriptions
```

**Returns:** Get subscriptions — read (GET /subscriptions)

**Example:** `max personal bot api get-subscriptions`

#### `max bot api subscribe` [#max-bot-api-subscribe]

Subscribe — write (POST /subscriptions)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api subscribe [options]
```

| Option | Purpose |
|---|---|
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Subscribe — write (POST /subscriptions)

**Example:** `max personal bot api subscribe`

#### `max bot api unsubscribe` [#max-bot-api-unsubscribe]

Unsubscribe — write (DELETE /subscriptions)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api unsubscribe [options]
```

| Option | Purpose |
|---|---|
| `--url <value>` | URL to remove from WebHook subscriptions. |

**Returns:** Unsubscribe — write (DELETE /subscriptions)

**Example:** `max personal bot api unsubscribe --url <value>`

#### `max bot api get-upload-url` [#max-bot-api-get-upload-url]

Get upload URL — write (POST /uploads)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api get-upload-url [options]
```

| Option | Purpose |
|---|---|
| `--type <value>` | Uploaded file type: image, audio, video, file. |

**Returns:** Get upload URL — write (POST /uploads)

**Example:** `max personal bot api get-upload-url --type <value>`

#### `max bot api get-messages` [#max-bot-api-get-messages]

Get messages — read (GET /messages)

```sh
max bot api get-messages [options]
```

| Option | Purpose |
|---|---|
| `--chat-id <value>` | Chat or channel identifier to get messages in chat or channel. |
| `--message-ids <value>` | Comma-separated list of message ids to get. |
| `--from <value>` | Start time for requested messages - use after instead. |
| `--to <value>` | End time for requested messages  - use before instead. |
| `--before <value>` | Messages before timestamp. |
| `--after <value>` | Messages after timestamp. |
| `--count <value>` | Maximum amount of messages in response. |

**Returns:** Get messages — read (GET /messages)

**Example:** `max personal bot api get-messages`

#### `max bot api send-message` [#max-bot-api-send-message]

Send message — write (POST /messages)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api send-message [options]
```

| Option | Purpose |
|---|---|
| `--user-id <value>` | Fill this parameter if you want to send message to user. |
| `--chat-id <value>` | Fill this if you send message to chat or channel. |
| `--disable-link-preview <value>` | If `false`, server will not generate media preview for links in text. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Send message — write (POST /messages)

**Example:** `max personal bot api send-message`

#### `max bot api edit-message` [#max-bot-api-edit-message]

Edit message — write (PUT /messages)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api edit-message [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Editing message identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Edit message — write (PUT /messages)

**Example:** `max personal bot api edit-message --message-id <value>`

#### `max bot api delete-message` [#max-bot-api-delete-message]

Delete message — destructive (DELETE /messages)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api delete-message [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Deleting message identifier. |
| `--allow-dangerous` | skip confirmation for bot.messages.delete at level ask. |

**Returns:** Delete message — destructive (DELETE /messages)

**Example:** `max personal bot api delete-message --message-id <value>`

#### `max bot api get-message-by-id` [#max-bot-api-get-message-by-id]

Get message — read (GET /messages/{messageId})

```sh
max bot api get-message-by-id [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) to get single message in chat or channel. |

**Returns:** Get message — read (GET /messages/{messageId})

**Example:** `max personal bot api get-message-by-id --message-id <value>`

#### `max bot api get-comments` [#max-bot-api-get-comments]

Get comments — read (GET /messages/{messageId}/comments)

```sh
max bot api get-comments [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) of the commented message. |
| `--comment-ids <value>` | Comma-separated list of comment ids to get. |
| `--before <value>` | Comments before timestamp. |
| `--after <value>` | Comments after timestamp. |
| `--count <value>` | Maximum amount of comments in response. |

**Returns:** Get comments — read (GET /messages/{messageId}/comments)

**Example:** `max personal bot api get-comments --message-id <value>`

#### `max bot api send-comment` [#max-bot-api-send-comment]

Send comment — write (POST /messages/{messageId}/comments)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api send-comment [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) of the commented message. |
| `--disable-link-preview <value>` | If `false`, server will not generate media preview for links in text. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Send comment — write (POST /messages/{messageId}/comments)

**Example:** `max personal bot api send-comment --message-id <value>`

#### `max bot api edit-comment` [#max-bot-api-edit-comment]

Edit comment — write (PUT /messages/{messageId}/comments)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api edit-comment [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) of the commented message. |
| `--comment-id <value>` | Editing comment identifier. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Edit comment — write (PUT /messages/{messageId}/comments)

**Example:** `max personal bot api edit-comment --message-id <value> --comment-id <value>`

#### `max bot api delete-comment` [#max-bot-api-delete-comment]

Delete comment — destructive (DELETE /messages/{messageId}/comments)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api delete-comment [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) of the commented message. |
| `--comment-id <value>` | Deleting comment identifier. |
| `--allow-dangerous` | skip confirmation for bot.messages.delete at level ask. |

**Returns:** Delete comment — destructive (DELETE /messages/{messageId}/comments)

**Example:** `max personal bot api delete-comment --message-id <value> --comment-id <value>`

#### `max bot api get-comment-by-id` [#max-bot-api-get-comment-by-id]

Get comment — read (GET /messages/{messageId}/comments/{commentId})

```sh
max bot api get-comment-by-id [options]
```

| Option | Purpose |
|---|---|
| `--message-id <value>` | Message identifier (`mid`) of the commented message. |
| `--comment-id <value>` | Comment identifier (`mid`) to get single comment in channel. |

**Returns:** Get comment — read (GET /messages/{messageId}/comments/{commentId})

**Example:** `max personal bot api get-comment-by-id --message-id <value> --comment-id <value>`

#### `max bot api get-video-attachment-details` [#max-bot-api-get-video-attachment-details]

Get video details — read (GET /videos/{videoToken})

```sh
max bot api get-video-attachment-details [options]
```

| Option | Purpose |
|---|---|
| `--video-token <value>` | Video attachment token. |

**Returns:** Get video details — read (GET /videos/{videoToken})

**Example:** `max personal bot api get-video-attachment-details --video-token <value>`

#### `max bot api answer-on-callback` [#max-bot-api-answer-on-callback]

Answer on callback — write (POST /answers)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api answer-on-callback [options]
```

| Option | Purpose |
|---|---|
| `--callback-id <value>` | Identifies a button clicked by user. Bot receives this identifier after user pressed button as part of `MessageCallbackUpdate`. |
| `--disable-link-preview <value>` | If `true`, server will not generate media preview for links in updated message text. |
| `--body <json>` | the request body as JSON; - reads it from stdin. |
| `--body-file <path>` | the request body from a JSON file; - is stdin. |

**Returns:** Answer on callback — write (POST /answers)

**Example:** `max personal bot api answer-on-callback --callback-id <value>`

#### `max bot api get-updates` [#max-bot-api-get-updates]

Get updates — write (GET /updates)

**Changes something outside this computer: in MAX or in an external service.**

```sh
max bot api get-updates [options]
```

| Option | Purpose |
|---|---|
| `--limit <value>` | Maximum number of updates to be retrieved. |
| `--poll-timeout <value>` | Timeout in seconds for long polling. |
| `--marker <value>` | Pass `null` to get updates you didn't get yet. |
| `--types <value>` | Comma separated list of update types your bot want to receive. |

**Returns:** Get updates — write (GET /updates)

**Example:** `max personal bot api get-updates`

## Exit codes [#exit-codes]

Scripts should branch on the code, not the message: wording may change, codes remain stable.

| Code | Meaning |
|---|---|
| `0` | Success |
| `2` | `validation_error` |
| `3` | `configuration_error` |
| `4` | `authentication_error` |
| `5` | `permission_error` |
| `6` | `not_found` |
| `7` | `confirmation_required` |
| `8` | `rate_limited` |
| `9` | `timeout` |
| `10` | `network_error` |
| `11` | `provider_error` |
| `12` | `provider_unavailable` |
| `13` | `invalid_response` |
| `14` | `outcome_unknown` |
| `15` | `conflict` |
| `130` | `cancelled` |
| `1` | Any other error |

`0`, and only `0`, means the operation succeeded. `14` — `outcome_unknown` — means the message **may** have been sent: its outcome is neither confirmed nor failed. Retry only with the same `--operation-id`.
