For AI agents: markdown of this page — /docs-content-en/entities/tasks/approve.md documentation index — /llms.txt
Approve task
POST /v1/tasks/:taskId/approve
Accepts the result of a task awaiting the creator's review and moves it to the Completed status.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParametertaskId (path) |
Typenumber | Requiredyes | DescriptionTask ID. List: GET /v1/tasks |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldparams |
Typeobject | Requiredno | DescriptionAdditional action parameters. Passed to Bitrix24 unchanged |
The request body can be empty or {}. Any field other than params is rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/approve' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
curl — OAuth application
curl -X POST 'https://vibecode.bitrix24.com/v1/tasks/289/approve' \
-H 'X-Api-Key: YOUR_APP_KEY' \
-H 'Authorization: Bearer USER_SESSION_TOKEN' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript — personal key
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/approve', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
})
const result = await response.json()
console.log(result.data.task.status)
JavaScript — OAuth application
const response = await fetch('https://vibecode.bitrix24.com/v1/tasks/289/approve', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
})
const result = await response.json()
console.log(result.data.task.status)
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": "Y"). GET /v1/tasks/:id returns the same fields as numbers and true/false |
Fielddata.task.id |
Typestring | DescriptionTask ID |
Fielddata.task.status |
Typestring | DescriptionStatus after the action, here 5 — Completed. Value meanings: GET /v1/tasks/fields → fields.status.enum |
Fielddata.task.closedBy |
Typestring | DescriptionID of the user who closed the task. List: GET /v1/users |
Fielddata.task.closedDate |
Typestring | DescriptionClosing date, ISO 8601 |
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": "5",
"statusChangedDate": "2026-10-13T13:46:50+02:00",
"createdBy": "27",
"responsibleId": "1",
"closedBy": "1",
"closedDate": "2026-10-13T13:46:50+02:00",
"taskControl": "Y",
"action": {
"start": false,
"pause": false,
"complete": false,
"approve": false,
"disapprove": false,
"defer": false,
"renew": true
}
}
}
}
Error response example
422 — the task is not awaiting review, for example because it is already completed:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Action unavailable",
"b24Code": "1048582"
}
}
The error.message text comes from Bitrix24, so its wording and language depend on the Bitrix24 account language. 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 params: body contains unsupported fields |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionparams is not an object: params must be an object |
| 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 |
DescriptionThe task is not in the Awaiting Control status: Action unavailable |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo task exists with this taskId. The message is the same: Action unavailable |
The full list of common API errors — Errors.
Known specifics
- The action works only on a task in the Awaiting Control status. A task reaches this status when its
taskControlreview is enabled and someone other than the creator completes it. Approval moves it to Completed. A repeated call on a completed task returns422 BITRIX_ERROR. - Availability is visible in advance. The
actionmap in theGET /v1/tasks/:idresponse showsapprove: truewhen the key's user can approve the task right now. Checking it before the call avoids a422response. - A missing task does not return
404. An unknowntaskIdgets the same422 BITRIX_ERRORwith the messageAction unavailableas a task in the wrong status. To tell the two apart, request the task withGET /v1/tasks/:id: for a missing task it returns404.