لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/tasks.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Tasks

Manage tasks in the Bitrix24 account: create, read, update, delete, filter, aggregate. A task is a unit of work with a responsible person, a creator, a deadline, and a status. A single task may have comments and time-tracking records — these are separate nested resources.

Bitrix24 API: tasks.task.* Scope: tasks

Create task

POST /v1/tasks

Creates a new task. Requires at least a title and a responsible person.

Request fields (body)

Field Type Required Description
Fieldtitle Typestring Required★ DescriptionTask title
FieldresponsibleId Typenumber Required★ DescriptionResponsible person. Employee list: GET /v1/users
Fielddescription Typestring Required DescriptionTask description. Supports BB-code ([USER=ID]Name[/USER], [B]...[/B], [QUOTE]...[/QUOTE])
Fieldpriority Typenumber Required DescriptionPriority: 0 — low, 1 — normal (default), 2 — high
Fieldstatus Typenumber Required DescriptionStatus. Defaults to 2 (pending). Full value list: GET /v1/tasks/fields → fields.status.enum
Fielddeadline Typedatetime Required DescriptionDeadline (ISO 8601)
FieldstartDatePlan Typedatetime Required DescriptionPlanned start date
FieldendDatePlan Typedatetime Required DescriptionPlanned end date
FieldtimeEstimate Typenumber Required DescriptionEffort estimate in seconds
FieldgroupId Typenumber Required DescriptionWorkgroup. List: GET /v1/workgroups
FieldparentId Typenumber Required DescriptionParent task. List: GET /v1/tasks
Fieldaccomplices Typenumber[] Required DescriptionParticipants. Employee list: GET /v1/users
Fieldauditors Typenumber[] Required DescriptionObservers. Employee list: GET /v1/users
Fieldtags Typestring[] Required DescriptionTask tags (an array of tag names; accepted directly on create)
FieldxmlId Typestring Required DescriptionExternal code that matches the task to a record in your system, up to 50 characters — see the warning below the table. Look it up with GET /v1/tasks?filter[xmlId]=<value>
FieldufTaskWebdavFiles Typestring[] Required DescriptionTask files. An array of strings shaped as n<id>, where id is the file identifier from the POST /v1/files/upload response. For example, ["n9759"]. The full rule for file fields — Task fields
FieldcreatedBy Typenumber Required DescriptionCreator. Defaults to the key owner. An override is applied within the calling user's permissions. An existing employee only — see the warning below the table. Employee list: GET /v1/users
FieldchangedBy Typenumber Required DescriptionService field: who last changed the task. Accepted on write — see the section below the table. Employee list: GET /v1/users
FieldclosedBy Typenumber Required DescriptionService field: who closed the task. Accepted on write — see the section below the table. Employee list: GET /v1/users
FieldstatusChangedBy Typenumber Required DescriptionService field: who last changed the status. Accepted on write — see the section below the table. Employee list: GET /v1/users
FieldcreatedDate Typedatetime Required DescriptionService field: task creation date, ISO 8601. Accepted on write — see the section below the table
FieldchangedDate Typedatetime Required 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 Required DescriptionService field: closing date, ISO 8601. Accepted on write even for a task that is not closed — see the section below the table

Full field list — GET /v1/tasks/fields. The fields id, dateStart, activityDate, realStatus are set by the system and are not passed in the body.

Task service fields can be set

Besides createdBy, a create request also accepts changedBy, closedBy, statusChangedBy, createdDate, changedDate and closedDate. Bitrix24 stores the submitted values, and Vibecode is a wrapper around 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. The same fields are accepted on update — that page also covers what the task log keeps and how a date without a timezone behaves.

Pass an existing employee only. Bitrix24 does not check that the user ID exists in createdBy, changedBy, closedBy or statusChangedBy — it stores any number. A task whose creator does not exist stops being manageable through the API: further updates and deletion are both refused, even with an administrator key and even directly in Bitrix24, bypassing Vibecode. This cannot be undone through the API. Employee list: GET /v1/users.

Important: a title longer than 250 characters is not rejected — Bitrix24 silently truncates it to 250. Emoji are replaced with an internal escape sequence before truncation, so a title containing emoji is truncated earlier. Check title in the response when the title length matters.

Important: an xmlId longer than 50 characters is not rejected — only the first 50 are stored. The filter[xmlId] filter matches exactly, so the task cannot be found by the original longer value. To find a task after the create response is lost, send an xmlId of at most 50 characters, such as a 36-character UUID, and look the task up with GET /v1/tasks?filter[xmlId]=<value>.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/tasks" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Prepare the quarterly report",
    "responsibleId": 1,
    "priority": 2,
    "deadline": "2026-05-19T18:00:00+00:00"
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/tasks" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Prepare the quarterly report",
    "responsibleId": 1,
    "priority": 2,
    "deadline": "2026-05-19T18:00:00+00:00"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Prepare the quarterly report',
    responsibleId: 1,
    priority: 2,
    deadline: '2026-05-19T18:00:00+00:00',
  }),
})

const { success, data } = await res.json()
console.log('New task ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Prepare the quarterly report',
    responsibleId: 1,
    priority: 2,
    deadline: '2026-05-19T18:00:00+00:00',
  }),
})

const { success, data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionFull object of the created task (same as GET /v1/tasks/:id) — see Task fields

The task card URL in Bitrix24 is built from the id and the employee ID:

https://<portal>.bitrix24.com/company/personal/user/<responsibleId>/tasks/task/view/<id>/

<responsibleId> — the responsible person's ID (the responsibleId field in the response): the task opens in their personal workspace. The user/<...> segment determines whose workspace the tasks page is shown in — substitute the ID of the employee you need, for example the current one. <portal> — the Bitrix24 portal domain. Access is limited by the employee's permissions in Bitrix24.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 3871,
    "title": "Prepare the quarterly report",
    "description": "",
    "status": 2,
    "priority": 2,
    "responsibleId": 1,
    "createdBy": 1,
    "createdDate": "2026-05-12T11:46:12.000Z",
    "deadline": "2026-05-19T18:00:00.000Z",
    "groupId": 0,
    "accomplices": [],
    "auditors": [],
    "creator": {
      "id": "1",
      "name": "Current user",
      "link": "/company/personal/user/1/"
    },
    "responsible": {
      "id": "1",
      "name": "Current user",
      "link": "/company/personal/user/1/"
    }
  }
}

Error response example

422 — responsible person not specified:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "Assignee not specified."
  }
}

Errors

HTTP Code Description
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the task creation — for example, a required field (title or responsibleId) was not passed, or a submitted value was rejected by the portal
HTTP400 CodeREADONLY_FIELD DescriptionA read-only field was passed in the request body (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.

See also