For AI agents: markdown of this page — /docs-content-en/entities/tasks/add-accomplices.md documentation index — /llms.txt
Add task accomplices
POST /v1/tasks/:taskId/add-accomplices
Adds users to a task as participants on behalf of the key's user.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParametertaskId (path) |
Typenumber | Requiredyes | DescriptionTask ID. List: GET /v1/tasks |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
FieldaccomplicesIds |
Typenumber[] | Requiredno | DescriptionIDs of the users to add as participants. List: GET /v1/users. If the field is omitted or the array is empty, the participants do not change and the response contains the current task |
Any field other than accomplicesIds is rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/add-accomplices' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"accomplicesIds":[42]}'
curl — OAuth application
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/add-accomplices' \
-H 'X-Api-Key: YOUR_APP_KEY' \
-H 'Authorization: Bearer USER_SESSION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"accomplicesIds":[42]}'
JavaScript — personal key
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/add-accomplices', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"accomplicesIds":[42]}),
})
const result = await response.json()
console.log(result.data.task.accomplices)
JavaScript — OAuth application
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/add-accomplices', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({"accomplicesIds":[42]}),
})
const result = await response.json()
console.log(result.data.task.accomplices)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata.task |
Typeobject | DescriptionThe full task object after the action. Values arrive in raw form: numbers as strings ("id": "289"), flags as Y or N ("taskControl": "N"). GET /v1/tasks/:id returns the same fields as numbers and true/false |
Fielddata.task.id |
Typestring | DescriptionTask ID |
Fielddata.task.accomplices |
Typestring[] | DescriptionParticipant IDs after the call |
Fielddata.task.action |
Typeobject | DescriptionWhich actions the key's user can take after the call: the key is the action name (start, pause, complete, approve, disapprove, defer, renew and others), the value is true or false |
Response example
Only the main fields of the task object are shown.
{
"success": true,
"data": {
"task": {
"id": "289",
"title": "Prepare the quarterly report",
"status": "2",
"createdBy": "1",
"responsibleId": "1",
"accomplices": ["42"],
"auditors": [],
"changedDate": "2026-10-19T17:20:02+02:00",
"taskControl": "N",
"action": {
"start": true,
"pause": false,
"complete": true,
"approve": false,
"disapprove": false,
"defer": true,
"renew": false
}
}
}
}
Error response example
422 — the task does not exist or is not accessible to the key's user:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Task not found or not accessible",
"b24Code": "1"
}
}
The error.message text comes from Bitrix24. Branch on error.code, not on the message text.
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptiontaskId is not a positive integer: taskId must be a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe request body is not a JSON object: body must be an object |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe body contains fields other than accomplicesIds: body contains unsupported fields |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionaccomplicesIds is not an array of positive integers: accomplicesIds must be an array of positive integers |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionX-Api-Key is missing |
| HTTP401 | CodeINVALID_API_KEY |
DescriptionThe key is not found |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no valid Bitrix24 token |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the task or tasks scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionThe key's user has no rights to the task |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo task exists with this taskId, or it is not accessible: Task not found or not accessible |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the action for another reason |
The full list of common API errors — Errors.