[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk":3,"docs-tabs-entities\u002Ftasks\u002Fchecklist-actions\u002Fattachments-disk":6},{"content":4,"lastmod":5},"## 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","2026-11-12",{},1795376992921]