For AI agents: markdown of this page — /docs-content-en/entities/tasks/delegate.md documentation index — /llms.txt
Delegate task
POST /v1/tasks/:taskId/delegate
Runs tasks.task.delegate 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. |
userId |
body | integer | yes | New assignee; ID from users. |
params |
body | object | no | Optional Bitrix24 parameters, passed through unchanged. |
Examples
curl — personal key
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/delegate' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"userId":42}'
curl — OAuth application
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/delegate' \
-H 'X-Api-Key: YOUR_APP_KEY' \
-H 'Authorization: Bearer USER_SESSION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"userId":42}'
JavaScript — personal key
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/delegate', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"userId":42}),
})
const result = await response.json()
console.log(result.data)
JavaScript — OAuth application
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/delegate', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({"userId":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.
{"success":true,"data":null}
Error response example
An invalid task ID in the path returns 400:
{"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.