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

Runs tasks.task.addAccomplices once. Requires the task scope (or tasks alias), a write-enabled key, and the Bitrix24 user's permission for the action.

Parameters

Parameter In Type Required Description
taskId path integer yes Positive task ID from task list.
accomplicesIds body integer[] no Positive IDs from users. If omitted or empty, Bitrix24 returns the current task without adding users.

Examples

curl — personal key

Terminal
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

Terminal
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

javascript
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)

JavaScript — OAuth application

javascript
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)

Response

Field Type Description
success boolean true on success.
data any Unmodified Bitrix24 method result: a task object, null, or another method-specific value.

The example below shows one possible response form; it does not guarantee null.

JSON
{"success":true,"data":null}

Error response example

An invalid task ID in the path returns 400:

JSON
{"success":false,"error":{"code":"INVALID_PARAMS","message":"taskId must be a positive integer"}}

Errors

HTTP Code Condition
400 INVALID_PARAMS Invalid taskId or body field.
401 MISSING_API_KEY API key is missing.
401 INVALID_API_KEY API key is unknown.
401 TOKEN_MISSING No usable Bitrix24 token.
403 SCOPE_DENIED Key lacks the task or tasks scope.
403 WRITE_BLOCKED_READONLY_KEY The key cannot write.
403 BITRIX_ACCESS_DENIED Bitrix24 denied access.
422 BITRIX_ERROR Bitrix24 rejected the action.

Other shared API errors may apply. Branch on error.code; see the full error reference.

See also