For AI agents: markdown of this page — /docs-content-en/chats/members/membership.md documentation index — /llms.txt
Membership check
GET /v1/chats/:dialogId/users/membership
Checks which of the listed users are members of the chat. One request checks up to 50 users at once, for example before inviting users to the chat or mentioning them.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ParameterdialogId (path) |
Typestring | Requiredyes | Default— | DescriptionDialog ID: chatXXX for a group chat, a user ID for a direct dialog, or the me alias. chatXXX is the id field of a recent dialogs row, a user ID comes from the user list |
ParameteruserIds (query) |
Typestring | Requiredyes | Default— | DescriptionFrom 1 to 50 user IDs from the user list separated by commas, for example 7,12. Each ID is a positive integer without spaces or leading zeros. A repeated ID is allowed and counts toward the limit of 50 |
Any other parameter or a repeated parameter is rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/chats/chat123/users/membership?userIds=7,12" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/chats/chat123/users/membership?userIds=7,12" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat123/users/membership?userIds=7,12', {
headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
console.log('Not in the chat:', data.usersNotInChat)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat123/users/membership?userIds=7,12', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.usersInChat |
Typearray | DescriptionIDs of the requested users who are chat members |
Fielddata.usersNotInChat |
Typearray | DescriptionIDs of the requested users who are not chat members |
Fielddata.users |
Typearray | DescriptionBrief profiles of all requested users |
Fielddata.users[].id |
Typenumber | DescriptionUser ID |
Fielddata.users[].name |
Typestring | DescriptionFull name |
Fielddata.users[].avatar |
Typestring | DescriptionAvatar URL. An empty string when no avatar is set |
Fielddata.users[].color |
Typestring | DescriptionAvatar color in hexadecimal format |
Fielddata.users[].type |
Typestring | DescriptionUser type: user, extranet, bot and others |
Response example
{
"success": true,
"data": {
"usersInChat": [7],
"usersNotInChat": [12],
"users": [
{ "id": 7, "name": "John Brown", "avatar": "", "color": "#df532d", "type": "user" },
{ "id": 12, "name": "Anna Smith", "avatar": "", "color": "#1eb4aa", "type": "extranet" }
]
}
}
Error response example
400 — userIds was not sent:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "`userIds` is required: 1-50 Bitrix24 user ids separated by commas (4,7), each a positive integer without spaces or leading zeros."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionuserIds was not sent, more than 50 IDs were sent, or an ID is not a positive integer. The request has a parameter other than userIds or a repeated parameter. Checked before any call to Bitrix24 |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the im scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionRead-only key, and the chat is not confirmed: a value other than chatN was passed and the personal dialog was not found in the same employee's recent dialog list — up to 20 pages and 4000 rows — or the alias creates a dialog. Rejected before any call to Bitrix24 |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionRead-only key that is not an employee's personal key: an application key with a user session, a management key, or a key with an unconfirmed owner |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionBitrix24 answered "not found". The Bitrix24 code is in error.b24Code |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned an error. The Bitrix24 code is in error.b24Code. For a chat that does not exist, the code is CHAT_NOT_FOUND |
| HTTP502 | CodeME_ALIAS_RESOLUTION_FAILED |
DescriptionFailed to resolve the user when using the me alias |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable or returned a server error |
Full list of common API errors — Errors.
Known specifics
The call may make you a member. If the chat allows auto-join, the call adds the current user as a member, as when opening a chat. A READONLY key may make this call under two conditions: it is an employee's personal key, and the chat is confirmed — chatN was passed or the direct dialog was found in the same employee's recent dialogs. The read itself does not mark messages as read. The im scope and the user's Bitrix24 access still apply.