For AI agents: markdown of this page — /docs-content-en/entities/workgroups/users.md documentation index — /llms.txt
Workgroup members
GET /v1/workgroups/:groupId/users
Returns the members of a workgroup together with their role in it — owner, moderator or member.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ParametergroupId (path) |
Typenumber | Required★ yes | Default— | DescriptionWorkgroup identifier. List: GET /v1/workgroups |
The operation takes no pagination parameters: the whole roster is returned.
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/workgroups/85/users" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/workgroups/85/users" \
-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/workgroups/85/users', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
const moderators = data.filter(m => m.role === 'A' || m.role === 'E')
console.log('Owners and moderators:', moderators.length)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/workgroups/85/users', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata[].userId |
Typenumber | DescriptionUser identifier. Record: GET /v1/users |
Fielddata[].role |
Typestring | DescriptionRole of the user in the group: A owner, E moderator, K member |
Fieldmeta.total |
Typenumber | DescriptionNumber of members. Always equals the length of data |
Fieldmeta.warnings[] |
Typeobject | DescriptionPresent only in two special cases — see "Known specifics" |
Response example
{
"success": true,
"data": [
{ "userId": 1269, "role": "A" },
{ "userId": 1271, "role": "E" },
{ "userId": 779, "role": "K" }
],
"meta": {
"total": 3
}
}
Error response example
404 — there is no group with this groupId, or it is not visible to this key:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Workgroup not found, or not visible to the identity this key acts as"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptiongroupId is not a canonical positive integer |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionX-Api-Key was not sent |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not recognized — no such key exists on the platform |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key carries no Bitrix24 tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the sonet_group scope |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe group does not exist, or is not visible to the account the key acts as |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 returned a response or a member row this endpoint cannot parse |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 accepted the call but did not answer in time. Carries a Retry-After header |
The full list of common API errors — Errors.
Known specifics
- The role arrives as the Bitrix24 letter, verbatim. An unrecognized letter is passed through rather than mapped onto a known one or dropped, so the contract survives a role Bitrix24 may add later. Branch on the values you know and treat anything else as no permission — never default to "member".
- The owner is not necessarily among the rows. The owner identifier is served by the
ownerIdfield ofGET /v1/workgroups/:id; do not infer the owner from the presence of a row with roleA. - An empty roster is an ordinary answer, not an error. An existing group may have no members recorded at all, in which case
200arrives with an emptydata. 404does not mean "the group does not exist". Bitrix24 refuses a missing group and a group invisible to this key identically, so the two cannot be told apart on the API side.- This is membership data, not an authorization decision. What the endpoint shows depends on the identity behind the key: a personal key and a webhook read as their owner, while an OAuth key with a forwarded user session reads as that user. Bitrix24 account administrator status is not part of this answer — it is served by
GET /v1/users/me. An "owner, moderator or Bitrix24 account administrator" gate is assembled from two sources. - A non-numeric or fractional
groupIdreturns400rather than another group's data. Bitrix24 truncates such an identifier and would answer with a different group's roster — the platform refuses the request before the call. - There is no pagination:
limitandoffsetare not accepted and are ignored, the whole roster is returned, andmeta.totalalways equals the length ofdata. meta.warningsappears in two cases only:DUPLICATE_MEMBER_ROW— Bitrix24 returned more than one row for the same user (rows are passed through as they are; if their roles disagree, treat the membership as ambiguous), andMEMBER_ROSTER_PAGE_BOUNDARY— exactly 50 rows came back, which is indistinguishable from a truncated first page; cross-check themembersCountfield ofGET /v1/workgroups/:idwhen the exact roster matters.- The operation is not available through
POST /v1/batch— nested resources are not addressable there.