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