For AI agents: markdown of this page — /docs-content-en/humanresources.md documentation index — /llms.txt
Human resources
Organizational structure of a Bitrix24 account: departments and teams, their members and employees. The API lets you build and change the department tree, manage node membership, and search employees — without going through the account UI.
Scope: humanresources | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key
Documentation sections
- Org-structure nodes — create, read, update, list, and search departments and teams (5 endpoints).
- Node operations — child nodes, counter, moving within the tree, communication channels (5 endpoints).
- Node members — add, remove, move, and fully replace membership with roles (4 endpoints).
- Employees — search by name, subordinates, count, membership in several departments (4 endpoints).
What to know up front
- A node is a department or a team. The type is set by the
typevalue:DEPARTMENT(department) orTEAM(team). Thetypeparameter is required when listing (node list) and when creating. - Nodes cannot be deleted via the API. The section has no node-delete endpoint — the tree changes by creating, updating, and moving nodes.
- Member roles depend on the node type. For a department —
MEMBER_HEAD,MEMBER_DEPUTY_HEAD,MEMBER_EMPLOYEE. For a team —MEMBER_TEAM_HEAD,MEMBER_TEAM_DEPUTY_HEAD,MEMBER_TEAM_EMPLOYEE. Full list — in the Node members section. - Membership is returned only when fetching a single node. The node list and search return summary fields without members — membership comes in the node-get response.
- Listing nodes — by type only. Narrowing the output by an arbitrary node field is not supported. To find nodes by a substring of the name, use node search —
typeandnameare required. - The response shape depends on the endpoint. Node listing and search return an array in a flat
dataplusmeta(total,hasMore). Child nodes and employee search nest the array indata.items. Counters and single nodes return an object indata. The exact shape — in each endpoint's "Response fields" section.
Full example
A JavaScript scenario: create a department, nest a sub-department inside it, assign a head, view the tree, and move the sub-department to the top level.
const VIBE_KEY = process.env.VIBE_KEY
const BASE = 'https://vibecode.bitrix24.com/v1'
async function api(method, path, body = null) {
const opts = { method, headers: { 'X-Api-Key': VIBE_KEY } }
if (body) {
opts.headers['Content-Type'] = 'application/json'
opts.body = JSON.stringify(body)
}
const res = await fetch(`${BASE}${path}`, opts)
if (!res.ok) throw new Error(`${method} ${path} → ${res.status}`)
return res.json()
}
// 1. Create a department at the top level
const { data: parent } = await api('POST', '/humanresources/nodes', {
type: 'DEPARTMENT',
name: 'Development department',
parentId: 1,
})
console.log(`Department created: ${parent.id}`)
// 2. Create a sub-department inside it
const { data: child } = await api('POST', '/humanresources/nodes', {
type: 'DEPARTMENT',
name: 'Testing group',
parentId: parent.id,
})
// 3. Assign the department head
await api('POST', `/humanresources/nodes/${parent.id}/members/add`, {
userIds: [42],
role: 'MEMBER_HEAD',
})
// 4. View the department's child nodes
const { data: children } = await api('GET', `/humanresources/nodes/${parent.id}/children`)
console.log(`Child nodes: ${children.items.length}`)
// 5. Move the sub-department to the top level
await api('POST', `/humanresources/nodes/${child.id}/move`, { parentId: 1 })
console.log('Sub-department moved to the top level')
Endpoint reference
All 18 endpoints of the section. Links lead to pages with parameters, examples, and error codes.
Org-structure nodes:
| Method | Path | Bitrix24 method | Description |
|---|---|---|---|
| GET | /v1/humanresources/nodes |
humanresources.node.list | List of nodes of the selected type |
| GET | /v1/humanresources/nodes/:id |
humanresources.node.get | Node with its membership |
| POST | /v1/humanresources/nodes |
humanresources.node.add | Create a department or team |
| PATCH | /v1/humanresources/nodes/:id |
humanresources.node.edit | Update a node |
| POST | /v1/humanresources/nodes/search |
humanresources.node.search | Search nodes by name |
Node operations:
| Method | Path | Bitrix24 method | Description |
|---|---|---|---|
| GET | /v1/humanresources/nodes/:id/children |
humanresources.node.children | Child nodes |
| GET | /v1/humanresources/nodes/count |
humanresources.node.count | Number of nodes by type |
| POST | /v1/humanresources/nodes/:id/move |
humanresources.node.move | Move a node within the tree |
| GET | /v1/humanresources/nodes/:id/communications |
humanresources.node.communication.list | Node communication channels |
| PATCH | /v1/humanresources/nodes/:id/communications |
humanresources.node.communication.edit | Configure communication channels |
Node members:
| Method | Path | Bitrix24 method | Description |
|---|---|---|---|
| POST | /v1/humanresources/nodes/:id/members/add |
humanresources.node.member.add | Add members |
| POST | /v1/humanresources/nodes/:id/members/remove |
humanresources.node.member.remove | Remove members |
| POST | /v1/humanresources/nodes/:id/members/move |
humanresources.node.member.move | Move members |
| POST | /v1/humanresources/nodes/:id/members/set |
humanresources.node.member.set | Replace membership |
Employees:
| Method | Path | Bitrix24 method | Description |
|---|---|---|---|
| POST | /v1/humanresources/employees/search |
humanresources.employee.search | Search employees by name |
| GET | /v1/humanresources/employees/:id/subordinates |
humanresources.employee.subordinates | Employee subordinates |
| GET | /v1/humanresources/employees/count |
humanresources.employee.count | Number of employees |
| POST | /v1/humanresources/employees/multidepartment |
humanresources.employee.multidepartment | Employees in several departments |
Error codes
Section errors
| Code | HTTP | Description |
|---|---|---|
MISSING_REQUIRED_PARAMS |
400 | The required type parameter was not passed when listing nodes |
INVALID_PARAMS |
400 | Invalid :id in manual operations (id must be a positive integer) or request-body validation failed |
ENTITY_NOT_FOUND |
404 | Node with the given id not found |
NOT_FOUND |
404 | Unknown member operation in the path (allowed: add, remove, move, set) |
BITRIX_ERROR |
422 | An unsupported filter was passed when listing nodes |
System errors
| Code | HTTP | Description |
|---|---|---|
SCOPE_DENIED |
403 | The key lacks the humanresources scope |
TOKEN_MISSING |
401 | The API key has no Bitrix24 tokens configured |
BITRIX_ACCESS_DENIED |
403 | Insufficient permissions on the Bitrix24 portal |
BITRIX_UNAVAILABLE |
502 | The Bitrix24 portal is unavailable |
Full reference of common errors — Errors.