For AI agents: markdown of this page — /docs-content-en/bots/commands.md documentation index — /llms.txt
Commands
Register bot slash commands, update and delete them, answer invocations. Users invoke commands via / in chat. Commands also fire through the COMMAND field in keyboard buttons — both ways generate the same ONIMBOTV2COMMANDADD event.
Scope: imbot | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key
Register a command
POST /v1/bots/:botId/commands
Registers a new bot slash command. Vibecode accepts a flat format and automatically wraps it into fields for Bitrix24.
Request fields (body)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
command |
string | yes | — | Command text without / (for example, help) |
title |
string/object | no | — | Title. A string or a multilingual object { "en": "Help", "de": "Hilfe" } |
params |
string/object | no | — | Parameters description. A string or an object { "en": "topic", "de": "Thema" } |
common |
string | no | "N" |
"Y" — available in all chats, "N" — only in the private dialog with the bot and chats with the bot |
hidden |
string | no | "N" |
"Y" — hide from the command list |
extranetSupport |
string | no | "N" |
"Y" — available to extranet users |
Examples
curl — personal key
curl -X POST https://vibecode.bitrix24.com/v1/bots/42/commands \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"command": "help",
"title": { "en": "Help", "de": "Hilfe" },
"params": { "en": "topic", "de": "Thema" },
"common": "Y"
}'
curl — OAuth application
curl -X POST https://vibecode.bitrix24.com/v1/bots/42/commands \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"command": "help",
"title": { "en": "Help", "de": "Hilfe" },
"params": { "en": "topic", "de": "Thema" },
"common": "Y"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/commands', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
command: 'help',
title: { en: 'Help', de: 'Hilfe' },
params: { en: 'topic', de: 'Thema' },
common: 'Y',
}),
})
const { success, data } = await res.json()
console.log('Command ID:', data.commandId)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/commands', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
command: 'help',
title: { en: 'Help', de: 'Hilfe' },
params: { en: 'topic', de: 'Thema' },
common: 'Y',
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
command.id |
number | ID of the registered command |
command.botId |
number | Bot ID |
command.command |
string | Command text (with /) |
command.common |
boolean | Available in all chats |
command.hidden |
boolean | Hidden from the list |
command.extranetSupport |
boolean | Available to extranet users |
Response example
{
"success": true,
"data": {
"command": {
"id": 117,
"botId": 1327,
"command": "/help",
"common": true,
"hidden": false,
"extranetSupport": false
}
}
}
Error response example
502 — Bitrix24 error:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Command 'help' already registered"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_BOT_ID |
botId is not a number |
| 404 | BOT_NOT_FOUND |
No bot found with this ID |
| 403 | BOT_ACCESS_DENIED |
The bot belongs to a different API key |
| 502 | BITRIX_ERROR |
Bitrix24 error (error text in message) |
| 403 | SCOPE_DENIED |
API key lacks the imbot scope |
| 401 | TOKEN_MISSING |
API key has no configured tokens |
Full list of common API errors — Errors.
Known specifics
Idempotency: a repeat call with the same command for the same bot returns the existing command unchanged. To update it, use PATCH.
Multilingual: title and params accept either a string or an object with language keys (ru, en, de, etc.).
Event: when a user invokes the command, the ONIMBOTV2COMMANDADD event fires.