For AI agents: markdown of this page — /docs-content-en/bots/management/update.md documentation index — /llms.txt

Update a bot

PATCH /v1/bots/:botId

Updates a bot's properties. Pass only the fields you want to change.

Two body forms — both valid. The platform accepts both a flat body (the same as for POST /v1/bots) and the Bitrix24 format with a fields wrapper. If the body contains a non-empty fields wrapper, the request is forwarded to Bitrix24 unchanged. The values [], null, false, 0 and "" do not count as a wrapper — the body is read as flat. An empty object {} does count as a wrapper: it disables the expansion, and top-level fields are not applied. Without a wrapper, the known top-level fields are automatically expanded into fields.properties.* / fields.*, and an unrecognized key is dropped by that expansion — Bitrix24 would ignore it anyway. For every field that Bitrix24 applies, the behavior of both forms is identical.

The one exception is disabled. That field is handled by the platform itself and never travels to Bitrix24, so it is read only from the top level of the body. Inside the fields wrapper it is not a platform field at all: {"fields": {"disabled": false}} goes down the ordinary update path, and on a disabled bot that path answers 410 BOT_DISABLED. The re-enable call is the flat body {"disabled": false} and nothing else.

Request fields (body)

Parameter (flat) Parameter (Bitrix24 format) Type Description
Parameter (flat)name Parameter (Bitrix24 format)fields.properties.name Typestring DescriptionNew bot name
Parameter (flat)lastName Parameter (Bitrix24 format)fields.properties.lastName Typestring DescriptionNew last name
Parameter (flat)workPosition Parameter (Bitrix24 format)fields.properties.workPosition Typestring DescriptionNew job title
Parameter (flat)color Parameter (Bitrix24 format)fields.properties.color Typestring DescriptionNew avatar color
Parameter (flat)gender Parameter (Bitrix24 format)fields.properties.gender Typestring DescriptionGender: M or F
Parameter (flat)avatar Parameter (Bitrix24 format)fields.properties.avatar Typestring DescriptionBot avatar: PNG or JPEG as a base64 string without the data:image/...;base64, prefix, up to ~50 KB. See "Known specifics"
Parameter (flat)eventMode Parameter (Bitrix24 format)fields.eventMode Typestring DescriptionEvent mode: fetch or webhook
Parameter (flat)webhookUrl Parameter (Bitrix24 format)fields.webhookUrl Typestring DescriptionURL for push notifications
Parameter (flat)isHidden Parameter (Bitrix24 format)fields.isHidden Typeboolean DescriptionHide from the contact list
Parameter (flat)isReactionsEnabled Parameter (Bitrix24 format)fields.isReactionsEnabled Typeboolean DescriptionAllow reactions
Parameter (flat)backgroundId Parameter (Bitrix24 format)fields.backgroundId Typestring DescriptionChat background: azure, mint, steel, slate, teal, cornflower, sky, peach, frost
Parameter (flat)isSupportOpenline Parameter (Bitrix24 format)fields.isSupportOpenline Typeboolean DescriptionOpen Channels support (only for type: "openline")
Parameter (flat)— Parameter (Bitrix24 format)fields.botToken Typestring DescriptionYour own bot token instead of the platform-issued one: 32 to 40 characters from the [A-Za-z0-9_-] alphabet. A value outside those bounds is rejected with 400 BOT_TOKEN_INVALID before Bitrix24 is called, and the bot token is left unchanged. Accepted only in the fields form — the field has no flat name. See "Known specifics"
Parameter (flat)disabled Parameter (Bitrix24 format)— Typeboolean DescriptionRe-enables a bot that the platform disabled. Accepted only in the flat form and only as false — the field has no fields name, because it is applied by the platform and is never sent to Bitrix24. This is the only field that works on a disabled bot: the request is answered before the BOT_DISABLED check, with 200 and the body {"success": true, "data": {"id": "<string bot record id>", "disabled": false}} (no bot and no users). disabled: true is rejected with 400 DISABLE_NOT_ALLOWED. See "Known specifics"

Examples

curl — personal key

Terminal
curl -X PATCH https://vibecode.bitrix24.com/v1/bots/42 \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "properties": { "name": "New name", "color": "MINT" },
      "eventMode": "fetch"
    }
  }'

curl — OAuth application

Terminal
curl -X PATCH https://vibecode.bitrix24.com/v1/bots/42 \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "properties": { "name": "New name", "color": "MINT" },
      "eventMode": "fetch"
    }
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      properties: { name: 'New name', color: 'MINT' },
      eventMode: 'fetch',
    },
  }),
})
const { data } = await res.json()

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fields: {
      properties: { name: 'New name', color: 'MINT' },
      eventMode: 'fetch',
    },
  }),
})

Response fields

