[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-task-stages\u002Fdelete":3,"docs-tabs-task-stages\u002Fdelete":6},{"content":4,"lastmod":5},"# Delete an empty task stage\n\n`DELETE \u002Fv1\u002Ftask-stages\u002F:stageId`\n\nDeletes a stage with no tasks from a workgroup kanban or from My Plan. A deleted stage cannot be restored through the API — create a new one if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `stageId` (path) | number | yes | Stage ID. List: [`GET \u002Fv1\u002Ftasks\u002Fstages\u002F:entityId`](\u002Fdocs\u002Ftask-stages\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftask-stages\u002F631\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftask-stages\u002F631\" \\\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\u002Ftask-stages\u002F631', {\n  method: 'DELETE',\n  headers: { 'X-Api-Key': 'YOUR_API_KEY' },\n})\n\nif (res.status === 204) {\n  console.log('Stage deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftask-stages\u002F631', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nif (res.status === 204) {\n  console.log('Stage deleted')\n}\n```\n\n## Response\n\nOn successful deletion the API returns HTTP status `204 No Content` with an empty body. Success is indicated by the status code, not the content.\n\n## Response example\n\n```\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n409 — the stage contains tasks:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"STAGE_NOT_EMPTY\",\n    \"message\": \"The stage contains tasks; move them first (including tasks not visible to you)\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `stageId` is not a positive integer: `stageId must be a positive integer` |\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 lacks the `task` or `tasks` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 403 | `BITRIX_ACCESS_DENIED` | The key's user has no rights to the group kanban |\n| 404 | `ENTITY_NOT_FOUND` | No stage with this `stageId`, including when the stage is deleted a second time. The `message` text comes from Bitrix24 in the Bitrix24 account's language |\n| 409 | `STAGE_NOT_EMPTY` | The stage contains tasks: `The stage contains tasks; move them first (including tasks not visible to you)` |\n| 409 | `STAGE_IS_SYSTEM` | The stage is first on the board, that is, the default stage: `The first stage cannot be deleted` |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the deletion: `Bitrix24 did not confirm deletion; reread stages before retrying` |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the deletion. The text is in `message` |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Emptiness counts all tasks.** Tasks the key's user cannot see are counted too. If `STAGE_NOT_EMPTY` comes back for a stage that looks empty, it holds tasks not accessible to the key's user.\n- **How to delete the first stage.** First make another stage the first one: [`PATCH \u002Fv1\u002Ftask-stages\u002F:stageId`](\u002Fdocs\u002Ftask-stages\u002Fupdate) with `afterStageId: 0`. Group tasks without a stage are then assigned to the former first stage, and the deletion returns `409 STAGE_NOT_EMPTY`. Find them in the [task list](\u002Fdocs\u002Fentities\u002Ftasks\u002Flist) with `filter[stageId]=\u003Cstage ID>`, move them with the [move method](\u002Fdocs\u002Ftasks\u002Fmove-stage) and retry the deletion.\n\n## See also\n\n- [Tasks: kanban, My Plan and the day plan](\u002Fdocs\u002Ftasks)\n- [Task kanban stages](\u002Fdocs\u002Ftask-stages)\n- [Move a task with ordering](\u002Fdocs\u002Ftasks\u002Fmove-stage)\n- [Update a task stage](\u002Fdocs\u002Ftask-stages\u002Fupdate)\n","2026-10-14",{},1795377188483]