For AI agents: markdown of this page — /docs-content-en/humanresources/employees/count.md documentation index — /llms.txt

Number of employees

GET /v1/humanresources/employees/count

Returns the total number of employees in the Bitrix24 account's organizational structure. The endpoint is called without parameters and returns a single counter field.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/humanresources/employees/count" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth app

Terminal
curl "https://vibecode.bitrix24.com/v1/humanresources/employees/count" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/employees/count', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log(`Employees in the org structure: ${data.total}`)

JavaScript — OAuth app

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/employees/count', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()

Response fields

Field Type Description
success boolean Always true on success
data.total number Total number of employees in the organizational structure

Response example

JSON
{
  "success": true,
  "data": {
    "total": 36
  }
}

Error response example

403 — the key lacks the humanresources scope:

JSON
{
  "success": false,
  "error": {
    "code": "SCOPE_DENIED",
    "message": "This endpoint requires 'humanresources' scope"
  }
}

Errors

HTTP Code Description
403 SCOPE_DENIED The key lacks the humanresources scope
401 TOKEN_MISSING The API key has no Bitrix24 tokens configured

Full list of common API errors — Errors.

See also