For AI agents: markdown of this page — /docs-content-en/entities/tasks/defer.md documentation index — /llms.txt
Defer task
POST /v1/tasks/:taskId/defer
Moves a task from the Pending status to Deferred so you can come back to it later.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
taskId (path) |
number | yes | Task ID. List: GET /v1/tasks |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
params |
object | no | Additional 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/defer' \
-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/defer' \
-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/defer', {
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/defer', {
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 |
|---|---|---|
success |
boolean | true on success |
data.task |
object | The 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 |
data.task.id |
string | Task ID |
data.task.status |
string | Status after the action, here 6 — Deferred. Value meanings: GET /v1/tasks/fields → fields.status.enum |
data.task.statusChangedDate |
string | When the status changed, ISO 8601 |
data.task.action |
object | Which 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": "6",
"statusChangedDate": "2026-10-13T13:46:53+02:00",
"createdBy": "1",
"responsibleId": "1",
"closedDate": null,
"taskControl": "Y",
"action": {
"start": false,
"pause": false,
"complete": true,
"approve": false,
"disapprove": false,
"defer": false,
"renew": true
}
}
}
}
Error response example
422 — the task is in progress or already deferred:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Action is not available",
"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 |
|---|---|---|
| 400 | INVALID_PARAMS |
taskId is not a positive integer: taskId must be a positive integer |
| 400 | INVALID_PARAMS |
The request body is not a JSON object: body must be an object |
| 400 | INVALID_PARAMS |
The body contains fields other than params: body contains unsupported fields |
| 400 | INVALID_PARAMS |
params is not an object: params must be an object |
| 401 | MISSING_API_KEY |
X-Api-Key is missing |
| 401 | INVALID_API_KEY |
The key is not found |
| 401 | TOKEN_MISSING |
The key has no valid Bitrix24 token |
| 403 | SCOPE_DENIED |
The key lacks the task or tasks scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is read-only |
| 403 | BITRIX_ACCESS_DENIED |
The key's user has no rights to the task |
| 422 | BITRIX_ERROR |
The task is not in the Pending status |
| 422 | BITRIX_ERROR |
No task exists with this taskId. The message is the same as for the wrong status |
The full list of common API errors — Errors.
Known specifics
- The action works only on a task in the Pending status. A task in progress cannot be deferred: pause it first. A repeated call on a deferred task also returns
422. - How to bring a deferred task back. A deferred task can be renewed, which returns it to Pending, or completed right away. It cannot be started directly.
- Availability is visible in advance. The
actionmap in theGET /v1/tasks/:idresponse showsdefer: truewhen the key's user can defer the task right now. - A missing task does not return
404. An unknowntaskIdgets the same422 BITRIX_ERRORand message as a task in the wrong status. To tell the two apart, request the task withGET /v1/tasks/:id: for a missing task it returns404.