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 |
|---|---|---|---|---|
dialogId (path) |
string | yes | — | Dialog 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 |
userIds (query) |
string | yes | — | From 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 |
|---|---|---|
success |
boolean | Always true on success |
data.usersInChat |
array | IDs of the requested users who are chat members |
data.usersNotInChat |
array | IDs of the requested users who are not chat members |
data.users |
array | Brief profiles of all requested users |
data.users[].id |
number | User ID |
data.users[].name |
string | Full name |
data.users[].avatar |
string | Avatar URL. An empty string when no avatar is set |
data.users[].color |
string | Avatar color in hexadecimal format |
data.users[].type |
string | User 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 |
|---|---|---|
| 400 | INVALID_PARAMS |
userIds 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 |
| 403 | SCOPE_DENIED |
The API key does not have the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is in read-only mode, and either the request is not made with an employee's personal key or dialogId does not point to an existing dialog |
| 401 | TOKEN_MISSING |
The API key has no Bitrix24 tokens configured |
| 404 | ENTITY_NOT_FOUND |
Bitrix24 answered "not found". The Bitrix24 code is in error.b24Code |
| 422 | BITRIX_ERROR |
Bitrix24 returned an error. The Bitrix24 code is in error.b24Code. For a chat that does not exist, the code is CHAT_NOT_FOUND |
| 502 | ME_ALIAS_RESOLUTION_FAILED |
Failed to resolve the user when using the me alias |
| 502 | BITRIX_UNAVAILABLE |
Bitrix24 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. This read is allowed for a READONLY key under a narrow exception. On its own it does not mark messages as read. The im scope and the user's Bitrix24 access still apply.