For AI agents: markdown of this page — /docs-content-en/bots/chats/update.md documentation index — /llms.txt
Update a chat
PATCH /v1/bots/:botId/chats/:dialogId
Updates chat settings. The bot must be a member of the chat. Only the fields you pass are updated.
Two body forms — both valid. The platform accepts a flat object (
{ title, description, ... }) and the Bitrix24 format with afieldswrapper. If the body contains a non-emptyfieldswrapper, the request is forwarded to Bitrix24 unchanged. The values[],null,false,0and""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 will not be applied. Without a wrapper, the known top-level fields are automatically expanded intofields.*, and any unrecognized key is dropped during expansion.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterbotId (path) |
Typenumber | Requiredyes | DescriptionBot ID. List: GET /v1/bots |
ParameterdialogId (path) |
Typestring | Requiredyes | DescriptionDialog ID. For a group chat, it is chatXXX, returned in the data.chat.dialogId field of the POST /v1/bots/:botId/chats response and in the chat.dialogId field of bot events. A number means a direct dialog with the user who has that ID |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldtitle |
Typestring | Requiredno | DescriptionNew chat name |
Fielddescription |
Typestring | Requiredno | DescriptionNew description |
Fieldcolor |
Typestring | Requiredno | DescriptionNew color |
Fieldavatar |
Typestring | Requiredno | DescriptionNew avatar URL |
Fieldfields |
Typeobject | Requiredno | DescriptionBitrix24-format wrapper instead of flat fields: fields.title, fields.description, fields.color, fields.avatar |
Examples
curl — personal key
curl -X PATCH https://vibecode.bitrix24.com/v1/bots/42/chats/chat456 \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"title": "New chat name",
"description": "Updated description"
}
}'
curl — OAuth application
curl -X PATCH https://vibecode.bitrix24.com/v1/bots/42/chats/chat456 \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"title": "New chat name",
"description": "Updated description"
}
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/chats/chat456', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
fields: {
title: 'New chat name',
description: 'Updated description',
},
}),
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/chats/chat456', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
fields: {
title: 'New chat name',
description: 'Updated description',
},
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fielddata.result |
Typeboolean | Descriptiontrue on a successful update |
Response example
{
"success": true,
"data": {
"result": true
}
}
Error response example
403 — the bot belongs to a different key:
{
"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 |
| HTTP404 | CodeBOT_NOT_FOUND |
DescriptionNo bot found with this ID |
| HTTP403 | CodeBOT_ACCESS_DENIED |
DescriptionThe bot belongs to another API key |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 error (error text in message) |
| 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. How to restore it — Bot disabled |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
Full list of common API errors — Errors.