[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-tasks\u002Fmove-stage":3,"docs-tabs-tasks\u002Fmove-stage":6},{"content":4,"lastmod":5},"# Move a task with ordering\n\n`POST \u002Fv1\u002Ftasks\u002F:taskId\u002Fmove-stage`\n\nMoves a task to a stage of its workgroup kanban or to a stage of the key owner's My Plan, and optionally places it before or after another task.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `taskId` (path) | number | yes | ID of the task to move. List: [`GET \u002Fv1\u002Ftasks`](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `stageId` | number | yes | ID of the target stage: a stage of the task's group kanban or a My Plan stage. List: [`GET \u002Fv1\u002Ftasks\u002Fstages\u002F:entityId`](\u002Fdocs\u002Ftask-stages\u002Flist), with the group ID for a group and `0` for My Plan |\n| `beforeTaskId` | number | no | ID of the task the moved task is placed before. A task from the same group when moving on the group kanban, or from My Plan when moving on the plan. Not sent together with `afterTaskId` |\n| `afterTaskId` | number | no | ID of the task the moved task is placed after. Same conditions as `beforeTaskId`. Not sent together with `beforeTaskId` |\n\nAny other body fields are rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4127\u002Fmove-stage\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"stageId\": 625, \"beforeTaskId\": 4125}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4127\u002Fmove-stage\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"stageId\": 625, \"beforeTaskId\": 4125}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4127\u002Fmove-stage', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ stageId: 625, beforeTaskId: 4125 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002F4127\u002Fmove-stage', {\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({ stageId: 625, beforeTaskId: 4125 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | Move result |\n| `data.taskId` | number | ID of the moved task |\n| `data.stageId` | number | ID of the stage the task ended up on |\n| `data.moved` | boolean | Always `true`: the move is verified by rereading the task |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"taskId\": 4127,\n    \"stageId\": 625,\n    \"moved\": true\n  }\n}\n```\n\n## Error response example\n\n409 — the task is not in the key owner's My Plan, the move was not performed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"TASK_NOT_IN_PLAN\",\n    \"message\": \"The task is not in your My Plan and was not moved\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `taskId` or `stageId` is not a positive integer, or the body has other fields: `taskId and stageId must be positive integers` |\n| 400 | `INVALID_PARAMS` | Both `beforeTaskId` and `afterTaskId` are sent: `Use either beforeTaskId or afterTaskId` |\n| 400 | `INVALID_PARAMS` | The ordering task is the task being moved or is not a positive integer: `The ordering task must be a different positive task id` |\n| 400 | `INVALID_PARAMS` | The stage belongs neither to the task's group kanban nor to My Plan: `stageId must belong to the task group or your My Plan` |\n| 400 | `INVALID_PARAMS` | Moving on the group kanban, and the ordering task is from another group or does not exist: `Ordering task must belong to the same group` |\n| 400 | `INVALID_PARAMS` | Moving on My Plan, and the ordering task is not in it: `Ordering task must belong to your My Plan` |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | The key has no valid Bitrix24 token |\n| 403 | `SCOPE_DENIED` | The key has neither the `task` nor the `tasks` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no permission for the task or the group kanban |\n| 404 | `ENTITY_NOT_FOUND` | No task with this `taskId`: `Task was not found` |\n| 409 | `TASK_NOT_IN_PLAN` | Moving on My Plan, and the task is not in the key owner's plan: `The task is not in your My Plan and was not moved` |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the move: `Bitrix24 did not confirm the move; reread the task before retrying` |\n| 422 | `BITRIX_ERROR` | After a move on the group kanban, the task is not on the requested stage: `Bitrix24 did not move the task to the requested stage; reread the task before retrying` |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the move, the reason is in `message` |\n\nFull list of common API errors: [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **My Plan is independent of the group kanban.** A move on My Plan does not change the task's `stageId` in the group. Read the task's position in the plan by filtering the [task list](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) with `filter[stagesId]=\u003Cstage ID>`.\n- **Tasks are not added to My Plan.** The plan contains only tasks the key owner takes part in, for example as creator or assignee.\n- **Group kanban ordering is shared.** All group members see the cards in the same order, so `beforeTaskId` and `afterTaskId` change the board for everyone.\n- **Scrum sprint tasks are moved by a different method.** For a sprint board, use [Scrum kanban stages](\u002Fdocs\u002Fscrum\u002Fstages).\n\n## See also\n\n- [Tasks: kanban, My Plan and the day plan](\u002Fdocs\u002Ftasks)\n- [Task kanban stages](\u002Fdocs\u002Ftask-stages)\n- [Read the kanban sorting permission](\u002Fdocs\u002Ftasks\u002Fstages-can-move)\n- [Task list](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist)\n- [Scrum kanban stages](\u002Fdocs\u002Fscrum\u002Fstages)\n","2026-10-14",{},1795415510903]