Field Type Description
Fielddata.bot Typeobject DescriptionThe updated bot. The field set matches the registration response
Fielddata.bot.id Typenumber DescriptionBot ID in the Bitrix24 account
Fielddata.bot.code Typestring DescriptionThe bot's system code
Fielddata.bot.type Typestring DescriptionBot type: bot, personal, or supervisor
Fielddata.bot.eventMode Typestring DescriptionEvent delivery mode: fetch or webhook
Fielddata.users Typearray DescriptionThe bot's card as a Bitrix24 account user

Response example

The main fields are shown. The full set of bot fields is in the registration response.

JSON
{
  "success": true,
  "data": {
    "bot": {
      "id": 42,
      "code": "my_helper_bot",
      "type": "bot",
      "eventMode": "fetch",
      "isHidden": false,
      "isReactionsEnabled": true,
      "language": "en"
    },
    "users": []
  }
}

Error response example

403 — the bot belongs to a different key:

JSON
{
  "success": false,
  "error": {
    "code": "BOT_ACCESS_DENIED",
    "message": "This bot belongs to a different API key"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_BOT_ID DescriptionbotId is not a number
HTTP400 CodeBOT_TOKEN_INVALID Descriptionfields.botToken is shorter than 32 or longer than 40 characters, contains characters outside [A-Za-z0-9_-], or was not passed as a string. Bitrix24 is not called and the bot token stays as it was
HTTP400 CodeDISABLE_NOT_ALLOWED DescriptionThe body carries disabled: true. Disabling is system-owned and cannot be requested: delete the bot via DELETE /v1/bots/:botId instead
HTTP404 CodeBOT_NOT_FOUND DescriptionBot not found
HTTP403 CodeBOT_ACCESS_DENIED DescriptionThe bot belongs to a different API key
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the imbot scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only — see access rights
HTTP410 CodeBOT_DISABLED DescriptionThe bot is disabled and does not process API calls. Exception: the flat body {"disabled": false} is the re-enable path — it is handled before this check and answers 200. Any other body on a disabled bot gets this error, the fields form of disabled included. How to restore the bot — Bot disabled
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP422 CodeAPP_HOST_NOT_ALLOWED_HERE DescriptionwebhookUrl points at a named address of the platform app domain (<name>.<domain>, not app-…) whose name is not bound to a server of your Bitrix24 account. Nothing is stored and Bitrix24 is not called. A name of your own server is accepted and stored as that server's app-… address

Full list of common API errors — Errors.

Known specifics

Symmetry with registration. PATCH accepts both a flat body ({ name, eventMode, ... }) and the Bitrix24 format with a fields wrapper — just like POST /v1/bots. Which body the platform treats as a wrapper and which it expands itself is described at the top of the page.

type cannot be changed: the type field is not accepted on update.

Re-enabling a disabled bot. {"disabled": false} in the flat body is the only API call that clears the disabled state without /reauth — and the only call this endpoint answers on a disabled bot, because it is handled before the BOT_DISABLED check and makes no Bitrix24 call:

Terminal
curl -X PATCH https://vibecode.bitrix24.com/v1/bots/42 \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"disabled": false}'
JSON
{ "success": true, "data": { "id": "cm3k9x2a10001qz7f8h2b4d6e", "disabled": false } }

In this response, id is the string identifier of the bot record on the platform, not the botId from the path. The response carries no bot and no users — nothing was read from Bitrix24. On an already enabled bot the call is a no-op and returns the same body. The fields form does not work here: {"fields": {"disabled": false}} is forwarded to Bitrix24 as an ordinary update, so on a disabled bot it answers 410 BOT_DISABLED and the bot stays disabled. disabled: true is never accepted (400 DISABLE_NOT_ALLOWED) — to retire a bot, use DELETE /v1/bots/:botId. Which recovery path to pick is described in Bot disabled: this call only clears the state and the authorization-error counter, while /reauth additionally verifies access.

Your own bot token is needed only if your integration is already pinned to a specific token. The platform issues the token itself at registration, and that value is within the bounds by construction. Setting your own value makes sense only when the integration is already tied to a specific token. The same value authenticates the events Bitrix24 delivers to the bot, so use a random value at least 32 characters long — for example 32 hexadecimal characters. Meaningful strings such as support-bot-2026 fall outside the bounds.

Avatar format. The avatar field accepts a PNG or JPEG image as a base64 string without the data:image/...;base64, prefix — pass only the base64 data itself. A string with the data: prefix results in a 422 response. The maximum size is ~50 KB: if the limit is exceeded, the request completes successfully (success: true), but the avatar is not saved and the bot's avatar remains empty. The endpoint accepts JSON only — file upload via multipart/form-data is not supported (415 response). Pass the value as avatar (flat form) or as fields.properties.avatar (the fields form) — the result is the same.

See also