[{"data":1,"prerenderedAt":16},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fchecklist-actions":3,"docs-tabs-entities\u002Ftasks\u002Fchecklist-actions":6},{"content":4,"lastmod":5},"# Checklist actions and task file\n\nThese methods save a task checklist in one call, mark an item complete together with its sub-items, reorder items, and add members and files. [Task checklist](.\u002Fchecklist.md) reads and changes the same items one at a time, but its responses have a different shape.\n\nBitrix24 API: `tasks.task.checklist.*`, `tasks.task.files.attach`\nScope: `task`\n\n## Operations\n\n- [Save a task checklist](.\u002Fchecklist-actions\u002Ftree.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002Ftree`\n- [Mark an item complete with its sub-items](.\u002Fchecklist-actions\u002Fcomplete-all.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fcomplete-all`\n- [Move an item before another](.\u002Fchecklist-actions\u002Fmove-before.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmove-before`\n- [Move an item after another](.\u002Fchecklist-actions\u002Fmove-after.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmove-after`\n- [Add item members](.\u002Fchecklist-actions\u002Fmembers.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmembers`\n- [Attach a file to an item by content](.\u002Fchecklist-actions\u002Fattachments-content.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fcontent`\n- [Attach Drive files to an item](.\u002Fchecklist-actions\u002Fattachments-disk.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fdisk`\n- [Remove item attachments](.\u002Fchecklist-actions\u002Fattachments-remove.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fremove`\n- [Attach a file to a task](.\u002Ffiles-attach.md) — `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Ffiles\u002Fattach`\n\n## Key fields\n\nMethods that act on a single item return the item in `data.checkListItem`, marking an item complete with its sub-items returns an array of items in `data`, and saving a checklist returns the items in `data.checkListItem.traversedItems`.\n\n| Field | Description |\n|------|----------|\n| `id` | Item ID. Pass it as `itemId` in the path. Item list: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n| `taskId` | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist). In the items of a saved checklist, the same value arrives in the `entityId` field |\n| `parentId` | Parent item ID. `0` means a top-level item, which is also the checklist name |\n| `title` | Item text |\n| `sortIndex` | Position of the item among items with the same parent: the smaller the number, the higher the item |\n| `isComplete` | Whether the item is complete — `true` or `false` |\n| `members` | Item members. `type`: `A` — participant, `U` — observer |\n| `attachments` | Item attachments: an empty array or an object where the key is the attachment ID and the value is the Drive file ID prefixed with the letter `n` |\n\n## What to know before you start\n\n1. **These methods do not read items.** The item list and item IDs come from [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist). There, numbers and flags arrive as strings — `\"id\": \"268\"`, `\"isComplete\": \"Y\"` — while the responses of the methods in this subsection use numbers and `true` \u002F `false`.\n2. **Saving replaces the whole checklist.** An item missing from the passed array is deleted, and an item without an `ID` is re-created with a new ID. If saving fails, some of the changes may already have been written — check the result in the [item list](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist).\n3. **An item member becomes a task member.** Role `A` adds the employee to the task's participants, and role `U` adds them to its observers. To remove a member from an item, [update the item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate): the `members` field replaces the whole set. The employee remains a task member.\n4. **A task or item access denial returns `404` in the checklist methods.** Item methods return `404 NOT_FOUND`, and saving the tree returns `404 TASK_NOT_FOUND` for a recognized access denial. This includes an unnamed denial in Russian, English, German or Kazakh. This denial does not distinguish a missing task from denied access. When saving the tree, an invalid `ID` or `NODE_ID` in the `items` array can cause the same denial even if the task is accessible. The exception is [`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Ffiles\u002Fattach`](.\u002Ffiles-attach.md): a task access denial arrives there as `422 BITRIX_ERROR` with `b24Code` `0`, not `404`.\n5. **A read-only key changes nothing.** Every method in this subsection rejects such a key with `403 WRITE_BLOCKED_READONLY_KEY`.\n6. **The member removal method finds a member by position, not by ID.** `POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmembers\u002Fremove` matches the numbers in `membersIds` against positions in the item's `members` list, counted from `0`. A number lower than the member count removes whoever holds that position. An employee ID equal to or greater than the member count removes nobody. Both cases return `200`. To remove a member, [update the item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate): the `members` field sets the final list in full.\n\n## Typical scenario\n\n1. Find the task: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist).\n2. Save the checklist in one call: [`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002Ftree`](.\u002Fchecklist-actions\u002Ftree.md).\n3. Reorder items: [before another item](.\u002Fchecklist-actions\u002Fmove-before.md) or [after it](.\u002Fchecklist-actions\u002Fmove-after.md).\n4. Assign an item member: [`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmembers`](.\u002Fchecklist-actions\u002Fmembers.md).\n5. Attach a file [from Drive](.\u002Fchecklist-actions\u002Fattachments-disk.md) or [by content](.\u002Fchecklist-actions\u002Fattachments-content.md).\n6. Close an item with all its sub-items: [`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fcomplete-all`](.\u002Fchecklist-actions\u002Fcomplete-all.md).\n7. Check the result: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist).\n\n## Limits\n\n| Limit | Value |\n|-------|----------|\n| Items per call | Saving — the whole task checklist. Marking complete with sub-items — the item and all its sub-items. Other methods — one item |\n| Request body size | 1 MiB, including the file content in base64 |\n| Request rate | Common API limits — [Limits and optimization](\u002Fdocs\u002Foptimization) |\n\n## See also\n\n- [Task checklist](.\u002Fchecklist.md)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n- [Files](\u002Fdocs\u002Fentities\u002Ffiles)\n","2026-11-12",{"checklist-actions\u002Ftree.md":7,"checklist-actions\u002Fcomplete-all.md":8,"checklist-actions\u002Fmove-before.md":9,"checklist-actions\u002Fmove-after.md":10,"checklist-actions\u002Fmembers.md":11,"checklist-actions\u002Fattachments-content.md":12,"checklist-actions\u002Fattachments-disk.md":13,"checklist-actions\u002Fattachments-remove.md":14,"files-attach.md":15},"## Save a task checklist\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002Ftree`\n\nSaves a task's entire checklist in one call: the flat array of items you pass replaces the current checklist. Item field names are in upper case.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `items` | array | yes | All checklist items in one flat array. An item missing from the array is deleted. An empty array deletes the whole checklist. The order of items with the same parent in the array sets their `sortIndex` |\n| `items[].ID` | number | no | ID of an existing item. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist). With `ID`, the item is saved under its existing ID. Without it, the item is re-created with a new ID, and the old item is deleted |\n| `items[].NODE_ID` | string | no | Item key within the request, for example `root-1`. Sub-items reference it in `PARENT_NODE_ID`, and the item comes back under it in the response. Give each item a unique, nonempty `NODE_ID`. If Bitrix24 accepts several new items without `NODE_ID`, only the last one is saved, and the rest are lost without an error — the response is still `200`. If Bitrix24 rejects the field value with an unnamed access denial, the API returns `404 TASK_NOT_FOUND` |\n| `items[].PARENT_NODE_ID` | string \\| number | no | `NODE_ID` of the parent item. `0` or omitted — a top-level item, and its `TITLE` becomes the checklist name |\n| `items[].TITLE` | string | yes | Item text. Required for every item, including an item with `ID` |\n| `items[].IS_COMPLETE` | boolean | no | `true` — the item is complete. Without the field, a new item is saved as incomplete. The string `\"Y\"` instead of `true` saves the item as incomplete, with no error |\n| `items[].IS_IMPORTANT` | boolean | no | `true` — the item is important. Defaults to `false`: an item with `ID` loses its previous importance flag |\n| `parameters` | object | no | Additional save parameters. They do not affect the result |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002Ftree\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"items\": [\n      { \"NODE_ID\": \"root-1\", \"PARENT_NODE_ID\": 0, \"TITLE\": \"Launch preparation\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": false },\n      { \"NODE_ID\": \"child-1\", \"PARENT_NODE_ID\": \"root-1\", \"TITLE\": \"Check the build\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": true },\n      { \"NODE_ID\": \"child-2\", \"PARENT_NODE_ID\": \"root-1\", \"TITLE\": \"Update the description\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": false }\n    ]\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002Ftree\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"items\": [\n      { \"NODE_ID\": \"root-1\", \"PARENT_NODE_ID\": 0, \"TITLE\": \"Launch preparation\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": false },\n      { \"NODE_ID\": \"child-1\", \"PARENT_NODE_ID\": \"root-1\", \"TITLE\": \"Check the build\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": true },\n      { \"NODE_ID\": \"child-2\", \"PARENT_NODE_ID\": \"root-1\", \"TITLE\": \"Update the description\", \"IS_COMPLETE\": false, \"IS_IMPORTANT\": false }\n    ]\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002Ftree', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    items: [\n      { NODE_ID: 'root-1', PARENT_NODE_ID: 0, TITLE: 'Launch preparation', IS_COMPLETE: false, IS_IMPORTANT: false },\n      { NODE_ID: 'child-1', PARENT_NODE_ID: 'root-1', TITLE: 'Check the build', IS_COMPLETE: false, IS_IMPORTANT: true },\n      { NODE_ID: 'child-2', PARENT_NODE_ID: 'root-1', TITLE: 'Update the description', IS_COMPLETE: false, IS_IMPORTANT: false },\n    ],\n  }),\n})\n\nconst { data } = await res.json()\nconst saved = data?.checkListItem?.traversedItems ?? {}\nfor (const [nodeId, item] of Object.entries(saved)) {\n  console.log(nodeId, '→ item ID', item.id)\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002Ftree', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    items: [\n      { NODE_ID: 'root-1', PARENT_NODE_ID: 0, TITLE: 'Launch preparation', IS_COMPLETE: false, IS_IMPORTANT: false },\n      { NODE_ID: 'child-1', PARENT_NODE_ID: 'root-1', TITLE: 'Check the build', IS_COMPLETE: false, IS_IMPORTANT: true },\n      { NODE_ID: 'child-2', PARENT_NODE_ID: 'root-1', TITLE: 'Update the description', IS_COMPLETE: false, IS_IMPORTANT: false },\n    ],\n  }),\n})\n\nconst { data } = await res.json()\nconst saved = data?.checkListItem?.traversedItems ?? {}\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.checkListItem` | object \\| null | The saved checklist. `null` if an empty `items` array was passed |\n| `data.checkListItem.traversedItems` | object | Saved items. The key is the item's `NODE_ID` from the request; for an item without `NODE_ID` it is `\"0\"`. If Bitrix24 saved items without `NODE_ID`, there is a single `\"0\"` key in the whole response: of several such new items only the last one is saved |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.id` | number | Item ID. An item without `ID` in the request gets a new ID |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.copiedId` | number \\| null | ID of the original item if the item was copied. The method returns `null` |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.entityId` | number | Task ID from the path |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.userId` | number | ID of the employee on whose behalf the call is made |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.createdBy` | number \\| null | ID of the item author. For an item saved by `ID` it is `null`; the author of such an item is returned by [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.parentId` | number | ID of the parent item. `0` — a top-level item |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.title` | string | Item text |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.sortIndex` | number | The item's position among items with the same parent: the smaller the number, the higher the item |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.displaySortIndex` | string | Item number for display. The method returns an empty string |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.isComplete` | boolean | Whether the item is complete |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.isImportant` | boolean | Whether the item is important |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.completedCount` | number | Number of completed sub-items. The method returns `0` even when a sub-item is complete |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.members` | array | Item members. An empty array if there are none |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.attachments` | array \\| object | Item attachments. An empty array if there are none |\n| `data.checkListItem.traversedItems.\u003CNODE_ID>.nodeId` | string \\| null | The item's `NODE_ID` from the request. If Bitrix24 saved an item without `NODE_ID`, it is `null`, and there is exactly one such item in the successful response: the other new items without `NODE_ID` are not saved |\n| `data.checkListItem.taskId` | null | Always `null`. The task ID is in the items' `entityId` |\n\n## Response example\n\nChecklist saved:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"traversedItems\": {\n        \"root-1\": {\n          \"id\": 268,\n          \"copiedId\": null,\n          \"entityId\": 4218,\n          \"userId\": 1295,\n          \"createdBy\": 1295,\n          \"parentId\": 0,\n          \"title\": \"Launch preparation\",\n          \"sortIndex\": 0,\n          \"displaySortIndex\": \"\",\n          \"isComplete\": false,\n          \"isImportant\": false,\n          \"completedCount\": 0,\n          \"members\": [],\n          \"attachments\": [],\n          \"nodeId\": \"root-1\"\n        },\n        \"child-1\": {\n          \"id\": 270,\n          \"copiedId\": null,\n          \"entityId\": 4218,\n          \"userId\": 1295,\n          \"createdBy\": 1295,\n          \"parentId\": 268,\n          \"title\": \"Check the build\",\n          \"sortIndex\": 0,\n          \"displaySortIndex\": \"\",\n          \"isComplete\": false,\n          \"isImportant\": true,\n          \"completedCount\": 0,\n          \"members\": [],\n          \"attachments\": [],\n          \"nodeId\": \"child-1\"\n        },\n        \"child-2\": {\n          \"id\": 272,\n          \"copiedId\": null,\n          \"entityId\": 4218,\n          \"userId\": 1295,\n          \"createdBy\": 1295,\n          \"parentId\": 268,\n          \"title\": \"Update the description\",\n          \"sortIndex\": 1,\n          \"displaySortIndex\": \"\",\n          \"isComplete\": false,\n          \"isImportant\": false,\n          \"completedCount\": 0,\n          \"members\": [],\n          \"attachments\": [],\n          \"nodeId\": \"child-2\"\n        }\n      },\n      \"taskId\": null\n    }\n  }\n}\n```\n\nAn empty `items` array was passed, and the task checklist was deleted:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": null\n  }\n}\n```\n\n## Error response example\n\n404 — the task is inaccessible:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"TASK_NOT_FOUND\",\n    \"message\": \"Task not found or not accessible.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is not a JSON object, for example an array. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | The `items` field is missing, or `items` is not an array. Message `items must be an array` |\n| 400 | `INVALID_PARAMS` | `parameters` is not an object. Message `parameters must be an object` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key has no `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, for example `application\u002Fxml` |\n| 422 | `BITRIX_ERROR` | An item has no `TITLE`, including an item with `ID`. The message is in the Bitrix24 account language and refers to the item as `[283, ]`, where `283` is the item's `ID`. For a new item the ID slot in the message is empty: `[, ]` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible. This also covers an unnamed access denial in Russian, English, German or Kazakh. The same denial caused by an invalid item ID or NODE_ID in the request body also returns this code |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**An error does not roll back what is already saved.** A `422` response does not mean the checklist stayed as it was. A request that renames an item with `ID` and adds a new item without `TITLE` returns `422`, but the item is renamed anyway. Items missing from the request are not deleted in this case. After an error, check the result with [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist).\n\n**A nonexistent `taskId` does not always return an error.** The response depends on the employee on whose behalf the call is made: one gets `404 TASK_NOT_FOUND`, another gets `200`. In the second case the items are saved with `entityId` equal to the passed `taskId` and are not visible in any task. Before saving, check the task with [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget).\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [List checklist items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist)\n- [Update a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate)\n- [Delete a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fdelete)\n- [Mark an item complete with its sub-items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fcomplete-all)\n- [Task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","## Mark an item complete with its sub-items\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fcomplete-all`\n\nMarks a task checklist item complete together with all its sub-items in one call. A top-level item is the checklist name, and marking it complete closes the whole checklist.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | Item ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\nNo request body is needed.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F268\u002Fcomplete-all\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F268\u002Fcomplete-all\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F268\u002Fcomplete-all', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Items marked:', data?.length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F268\u002Fcomplete-all', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data` | array | Items marked complete: sub-items first, the `itemId` item itself last. For an item without sub-items, the array contains just that item |\n| `data[].id` | number | Item ID |\n| `data[].taskId` | number | Task ID |\n| `data[].parentId` | number | Parent item ID. `0` means a top-level item, which is also the checklist name |\n| `data[].title` | string | Item text |\n| `data[].sortIndex` | number | Position of the item among items with the same parent. The smaller the value, the higher the item |\n| `data[].displaySortIndex` | string | Display number of the item. An empty string in the response |\n| `data[].isComplete` | boolean | Whether the item is complete. After the call, it is `true` for every item in the array |\n| `data[].isImportant` | boolean | Whether the item is marked important |\n| `data[].completedCount` | number | Returns `0` even when sub-items are complete. A sub-item's own `isComplete` shows whether it is complete |\n| `data[].members` | array | Item members. An empty array if there are none. Member roles — see [key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data[].attachments` | array \\| object | Item attachments. An empty array if there are none. Object format — see [key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data[].createdBy` | number | Item author ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data[].userId` | number | ID of the employee on whose behalf the call is made. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data[].copiedId` | number \\| null | ID of the source item if the item was created by copying. Otherwise `null` |\n| `data[].nodeId` | string \\| null | Internal node key. `null` in the response |\n\n## Response example\n\nA top-level item with two sub-items is marked complete:\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 276,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Check the build\",\n      \"sortIndex\": 1,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": true,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    },\n    {\n      \"id\": 274,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Agree on the date\",\n      \"sortIndex\": 2,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    },\n    {\n      \"id\": 268,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 0,\n      \"title\": \"Launch preparation\",\n      \"sortIndex\": 0,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  ]\n}\n```\n\n## Error response example\n\n404 — the item with this `itemId` is missing or inaccessible:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"NOT_FOUND\",\n    \"message\": \"Checklist item not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | The `Content-Type: application\u002Fjson` header is passed with an empty body. Call the method without this header |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is not passed |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, such as `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A repeated call returns no error.** If the item and its sub-items are already complete, the method again returns `200` with the same array of items.\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Save a task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree)\n- [Move an item before another](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fmove-before)\n- [Move an item after another](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fmove-after)\n- [Mark an item complete](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fcomplete)\n- [Reopen an item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Frenew)\n- [List checklist items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist)\n- [Task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist)\n","## Move an item before another\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmove-before`\n\nMoves a task checklist item and places it before another item.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | ID of the item being moved, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `beforeItemId` | number | yes | ID of the item that the `itemId` item will be placed before, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) — it returns the ID as a string, such as `\"276\"`, while this field needs a number |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-before\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"beforeItemId\": 276}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-before\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"beforeItemId\": 276}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-before', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ beforeItemId: 276 }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('New item position:', data?.checkListItem?.sortIndex)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-before', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ beforeItemId: 276 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data` | object | Result with a single field, `checkListItem` |\n| `data.checkListItem` | object | The moved item |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.taskId` | number | Task ID |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` means a top-level item, which is also the checklist name |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | New position of the item among items with the same parent. The smaller the value, the higher the item |\n| `data.checkListItem.displaySortIndex` | string | Display number of the item. An empty string in the response |\n| `data.checkListItem.isComplete` | boolean | Whether the item is complete |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked important |\n| `data.checkListItem.completedCount` | number | Returns `0` even when sub-items are complete. To check whether a sub-item is complete, use its `isComplete` in the [item list](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n| `data.checkListItem.members` | array | Item members. An empty array if there are none. For member roles, see [Key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data.checkListItem.attachments` | array \\| object | Item attachments. An empty array if there are none. For the object format, see [Key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data.checkListItem.createdBy` | number | Item author ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.userId` | number | ID of the employee on whose behalf the call is made. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.copiedId` | number \\| null | ID of the source item if the item was created by copying. Otherwise `null` |\n| `data.checkListItem.nodeId` | string \\| null | Internal node key. `null` in the response |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 274,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Agree on the date\",\n      \"sortIndex\": 0,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": false,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — no item with the ID from `beforeItemId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Move item: action unavailable\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is not a JSON object, for example an array. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `beforeItemId` is missing, passed as a string, or is not a positive integer. Message `beforeItemId must be a positive integer` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is not passed |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, such as `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 422 | `BITRIX_ERROR` | No item with the ID from `beforeItemId`. The message is in the Bitrix24 account language, for example \"Move item: action unavailable\" |\n| 422 | `BITRIX_ERROR` | `beforeItemId` is a sub-item of the item being moved. The message is in the Bitrix24 account language, for example \"Parent item cannot be a subitem of itself\" |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**The target item's number changes too.** The moved item takes the `sortIndex` number of the `beforeItemId` item, and the number of the `beforeItemId` item increases by one. The response shows only the moved item; the new order of the other items is returned by [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist).\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Move an item after another](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fmove-after)\n- [Save a task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree)\n- [Mark an item complete with its sub-items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fcomplete-all)\n- [Update a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate)\n- [List checklist items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist)\n- [Task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist)\n","## Move an item after another\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmove-after`\n\nMoves a task checklist item and places it after another item.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | ID of the item being moved, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `afterItemId` | number | yes | ID of the item that the `itemId` item will be placed after, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) — it returns the ID as a string, such as `\"276\"`, while this field needs a number |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-after\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"afterItemId\": 276}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-after\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"afterItemId\": 276}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-after', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ afterItemId: 276 }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('New item position:', data?.checkListItem?.sortIndex)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fmove-after', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ afterItemId: 276 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data` | object | Result with a single field, `checkListItem` |\n| `data.checkListItem` | object | The moved item |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.taskId` | number | Task ID |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` means a top-level item, which is also the checklist name |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | New position of the item among items with the same parent. The smaller the value, the higher the item |\n| `data.checkListItem.displaySortIndex` | string | Display number of the item. An empty string in the response |\n| `data.checkListItem.isComplete` | boolean | Whether the item is complete |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked important |\n| `data.checkListItem.completedCount` | number | Returns `0` even when sub-items are complete. To check whether a sub-item is complete, use its `isComplete` in the [item list](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n| `data.checkListItem.members` | array | Item members. An empty array if there are none. For member roles, see [Key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data.checkListItem.attachments` | array \\| object | Item attachments. An empty array if there are none. For the object format, see [Key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data.checkListItem.createdBy` | number | Item author ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.userId` | number | ID of the employee on whose behalf the call is made. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.copiedId` | number \\| null | ID of the source item if the item was created by copying. Otherwise `null` |\n| `data.checkListItem.nodeId` | string \\| null | Internal node key. `null` in the response |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 274,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Agree on the date\",\n      \"sortIndex\": 2,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": false,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — an item cannot be placed after its own sub-item:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Parent item cannot be a subitem of itself\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is not a JSON object, for example an array. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `afterItemId` is missing, passed as a string, or is not a positive integer. Message `afterItemId must be a positive integer` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is not passed |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, such as `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 422 | `BITRIX_ERROR` | No item with the ID from `afterItemId`. The message is in the Bitrix24 account language, for example \"Move item: action unavailable\" |\n| 422 | `BITRIX_ERROR` | `afterItemId` is a sub-item of the item being moved. The message is in the Bitrix24 account language, for example \"Parent item cannot be a subitem of itself\" |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**`sortIndex` numbers might not start at `0`.** The moved item gets a number one greater than that of the `afterItemId` item, and the number of the `afterItemId` item does not change. If the first of two sub-items numbered `0` and `1` is placed after the second, their numbers become `1` and `2`. Item order depends on how the numbers compare, not on whether they are consecutive.\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Move an item before another](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fmove-before)\n- [Save a task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree)\n- [Mark an item complete with its sub-items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fcomplete-all)\n- [Update a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate)\n- [List checklist items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist)\n- [Task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist)\n","## Add checklist item members\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fmembers`\n\nAdds employees as members of a task checklist item, and each of them becomes a member of the task itself in the same role — participant or observer.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | Checklist item ID, a positive integer. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `members` | object | yes | Who to add: the key is the employee ID, the value is the employee's role in the item. Employee list: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist). An empty object `{}` changes nothing |\n| `members.\u003CuserId>` | string \\| object | no | Employee role — the string `A` or `U`, or the object `{ \"TYPE\": \"U\" }`. The object key is `TYPE` in uppercase, unlike `type` when [updating an item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate). `A` — participant, `U` — observer |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fmembers\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"members\": { \"1295\": \"A\" } }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fmembers\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"members\": { \"1295\": \"A\" } }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fmembers', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ members: { '1295': 'A' } }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Item members:', data?.checkListItem?.members)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fmembers', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ members: { '1295': 'A' } }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.checkListItem` | object | The item after the members are added |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.taskId` | number | Task ID |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` means a top-level item |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | Sort index among items with the same parent |\n| `data.checkListItem.displaySortIndex` | string | Item display number. The method does not populate it; an empty string is returned |\n| `data.checkListItem.isComplete` | boolean | Whether the item is complete |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked important |\n| `data.checkListItem.completedCount` | number | Number of completed sub-items. The method does not recalculate it; `0` is returned |\n| `data.checkListItem.createdBy` | number | Item author ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.userId` | number | ID of the employee on whose behalf the call is made |\n| `data.checkListItem.copiedId` | number \\| null | ID of the source item if the item was copied. Otherwise `null` |\n| `data.checkListItem.members` | array | Item members. Employees from the request body are returned with only `type` and `id`. Existing members are returned as full objects |\n| `data.checkListItem.members[].type` | string | Role: `A` — participant, `U` — observer |\n| `data.checkListItem.members[].id` | number \\| string | Employee ID. A number for employees from the request body, a string for existing members |\n| `data.checkListItem.members[].name` | string | Employee's first and last name. Existing members only |\n| `data.checkListItem.members[].personalPhoto` | string \\| null | ID of the profile photo file. Existing members only |\n| `data.checkListItem.members[].personalGender` | string \\| null | Gender from the profile. An empty string means the gender is not specified. Existing members only |\n| `data.checkListItem.members[].image` | string | Profile photo URL. Existing members only |\n| `data.checkListItem.members[].isCollaber` | boolean | `true` if this is an external collab member rather than a company employee. Existing members only |\n| `data.checkListItem.attachments` | array \\| object | Item attachments. An empty array if there are none. For the object format, see [Key fields](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#key-fields) |\n| `data.checkListItem.nodeId` | null | Node key from saving the checklist. `null` in this method's response |\n\n## Response example\n\nA participant is added; the item had no other members:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 276,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Check the build\",\n      \"sortIndex\": 1,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": true,\n      \"completedCount\": 0,\n      \"members\": [\n        {\n          \"type\": \"A\",\n          \"id\": 1295\n        }\n      ],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\nThe body `{ \"members\": {} }` for an item that already has an observer: the members do not change, and the existing member is returned as a full object:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 274,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Agree on the date\",\n      \"sortIndex\": 2,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [\n        {\n          \"id\": \"1295\",\n          \"type\": \"U\",\n          \"name\": \"John Smith\",\n          \"personalPhoto\": \"33093\",\n          \"personalGender\": \"\",\n          \"image\": \"https:\u002F\u002Fexample.bitrix24.com\u002F...\",\n          \"isCollaber\": false\n        }\n      ],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — the role is neither `A` nor `U`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Unknown user type passed [X]\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is missing or is not a JSON object. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `members` is missing or is not an object, for example an array. Message `members must be an object` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is not passed |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, such as `application\u002Fxml` |\n| 422 | `BITRIX_ERROR` | The role is neither `A` nor `U`. The message is in the Bitrix24 account language, for example \"Unknown user type passed [X]\", where the brackets hold the passed role |\n| 422 | `BITRIX_ERROR` | The role is passed as an object without the `TYPE` key, for example `{ \"type\": \"U\" }`. The message is in the Bitrix24 account language, for example \"Unknown user type passed []\" with empty brackets |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**A member can be removed by updating the item.** The member removal method does not work for this: it finds a member by position in the list, not by ID. Details — [What to know before you start](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions#what-to-know-before-you-start).\n\n**An employee with a low ID can displace another member.** If the ID of the employee being added matches a member's position in the item's `members` list — positions are counted from `0` — the new employee takes that position and the previous member drops out of the item. The response is still `200`. For example, an employee with ID `1` added to an item with two members displaces the second one. When the item already has members, check the member list with [Get a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget) after the call, or set the full list with [Update a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate) using the `members` field.\n\n**A repeated call with a different role adds a second role instead of changing the first one.** If the employee already has the participant role on the item, a call with role `U` leaves them in the item with both roles, and in the task they become both a participant and an observer. A repeated call with the same role does not duplicate the member, although the response lists the employee once more as a short object.\n\n**The employee ID is not checked.** A nonexistent ID with role `A` is accepted with a `200` response and is added both to the item members and to the task participants. Check the ID with [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) before the call.\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Update a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fupdate)\n- [List checklist items](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist)\n- [Save a task checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree)\n- [Get task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget)\n- [List employees](\u002Fdocs\u002Fentities\u002Fusers\u002Flist)\n","## Attach a file to a checklist item by content\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fcontent`\n\nUploads a file to the \"Uploaded files\" folder on the Drive of the user on whose behalf the call is made, and attaches it to a task checklist item.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | Checklist item ID. List of items: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `attachmentParameters` | object | yes | The file to attach |\n| `attachmentParameters.NAME` | string | yes | File name with an extension, for example `notes.txt`. The file is saved on Drive under this name |\n| `attachmentParameters.CONTENT` | string | yes | File content in base64 |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fcontent\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"attachmentParameters\":{\"NAME\":\"notes.txt\",\"CONTENT\":\"QnVpbGQgY2hlY2sgbm90ZXM=\"}}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fcontent\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"attachmentParameters\":{\"NAME\":\"notes.txt\",\"CONTENT\":\"QnVpbGQgY2hlY2sgbm90ZXM=\"}}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst content = Buffer.from('Build check notes').toString('base64')\n\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fcontent', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    attachmentParameters: { NAME: 'notes.txt', CONTENT: content },\n  }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Item:', data?.checkListItem?.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst content = Buffer.from('Build check notes').toString('base64')\n\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fcontent', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    attachmentParameters: { NAME: 'notes.txt', CONTENT: content },\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.checkListItem` | object | The checklist item as it was before the file was added |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.copiedId` | number \\| null | ID of the item this one was copied from. `null` — the item was not copied |\n| `data.checkListItem.userId` | number | ID of the user on whose behalf the call is made |\n| `data.checkListItem.createdBy` | number | ID of the item author. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` — a top-level item |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | Position of the item among items with the same parent: the lower the number, the higher the item |\n| `data.checkListItem.displaySortIndex` | string | Item number for display. An empty string in this method's response |\n| `data.checkListItem.isComplete` | boolean | Whether the item is completed |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked as important |\n| `data.checkListItem.completedCount` | number | Number of completed sub-items. `0` in this method's response |\n| `data.checkListItem.members` | array | Item members — objects with the fields `id`, `type`, `name`, `personalPhoto`, `personalGender`, `image`, `isCollaber`. `id` is the user ID as a string; `type`: `A` — participant, `U` — observer |\n| `data.checkListItem.attachments` | array \\| object | Item attachments before the call. An empty array — the item had no attachments. Otherwise an object where the key is the attachment ID and the value is the Drive file ID prefixed with the letter `n` |\n| `data.checkListItem.nodeId` | null | Node key from [saving the checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree). `null` in this method's response |\n| `data.checkListItem.taskId` | number | Task ID |\n\n## Response example\n\nThe file is attached to an item that had no attachments before the call:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 276,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Check the build\",\n      \"sortIndex\": 1,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": true,\n      \"completedCount\": 0,\n      \"members\": [\n        {\n          \"id\": \"1295\",\n          \"type\": \"U\",\n          \"name\": \"John Smith\",\n          \"personalPhoto\": \"33093\",\n          \"personalGender\": \"\",\n          \"image\": \"https:\u002F\u002Fexample.bitrix24.com\u002F...\",\n          \"isCollaber\": false\n        }\n      ],\n      \"attachments\": [],\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — `attachmentParameters` has no `CONTENT`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Error adding attachment\",\n    \"b24Code\": \"0\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is missing or is not a JSON object. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `attachmentParameters` is missing or is not an object, for example a string. Message `attachmentParameters must be an object` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 413 | `PAYLOAD_TOO_LARGE` | The request body, including the base64 file content, exceeds 1 MiB |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, for example `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 422 | `BITRIX_ERROR` | `attachmentParameters` has no `CONTENT` or `NAME`. The message is in the Bitrix24 account language, for example `Error adding attachment` |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Read the item to get the new attachment ID.** The attachment created by the call is visible in [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget): its ID is a key of the `attachments` object, and `fileId` is the Drive file ID.\n\n**Removing the attachment deletes the file from Drive.** Details — [Remove checklist item attachments](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-remove). To keep the file on Drive, upload it with [`POST \u002Fv1\u002Ffiles\u002Fupload`](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload) and attach it [from Drive](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk).\n\n**A string that is not base64 is accepted without an error.** If `CONTENT` is not base64-encoded, the method returns `200`, and a file with corrupted content appears on Drive. Encode the content before the call, as in the JavaScript examples.\n\n**This method cannot attach a file larger than 768 KiB.** The request body is limited to 1 MiB, and base64 makes the file a third larger. Upload a larger file with [`POST \u002Fv1\u002Ffiles\u002Fupload`](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload) and attach it [from Drive](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk).\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Attach Drive files to a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk)\n- [Remove checklist item attachments](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-remove)\n- [Get a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget)\n- [Upload file](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","## Attach Drive files to a checklist item\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fdisk`\n\nAttaches files that are already on Bitrix24 Drive to a task checklist item. The files are not copied: each attachment refers to the Drive file itself.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | Checklist item ID. List of items: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `filesIds` | array | yes | Drive file IDs — numbers or strings prefixed with the letter `n`, for example `10808` or `\"n10808\"`. List: [`GET \u002Fv1\u002Ffiles`](\u002Fdocs\u002Fentities\u002Ffiles\u002Flist). To upload a new file, use [`POST \u002Fv1\u002Ffiles\u002Fupload`](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fattachments\u002Fdisk\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"filesIds\":[10808]}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fattachments\u002Fdisk\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"filesIds\":[10808]}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fattachments\u002Fdisk', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ filesIds: [10808] }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Item attachments:', data?.checkListItem?.attachments)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F274\u002Fattachments\u002Fdisk', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ filesIds: [10808] }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.checkListItem` | object | The checklist item after the files were added |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.copiedId` | number \\| null | ID of the item this one was copied from. `null` — the item was not copied |\n| `data.checkListItem.userId` | number | ID of the employee on whose behalf the call is made |\n| `data.checkListItem.createdBy` | number | ID of the item author. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` — a top-level item |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | Position of the item among items with the same parent: the lower the number, the higher the item |\n| `data.checkListItem.displaySortIndex` | string | Item number for display. An empty string in this method's response |\n| `data.checkListItem.isComplete` | boolean | Whether the item is completed |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked as important |\n| `data.checkListItem.completedCount` | number | Number of completed sub-items. `0` in this method's response |\n| `data.checkListItem.members` | array | Item members — objects with the fields `id`, `type`, `name`, `personalPhoto`, `personalGender`, `image`, `isCollaber`. `id` is the user ID as a string; `type`: `A` — participant, `U` — observer |\n| `data.checkListItem.attachments` | array \\| object | Item attachments, including the newly added ones. An empty array — the item has no attachments. Otherwise an object where the key is the attachment ID and the value is the Drive file ID prefixed with the letter `n`. Pass the attachment ID to [`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fremove`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-remove) |\n| `data.checkListItem.nodeId` | null | Node key from [saving the checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree). `null` in this method's response |\n| `data.checkListItem.taskId` | number | Task ID |\n\n## Response example\n\nDrive file `10808` is attached to the item, and the attachment has ID `596`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 274,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Agree on the date\",\n      \"sortIndex\": 2,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": false,\n      \"completedCount\": 0,\n      \"members\": [],\n      \"attachments\": {\n        \"596\": \"n10808\"\n      },\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n422 — Drive has no file with this ID:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"File could not be found.\",\n    \"b24Code\": \"ERROR_CORE\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is missing or is not a JSON object. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `filesIds` is missing or is not an array. Message `filesIds must be an array` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, for example `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 422 | `BITRIX_ERROR` | Drive has no file with an ID from `filesIds`. `error.b24Code` is `ERROR_CORE`; the message is in the Bitrix24 account language, for example `File could not be found.` |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Attaching a file again does not duplicate the attachment.** A file that is already attached to the item can be passed again, including in the other form — `10808` or `\"n10808\"`. The method returns `200`, and the item keeps a single attachment with the same ID.\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Attach a file to a checklist item by content](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-content)\n- [Remove checklist item attachments](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-remove)\n- [Get a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget)\n- [Files](\u002Fdocs\u002Fentities\u002Ffiles)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","## Remove checklist item attachments\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId\u002Fattachments\u002Fremove`\n\nRemoves attachments from a task checklist item — files attached by content or from Bitrix24 Drive.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n| `itemId` (path) | number | yes | Checklist item ID. List of items: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `attachmentsIds` | array | yes | Attachment IDs — numbers. An attachment ID is a key of the item's `attachments` object, not a Drive file ID. List: [`GET \u002Fv1\u002Ftasks\u002F:taskId\u002Fchecklist\u002F:itemId`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fremove\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"attachmentsIds\":[592]}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fremove\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"attachmentsIds\":[592]}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fremove', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ attachmentsIds: [592] }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Attachments left:', Object.keys(data?.checkListItem?.attachments ?? {}).length)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4218\u002Fchecklist\u002F276\u002Fattachments\u002Fremove', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ attachmentsIds: [592] }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.checkListItem` | object | The checklist item after the attachments were removed |\n| `data.checkListItem.id` | number | Item ID |\n| `data.checkListItem.copiedId` | number \\| null | ID of the item this one was copied from. `null` — the item was not copied |\n| `data.checkListItem.userId` | number | ID of the user on whose behalf the call is made |\n| `data.checkListItem.createdBy` | number | ID of the item author. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.checkListItem.parentId` | number | Parent item ID. `0` — a top-level item |\n| `data.checkListItem.title` | string | Item text |\n| `data.checkListItem.sortIndex` | number | Position of the item among items with the same parent: the lower the number, the higher the item |\n| `data.checkListItem.displaySortIndex` | string | Item number for display. An empty string in this method's response |\n| `data.checkListItem.isComplete` | boolean | Whether the item is completed |\n| `data.checkListItem.isImportant` | boolean | Whether the item is marked as important |\n| `data.checkListItem.completedCount` | number | Number of completed sub-items. `0` in this method's response |\n| `data.checkListItem.members` | array | Item members — objects with the fields `id`, `type`, `name`, `personalPhoto`, `personalGender`, `image`, `isCollaber`. `id` is the user ID as a string; `type`: `A` — participant, `U` — observer |\n| `data.checkListItem.attachments` | array \\| object | Attachments the item still has. An empty array — no attachments are left. Otherwise an object where the key is the attachment ID and the value is the Drive file ID prefixed with the letter `n` |\n| `data.checkListItem.nodeId` | null | Node key from [saving the checklist](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Ftree). `null` in this method's response |\n| `data.checkListItem.taskId` | number | Task ID |\n\n## Response example\n\nAttachment `592` is removed, and the item still has attachment `594`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"checkListItem\": {\n      \"id\": 276,\n      \"copiedId\": null,\n      \"userId\": 1295,\n      \"createdBy\": 1295,\n      \"parentId\": 268,\n      \"title\": \"Check the build\",\n      \"sortIndex\": 1,\n      \"displaySortIndex\": \"\",\n      \"isComplete\": true,\n      \"isImportant\": true,\n      \"completedCount\": 0,\n      \"members\": [\n        {\n          \"id\": \"1295\",\n          \"type\": \"U\",\n          \"name\": \"John Smith\",\n          \"personalPhoto\": \"33093\",\n          \"personalGender\": \"\",\n          \"image\": \"https:\u002F\u002Fexample.bitrix24.com\u002F...\",\n          \"isCollaber\": false\n        }\n      ],\n      \"attachments\": {\n        \"594\": \"n10806\"\n      },\n      \"nodeId\": null,\n      \"taskId\": 4218\n    }\n  }\n}\n```\n\n## Error response example\n\n400 — `attachmentsIds` is not an array:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"attachmentsIds must be an array\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` is not a positive integer. Message `taskId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | `itemId` is not a positive integer. Message `itemId must be a positive integer` |\n| 400 | `INVALID_PARAMS` | The body is missing or is not a JSON object. Message `JSON object body is required` |\n| 400 | `INVALID_PARAMS` | `attachmentsIds` is missing or is not an array. Message `attachmentsIds must be an array` |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, for example `application\u002Fxml` |\n| 404 | `TASK_NOT_FOUND` | The task is missing or inaccessible and the core returned the legacy named task-not-found signature |\n| 404 | `NOT_FOUND` | The `itemId` item is missing, belongs to another task or is inaccessible. This also covers an unnamed task access denial in Russian, English, German or Kazakh; this denial does not distinguish a missing task from denied access |\n| 422 | `BITRIX_ERROR` | Another Bitrix24 error, including an unrecognized core denial |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**An unknown ID does not cause an error.** If the item has no attachment with the passed ID, the method returns `200` and leaves the attachments unchanged. Check `attachments` in the response to confirm the result.\n\n**The Drive file is not always deleted.** The file of an attachment created [by content](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-content) disappears from Drive after the attachment is removed: [`GET \u002Fv1\u002Ffiles\u002F:id`](\u002Fdocs\u002Fentities\u002Ffiles\u002Fget) returns `404` for it. A file attached [from Drive](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk) stays in place.\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Attach a file to a checklist item by content](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-content)\n- [Attach Drive files to a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk)\n- [Get a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist\u002Fget)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n","## Attach a file to a task\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Ffiles\u002Fattach`\n\nAttaches a file that is already on Bitrix24 Drive to a task: the task gets an attachment, and the file itself is not copied.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | Task ID. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `fileId` | number | yes | Drive file ID — a positive integer, not prefixed with the letter `n`. List: [`GET \u002Fv1\u002Ffiles`](\u002Fdocs\u002Fentities\u002Ffiles\u002Flist). To upload a new file, use [`POST \u002Fv1\u002Ffiles\u002Fupload`](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4233\u002Ffiles\u002Fattach\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"fileId\":10867}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4233\u002Ffiles\u002Fattach\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"fileId\":10867}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4233\u002Ffiles\u002Fattach', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ fileId: 10867 }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Attachment ID:', data?.attachmentId)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4233\u002Ffiles\u002Fattach', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ fileId: 10867 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` if the request succeeded |\n| `data.attachmentId` | number | Attachment ID — the ID of the link between the file and the task, not the Drive file ID. The same number appears in the task's `ufTaskWebdavFiles` list: [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget) |\n\n## Response example\n\nDrive file `10867` is attached to task `4233`, and the attachment has ID `597`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"attachmentId\": 597\n  }\n}\n```\n\n## Error response example\n\n422 — Drive has no file with this ID:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"File could not be found.\",\n    \"b24Code\": \"ERROR_CORE\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | The request failed validation for one of these reasons, and the message names it. `taskId` is not a positive integer: message `taskId must be a positive integer`. The body is not a JSON object, for example an array: message `JSON object body is required`. `fileId` is missing or is not a positive integer, including the string `\"10867\"` or `\"n10867\"`: message `fileId must be a positive integer` |\n| 400 | `FST_ERR_CTP_EMPTY_JSON_BODY` | An empty body with the `Content-Type: application\u002Fjson` header |\n| 401 | `MISSING_API_KEY` | `X-Api-Key` is missing |\n| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |\n| 403 | `SCOPE_DENIED` | The key lacks the `task` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode. `error.details.switchUrl` contains the URL of the section where the mode is changed |\n| 415 | `FST_ERR_CTP_INVALID_MEDIA_TYPE` | A body with a `Content-Type` the API does not parse, for example `application\u002Fxml` |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused the call; `error.b24Code` tells the reasons apart. `ERROR_CORE`: Drive has no file with this `fileId`; the message is in the Bitrix24 account language, and on a `.com` account it is `File could not be found.` The same `ERROR_CORE` arrives when the employee on whose behalf the call is made has no access to the file; the message is in the Bitrix24 account language. `0`: the employee has no access to the task; the message is `Access denied`. This employee gets the same response for the `taskId` of a nonexistent task. The API specification declares `404 TASK_NOT_FOUND` for this case, but the Bitrix24 accounts we tested return this response instead |\n| 429 | `RATE_LIMITED` | Request rate exceeded. The effective cap is in the `x-ratelimit-limit` header |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Attaching the same file again adds a duplicate.** Each call with the same `fileId` adds one more attachment of that file to the task, and the response returns the ID of the first attachment. All task attachments are listed in the `ufTaskWebdavFiles` field of the [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget) response. To keep a single copy, [update the task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fupdate): setting the `ufTaskWebdavFiles` field to `[\"n10867\"]` replaces the entire attachment list with one attachment.\n\n**A nonexistent `taskId` does not always return an error.** The response depends on the employee on whose behalf the call is made: one gets `422 BITRIX_ERROR`, another gets `200` with `attachmentId`. In the second case the attachment is created but is not visible in any task. Before the call, check the task with [`GET \u002Fv1\u002Ftasks\u002F:id`](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget).\n\n## See also\n\n- [Checklist actions and task file](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions)\n- [Get task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fget)\n- [Update task](\u002Fdocs\u002Fentities\u002Ftasks\u002Fupdate)\n- [Attach Drive files to a checklist item](\u002Fdocs\u002Fentities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk)\n- [Files](\u002Fdocs\u002Fentities\u002Ffiles)\n- [Tasks](\u002Fdocs\u002Fentities\u002Ftasks)\n",1795376992557]