For AI agents: markdown of this page — /docs-content-en/infra/access/b24-users.md documentation index — /llms.txt

Search Bitrix24 users

GET /v1/infra/servers/:id/b24-users

Searches for active employees in the Bitrix24 account by first name, last name, or email — returns userId, name, position, and photo for each match. Inactive users and other user types are excluded. Used to populate the NAMED_USERS list via POST /access when a person's name is known but not their Bitrix24 account ID. Works through the server's Bitrix24 credentials: the webhook key from apiKey.webhookUrl, or — when the server key is an OAuth app without a user token — an automatic fallback: first the linked application's personal key, then the server owner's own personal keys, newest to oldest, until one actually grants Bitrix24 access. If neither source yields credentials (the app is not authorized on the account, the key was revoked, or the managing key has no Bitrix24 access — for example, no webhook or required scope), the endpoint returns an empty data together with a hint field explaining why.

Parameters

Parameter In Type Req. Description
id path string (UUID) yes Server ID
search query string yes Search string, minimum 2 characters. Searches by first name, last name, and email

Examples

curl — personal key

Terminal
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/b24-users?search=John"

curl — OAuth application

Terminal
curl -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/b24-users?search=John"

JavaScript — personal key

javascript
const q = encodeURIComponent('John')
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/b24-users?search=${q}`,
  { headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const { data: users } = await res.json()
users.forEach(u => console.log(`${u.id}: ${u.name} — ${u.position ?? 'no position'}`))

JavaScript — OAuth application

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/b24-users?search=${q}`,
  {
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  }
)

Response fields

Field Type Description
success boolean Always true on success
data array Array of matching active employees
data[].id string Bitrix24 user ID — pass it in userId for POST /access
data[].name string Full name (first name + last name)
data[].photo string | null Avatar URL (may be null)
data[].position string | null Position (may be null)
hint string Optional. Present only when data is empty because no Bitrix24 credentials resolved (the app is not authorized on the account, the key was revoked, or the managing key has no webhook/required scope). Absent on a populated response

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": "243",
      "name": "Kate Smith",
      "photo": null,
      "position": null
    }
  ]
}

Error response example

400 — search string shorter than 2 characters:

JSON
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "search query required (min 2 chars)"
  }
}

Errors

HTTP Code Description
400 VALIDATION_ERROR search is missing or shorter than 2 characters
401 MISSING_API_KEY The X-Api-Key header was not provided
401 INVALID_API_KEY Invalid or expired API key
403 SERVER_ROLE_FORBIDDEN You are on this server's development team with the Developer role, and this operation is open to the Administrator role. error.hint carries your role, the required threshold and the list of calls that are open to you. Role breakdown — List servers
404 NOT_FOUND The server does not exist, was deleted, or belongs to another API key while you are not on its development team
429 RATE_LIMITED The platform's overall request limit was exceeded

The full list of common API errors — Errors.

Known specifics

  • Empty data with a hint field when no Bitrix24 credentials resolve. If the server key is an OAuth app without a user token, the platform first tries the linked application's personal key, then walks the server owner's own personal keys, newest to oldest. If none of them grants access (no application, keys revoked/expired, owner blocked, or no key has a webhook/the required scope), the endpoint returns data: [] and a hint string with the reason — instead of a mute empty array. The client can show the hint to the user or switch to an alternative tool.
  • The search runs through the user.search method in the Bitrix24 account. That means matching follows the Bitrix24 account UI — the same rules for first name/last name/email.
  • Non-ASCII characters in the URL — via encodeURIComponent. In JS: encodeURIComponent('Müller'). In curl: ?search=M%C3%BCller.
  • Independent of the server mode. The search works for any server — both BLACKHOLE and OPEN. Logically it is needed for NAMED_USERS, but the endpoint does not restrict the call by mode.

See also