For AI agents: markdown of this page — /docs-content-en/bots/chats/manager-delete.md documentation index — /llms.txt
Remove managers
DELETE /v1/bots/:botId/chats/:dialogId/managers
Removes the manager role from the specified users. The bot must be the chat owner.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterbotId (path) |
Typenumber | Requiredyes | DescriptionBot ID. List: GET /v1/bots |
ParameterdialogId (path) |
Typestring | Requiredyes | DescriptionGroup chat ID in the form 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 |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
FielduserIds |
Typenumber[] | Requiredyes | DescriptionArray of user IDs to remove the manager role from. Chat participant list: GET /v1/bots/:botId/chats/:dialogId/users, field data[].id |
Examples
curl — personal key
curl -X DELETE https://vibecode.bitrix24.com/v1/bots/42/chats/chat456/managers \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "userIds": [5] }'
curl — OAuth application
curl -X DELETE https://vibecode.bitrix24.com/v1/bots/42/chats/chat456/managers \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "userIds": [5] }'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/chats/chat456/managers', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ userIds: [5] }),
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/bots/42/chats/chat456/managers', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ userIds: [5] }),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fielddata.result |
Typeboolean | Descriptiontrue if the role was removed |
Response example
{
"success": true,
"data": {
"result": true
}
}
Error response example
403 — the bot lacks rights to manage the chat:
{
"success": false,
"error": {
"code": "BITRIX_ACCESS_DENIED",
"message": "Access denied"
}
}
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 |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe bot is not a member of the chat or lacks rights — the owner role is required |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionAnother Bitrix24 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.