[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fcommands":3,"docs-tabs-chats\u002Fcommands":6},{"content":4,"lastmod":5},"## Bot commands in a chat\n\n`GET \u002Fv1\u002Fchats\u002F:dialogId\u002Fcommands`\n\nReturns the bot commands the current user can call in a chat, together with short cards of those bots.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `dialogId` (path) | string | yes | Dialog identifier: `chatXXX` for a group chat, a user ID for the personal dialog with that user, or `me` for the personal dialog with yourself. `chatXXX` is the `data.items[].id` field of [recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent), a user ID comes from [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n\nThe operation takes no query parameters. Any query parameter is refused with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fcommands\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X GET \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fcommands\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fcommands', {\n  \"method\": \"GET\",\n  \"headers\": {\n    \"X-Api-Key\": \"YOUR_API_KEY\"\n  }\n})\nconst result = await response.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat42\u002Fcommands', {\n  \"method\": \"GET\",\n  \"headers\": {\n    \"X-Api-Key\": \"YOUR_APP_KEY\",\n    \"Authorization\": \"Bearer USER_SESSION_TOKEN\"\n  }\n})\nconst result = await response.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|---|---|---|\n| `success` | boolean | Always `true` on success |\n| `data.commands` | array | Commands available in the chat |\n| `data.commands[].id` | number | Command ID |\n| `data.commands[].botId` | number | ID of the bot that owns the command. The bot card is the `data.users` element with the same `id` |\n| `data.commands[].command` | string | Command text, starts with `\u002F`, for example `\u002Fecho` |\n| `data.commands[].category` | string | Name of the command group in the command list |\n| `data.commands[].common` | string | `Y` — the command is available in all chats, `N` — only in the personal dialog with the bot and in chats with the bot |\n| `data.commands[].context` | string | Command context |\n| `data.commands[].title` | string | Command description |\n| `data.commands[].params` | string | Hint for the command parameters |\n| `data.commands[].extranet` | string | `Y` — the command is available to extranet users, `N` — it is not |\n| `data.users` | array | Cards of the bots that own the commands |\n| `data.users[].id` | number | Bot ID |\n| `data.users[].name` | string | Bot name |\n| `data.users[].avatar` | string | Avatar URL. An empty string if no avatar is set |\n| `data.users[].color` | string | Bot color in `#RRGGBB` format |\n| `data.users[].type` | string | User type — `bot` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"commands\": [\n      {\n        \"id\": 73,\n        \"botId\": 1163,\n        \"command\": \"\u002Fgiphy\",\n        \"category\": \"Giphy\",\n        \"common\": \"Y\",\n        \"context\": \"\",\n        \"title\": \"Post an image that matches the given topic\",\n        \"params\": \"text\",\n        \"extranet\": \"Y\"\n      },\n      {\n        \"id\": 103,\n        \"botId\": 1291,\n        \"command\": \"\u002Fecho\",\n        \"category\": \"MyBot\",\n        \"common\": \"Y\",\n        \"context\": \"\",\n        \"title\": \"Echo\",\n        \"params\": \"text\",\n        \"extranet\": \"N\"\n      }\n    ],\n    \"users\": [\n      {\n        \"id\": 1163,\n        \"name\": \"Giphy\",\n        \"avatar\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fupload\u002Fgiphy.png\",\n        \"color\": \"#1eb4aa\",\n        \"type\": \"bot\"\n      },\n      {\n        \"id\": 1291,\n        \"name\": \"MyBot\",\n        \"avatar\": \"\",\n        \"color\": \"#df532d\",\n        \"type\": \"bot\"\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n422 — there is no chat with this `dialogId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"CHAT_NOT_FOUND\",\n    \"hint\": \"dialogId must be a userId (number as string) for DMs or \\\"chat{N}\\\" for group chats. Examples: \\\"1\\\" for user 1, \\\"chat123\\\" for group chat 123. Create a group chat first via POST \u002Fv1\u002Fbots\u002F:botId\u002Fchats if needed.\",\n    \"b24Code\": \"CHAT_NOT_FOUND\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|---|---|---|\n| 400 | `INVALID_PARAMS` | `dialogId` is neither a positive user ID, `chatXXX`, nor `me`, or a query parameter was passed |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` was not passed |\n| 401 | `TOKEN_MISSING` | The key has no configured Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only, and either the request was not made with an employee's personal key or `dialogId` does not point to an existing dialog |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused access to the chat |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 did not find the object. The Bitrix24 code is in `error.b24Code` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error, the Bitrix24 code is in `error.b24Code`. If the chat does not exist, the code is `CHAT_NOT_FOUND` |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit was exceeded. The retry delay is in the `Retry-After` header |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | The user could not be resolved when the `me` alias is used |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a response that could not be read |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond within the time limit. The retry delay is in the `Retry-After` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- The list contains only commands of bots that are available to the current user in this dialog. Active chat membership is required.\n- For a read-only key, an existing dialog is `chatXXX` or a user ID from that employee's recent dialogs.\n\n## See also\n\n- [Execute a bot command](\u002Fdocs\u002Fchats\u002Fmessages\u002Fcommand)\n- [Recent dialogs](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Frecent)\n- [Bot commands](\u002Fdocs\u002Fbots\u002Fcommands)\n- [Errors](\u002Fdocs\u002Ferrors)\n","2026-10-07",{},1795000499829]