For AI agents: markdown of this page — /docs-content-en/humanresources/nodes/update.md documentation index — /llms.txt
Update node
PATCH /v1/humanresources/nodes/:id
Updates an org structure node of a Bitrix24 account — a department or a team in the department tree. The body carries only the fields to change, flat at the JSON root without a fields wrapper.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionNode identifier. List: GET /v1/humanresources/nodes |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldname |
Typestring | Requiredno | DescriptionNode name |
Fielddescription |
Typestring | Requiredno | DescriptionNode description |
FieldcolorName |
Typestring | Requiredno | DescriptionNode color code, for example blue or AZURE |
The update does not accept the parent or the node type — both are set once, at creation. To move a node elsewhere in the tree, use Move node.
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/humanresources/nodes/39" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales department",
"description": "Updated description"
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/humanresources/nodes/39" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales department",
"description": "Updated description"
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/nodes/39', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Sales department',
description: 'Updated description',
}),
})
const { success, data } = await res.json()
console.log('Updated node:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/humanresources/nodes/39', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Sales department',
description: 'Updated description',
}),
})
const { success, data } = await res.json()
Response fields
Returns the full record of the node after the update.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionThe node after the update. Field schema — Node fields |
Fielddata.id |
Typenumber | DescriptionNode identifier |
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 |
Fielddata.userCount |
Typenumber | DescriptionNumber of employees in the node |
Fielddata.colorName |
Typestring | DescriptionNode color |
Fielddata.xmlId |
Typestring | DescriptionExternal identifier of the node |
Fielddata.createdAt |
Typedatetime | DescriptionCreation date. Returned as null in the update response |
Fielddata.updatedAt |
Typedatetime | DescriptionLast update date. Returned as null in the update response |
Fielddata.members |
Typearray | DescriptionList of node members |
Response example
{
"success": true,
"data": {
"id": 39,
"name": "Sales department",
"type": "DEPARTMENT",
"structureId": 1,
"parentId": 17,
"description": "Updated description",
"accessCode": "SN39",
"userCount": 0,
"colorName": "blue",
"xmlId": null,
"createdAt": null,
"updatedAt": null,
"members": []
}
}
Error response example
404 — node with the given id not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Record with ID = `0` not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo node with the given id exists |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe body contains parentId, type, or another field that cannot be changed. The field name is given in message |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA passed field failed validation |
| 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
Dates in the update response. The createdAt and updatedAt fields are returned as null in the update response. To get the current dates, request the node via GET /v1/humanresources/nodes/:id.