For AI agents: markdown of this page — /docs-content-en/chats/members/remove.md documentation index — /llms.txt
Remove a member
DELETE /v1/chats/:chatId/users
Removes one user from a group chat.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatId (path) |
number | yes | Numeric chat ID (without the chat prefix) |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
userId |
number | yes | ID of the user to remove |
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/123/users" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "userId": 42 }'
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/chats/123/users" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "userId": 42 }'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/123/users', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ userId: 42 }),
})
const { success, data } = await res.json()
console.log('Removed:', data)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/123/users', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ userId: 42 }),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data |
boolean | true when removed successfully |
Response example
{
"success": true,
"data": true
}
Error response example
422 — the user is not a member of the chat:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "The specified user is not a member of the chat"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 403 | SCOPE_DENIED |
The API key does not have the im scope |
| 401 | TOKEN_MISSING |
The API key has no configured Bitrix24 tokens |
| 422 | BITRIX_ERROR |
Bitrix24 returned an error — the text is in the message field (for example, the user is not a member of the chat or no permission) |
| 502 | BITRIX_UNAVAILABLE |
Bitrix24 is unavailable or returned a server error |
Full list of common API errors — Errors.
Known specifics
Removal one at a time. The endpoint accepts a single userId (a number), not an array. To remove several members, call the method for each one separately.