For AI agents: markdown of this page — /docs-content-en/entities/tasks/update.md documentation index — /llms.txt
Update task
PATCH /v1/tasks/:id
Updates the fields of an existing task. Pass only the fields you want to change. Full list — Task fields.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionTask ID |
Request fields (body)
Pass only the fields you want to change — that is PATCH behavior. Other values are left unchanged.
| Field | Type | Description |
|---|---|---|
Fieldtitle |
Typestring | DescriptionTitle |
Fielddescription |
Typestring | DescriptionTask description (supports BB-code) |
FieldresponsibleId |
Typenumber | DescriptionNew responsible person. Employee list: GET /v1/users |
FieldcreatedBy |
Typenumber | DescriptionNew creator. Applied within the permissions of the calling user. An existing employee only — see the warning below the table. Employee list: GET /v1/users |
Fieldstatus |
Typenumber | DescriptionTask status. Full value list: GET /v1/tasks/fields → fields.status.enum |
Fieldpriority |
Typenumber | DescriptionPriority: 0 — low, 1 — normal, 2 — high |
Fielddeadline |
Typedatetime | DescriptionDeadline (ISO 8601) |
FieldstartDatePlan |
Typedatetime | DescriptionPlanned start date |
FieldendDatePlan |
Typedatetime | DescriptionPlanned end date |
FieldtimeEstimate |
Typenumber | DescriptionEffort estimate in seconds |
FieldgroupId |
Typenumber | DescriptionWorkgroup. List: GET /v1/workgroups |
FieldparentId |
Typenumber | DescriptionParent task. List: GET /v1/tasks |
Fieldaccomplices |
Typenumber[] | DescriptionParticipants. Employee list: GET /v1/users |
Fieldauditors |
Typenumber[] | DescriptionObservers. Employee list: GET /v1/users |
Fieldtags |
Typestring[] | DescriptionTask tags |
FieldxmlId |
Typestring | DescriptionExternal code that matches the task to a record in your system, up to 50 characters. A longer value is not rejected — only the first 50 are stored, and filter[xmlId] does not find the task by the original value |
FieldufTaskWebdavFiles |
Typestring[] | DescriptionTask files. An array of strings shaped as n<id>, where id is the file identifier from the POST /v1/files/upload response. A write replaces the whole attachment list. An empty array removes every attachment. Clearing with an empty array works on POST /v1/tasks and PATCH /v1/tasks/:id; in a batch request (POST /v1/batch, POST /v1/tasks/batch) an empty array does not reach the wire and the attachments stay in place, so clear attachments with a standalone request. The full rule for file fields — Task fields |
FieldchangedBy |
Typenumber | DescriptionService field: who last changed the task. Accepted on write — see the section below the table. Employee list: GET /v1/users |
FieldclosedBy |
Typenumber | DescriptionService field: who closed the task. Accepted on write — see the section below the table. Employee list: GET /v1/users |
FieldstatusChangedBy |
Typenumber | DescriptionService field: who last changed the status. Accepted on write — see the section below the table. Employee list: GET /v1/users |
FieldcreatedDate |
Typedatetime | DescriptionService field: task creation date, ISO 8601. Accepted on write — see the section below the table |
FieldchangedDate |
Typedatetime | DescriptionService field: last change date, ISO 8601. The value you send is stored instead of the current time — see the section below the table |
FieldclosedDate |
Typedatetime | DescriptionService field: closing date, ISO 8601. Accepted on write even for a task that is not closed — see the section below the table |
The fields id, dateStart, activityDate, realStatus are read-only and cannot be passed in the body.
Task service fields can be set
createdBy (creator), changedBy, closedBy, statusChangedBy, createdDate, changedDate, closedDate are accepted both on create and on update: Bitrix24 stores the submitted values, and Vibecode is a wrapper over it that does not forbid what the platform allows. Both spellings are accepted — createdBy and CREATED_BY alike. Send one of the two rather than both: if both are present in one body, the one that comes later is applied, with no warning.
The value is applied within the permissions of the calling user. When Bitrix24 refuses to edit the task, the refusal is passed through as is — a 422 with Bitrix24's own message, not replaced by an error of ours and never reported as a success.
What the task log shows. Bitrix24 records a change of the creator in the task change log, and the entry shows the actual calling user, not the one passed in createdBy. For the other six fields no such log entry exists: the value in the card does not tell you who set it.
A date without a time zone. For createdDate, changedDate and closedDate, a value like 2019-05-15T13:47:00 sent under the createdDate spelling gets the offset of your time zone from the X-Vibe-Timezone header, while under the CREATED_DATE spelling it is passed through unchanged and read in the key owner's time zone. Send the date with an offset — 2019-05-15T13:47:00+00:00 — and both spellings yield the same instant.
Only the Bitrix24 permission model can restrict overwriting the service fields — that is a separate change on the platform side, not in our wrapper.
Pass an existing employee only. Bitrix24 does not check that the user ID exists in any of
createdBy,changedBy,closedBy,statusChangedBy— it stores any number. A task whose creator does not exist stops being manageable through the API: Bitrix24 refuses both further updates and deletion (This task action is not allowed.), through the wrapper and directly alike, even for an administrator key. That outcome was verified oncreatedBy. The ID is not validated in the other three fields either, so pass an existing employee there too. Employee list:GET /v1/users.
Frequently updated fields
| Field | When used |
|---|---|
Fieldstatus |
When usedClosing (5), returning to work (3), declining (7). Value reference: GET /v1/tasks/fields → fields.status.enum |
FieldresponsibleId |
When usedReassigning the task to another employee. Source: GET /v1/users |
Fielddeadline |
When usedRescheduling the deadline (ISO 8601 with the Bitrix24 account's time zone offset) |
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/tasks/3871" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": 5,
"priority": 2
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/tasks/3871" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": 5,
"priority": 2
}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/3871', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
status: 5,
priority: 2,
}),
})
const { success, data } = await res.json()
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/3871', {
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
status: 5,
priority: 2,
}),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionThe updated task object with all fields — see Task fields |
Response example
{
"success": true,
"data": {
"id": 3871,
"title": "Prepare the quarterly report",
"status": 5,
"priority": 2,
"responsibleId": 1,
"createdBy": 1,
"createdDate": "2026-05-12T11:46:12.000Z",
"changedDate": "2026-05-12T13:02:48.000Z",
"closedDate": "2026-05-12T13:02:48.000Z",
"deadline": "2026-05-19T18:00:00.000Z",
"accomplices": [],
"auditors": []
}
}
Error response example
400 — attempt to change a read-only field:
{
"success": false,
"error": {
"code": "READONLY_FIELD",
"message": "Field 'activityDate' is read-only and cannot be set"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the update — for example, a task with this ID is unavailable or does not exist, or a submitted value was rejected by the portal |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionA related entity was not found — for example, responsibleId points to a non-existent employee |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionAn attempt to update a read-only field (id, dateStart, activityDate, realStatus) |
| HTTP400 | CodeINVALID_DISK_ATTACHMENT_VALUE |
DescriptionA file field was passed as something other than an array of n<id> strings — a number, a string without the prefix, or a single string instead of an array |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the tasks scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
The full list of common API errors — Errors.
Known specifics
Closing a task. To mark a task as done, send status: 5. After that Bitrix24 fills in closedDate on its own when the task moves to status 5 (completed) or 6 (deferred). You can also pass closedDate manually — see the service-fields section above. When the field is omitted, the platform sets it for you.