For AI agents: markdown of this page — /docs-content-en/humanresources/nodes/create.md documentation index — /llms.txt
Create node
POST /v1/humanresources/nodes
Creates a node in the org structure of a Bitrix24 account: a department or a team in the department tree. The node type is set by the type field; fields are passed flat at the JSON root without a fields wrapper.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldtype |
Typestring | Requiredyes | DescriptionNode type: DEPARTMENT (department) or TEAM (team) |
Fieldname |
Typestring | Requiredyes | DescriptionNode name |
FieldparentId |
Typenumber | Requiredno | DescriptionParent node identifier in the tree. List: GET /v1/humanresources/nodes |
Fielddescription |
Typestring | Requiredno | DescriptionNode description |
FieldcolorName |
Typestring | Requiredno | DescriptionNode color code, for example blue or AZURE |
FielduserIds |
Typeobject | Requiredno | DescriptionMembers by role, assigned at creation: { "MEMBER_HEAD": [1], "MEMBER_EMPLOYEE": [2, 3] }. The key is the role, the value is an array of identifiers (not a flat array, unlike adding members) |
FieldmoveUsersToNode |
Typeboolean | Requiredno | DescriptionMove the employees in userIds to the new node, removing them from their previous ones. Defaults to false |
FieldcreateChat |
Typeboolean | Requiredno | DescriptionCreate a group chat for the node. Defaults to false |
FieldbindingChatIds |
Typenumber[] | Requiredno | DescriptionIdentifiers of existing chats to bind to the node |
FieldcreateChannel |
Typeboolean | Requiredno | DescriptionCreate a channel for the node. Defaults to false |
FieldbindingChannelIds |
Typenumber[] | Requiredno | DescriptionIdentifiers of existing channels to bind |
FieldcreateCollab |
Typeboolean | Requiredno | DescriptionCreate a collab for the node. Defaults to false |
FieldbindingCollabIds |
Typenumber[] | Requiredno | DescriptionIdentifiers of existing collabs to bind |
Fields filled in by the system (id, structureId, accessCode, userCount, xmlId, createdAt, updatedAt) must not be passed in the body: a request with any of them is rejected with the READONLY_FIELD error. These fields are returned in the response.
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/humanresources/nodes" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "DEPARTMENT",
"name": "Sales department",
"parentId": 1,
"description": "Active sales managers",
"colorName": "blue"
}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/humanresources/nodes" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "DEPARTMENT",
"name": "Sales department",
"parentId": 1,
"description": "Active sales managers",
"colorName": "blue"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/nodes', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'DEPARTMENT',
name: 'Sales department',
parentId: 1,
description: 'Active sales managers',
colorName: 'blue',
}),
})
const { success, data } = await res.json()
console.log('Node ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/nodes', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'DEPARTMENT',
name: 'Sales department',
parentId: 1,
description: 'Active sales managers',
colorName: 'blue',
}),
})
const { success, data } = await res.json()
Response fields
Returns the full record of the created node.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionThe created node. Field schema — Node fields |
Fielddata.id |
Typenumber | DescriptionIdentifier of the created node |
Fielddata.name |
Typestring | DescriptionNode name |
Fielddata.type |
Typestring | DescriptionNode type: DEPARTMENT or TEAM |
Fielddata.structureId |
Typenumber | DescriptionIdentifier of the structure the node belongs to |
Fielddata.parentId |
Typenumber | DescriptionParent node identifier |
Fielddata.description |
Typestring | DescriptionNode description |
Fielddata.accessCode |
Typestring | DescriptionNode access code generated by the system |
Fielddata.userCount |
Typenumber | DescriptionNumber of employees in the node. 0 for a new node |
Fielddata.colorName |
Typestring | DescriptionNode color |
Fielddata.xmlId |
Typestring | DescriptionExternal identifier of the node |
Fielddata.createdAt |
Typedatetime | DescriptionCreation date |
Fielddata.updatedAt |
Typedatetime | DescriptionLast update date |
Fielddata.members |
Typearray | DescriptionList of node members. An empty array for a new node |
Response example
{
"success": true,
"data": {
"id": 39,
"name": "Sales department",
"type": "DEPARTMENT",
"structureId": 1,
"parentId": 1,
"description": "Active sales managers",
"accessCode": "SN39",
"userCount": 0,
"colorName": "blue",
"xmlId": null,
"createdAt": "2026-06-03T13:06:45.000Z",
"updatedAt": "2026-06-03T13:06:45.000Z",
"members": []
}
}
Error response example
400 — required field name not provided:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "Request object validation failed",
"validation": [
{
"field": "MISSING_NAME",
"message": "Parameter \"name\" is required."
}
]
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA required field was not provided. error.validation contains the marker MISSING_NAME (name missing) or MISSING_TYPE (type missing) |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe body contains a field filled in by the system, such as id or accessCode. The field name is given in message |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the humanresources scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
The full list of common API errors — Errors.
Known specifics
Initial node setup in a single request. Besides the base fields, you can set the member roster by role (userIds) and communication tools right at creation: create a chat, channel or collab (createChat / createChannel / createCollab) or bind existing ones by identifiers (bindingChatIds / bindingChannelIds / bindingCollabIds). These fields are optional — without them an empty node is created.
Batch creation
POST /v1/humanresources/nodes/batch accepts action: "create" and an items array containing the node fields described above. For example: {"action":"create","items":[{"type":"DEPARTMENT","name":"Sales","parentId":1},{"type":"DEPARTMENT","name":"Support","parentId":1}]}.
The response is HTTP 200 with data.results and data.summary. A successful item contains index (its zero-based position in the original array), success: true and id. A failed item contains the same index, success: false, error and message. summary contains total, succeeded and failed; check each item even with HTTP 200. One failed item does not undo the successful writes of the other items. Each item requires a separate Bitrix24 call. Items are created sequentially to avoid conflicting changes to the shared structure.
| HTTP | Item code | Condition |
|---|---|---|
| HTTP200 | Item codeWRITE_OUTCOME_UNKNOWN |
ConditionBitrix24 responded without a valid created node ID. The item contains details.outcome: "unknown" and details.retryable: false |
Timeouts and other errors with an uncertain outcome also contain details.outcome: "unknown" and details.retryable: false, preserving their own error code. The node may already exist in the Bitrix24 account: check the node list before trying again. Do not automatically retry such an item.