[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-tasks\u002Fstages":3,"docs-tabs-tasks\u002Fstages":6},{"content":4,"lastmod":5},"# Create a task stage\n\n`POST \u002Fv1\u002Ftasks\u002Fstages\u002F:entityId`\n\nAdds a stage to a workgroup kanban or to the key owner's My Plan. By default, the stage goes last.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `entityId` (path) | number | yes | Workgroup ID, or `0` for the key owner's My Plan. List of groups: [`GET \u002Fv1\u002Fworkgroups`](\u002Fdocs\u002Fentities\u002Fworkgroups\u002Flist) |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `title` | string | yes | Stage name. An empty string and a whitespace-only string are rejected |\n| `color` | string | no | Color in `RRGGBB` or `#RRGGBB` format. Stored without `#` |\n| `afterStageId` | number | no | ID of a stage in the same kanban after which the new one is placed. List: [`GET \u002Fv1\u002Ftasks\u002Fstages\u002F:entityId`](\u002Fdocs\u002Ftask-stages\u002Flist). Cannot be passed together with `position` |\n| `position` | string | no | The only value is `first`: the stage goes first and becomes the default stage. Cannot be passed together with `afterStageId` |\n\nAny other body fields, including `sort`, 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\u002Fstages\u002F155\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"title\": \"Pending approval\", \"color\": \"#FF0000\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fstages\u002F155\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"title\": \"Pending approval\", \"color\": \"#FF0000\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ftasks\u002Fstages\u002F155', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ title: 'Pending approval', color: '#FF0000' }),\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\u002Fstages\u002F155', {\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({ title: 'Pending approval', color: '#FF0000' }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nThe response comes with HTTP status `201 Created`. The stage in the response is reread after creation.\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The created stage |\n| `data.id` | number | Stage ID |\n| `data.title` | string | Name |\n| `data.sort` | number | Position on the board: the lower the value, the further left |\n| `data.color` | string | Color in `RRGGBB` format |\n| `data.systemType` | string \\| null | `NEW` for the default stage, `null` for the others |\n| `data.entityId` | number | Kanban owner: group ID, or user ID for My Plan |\n| `data.entityType` | string | `G` — group kanban, `U` — My Plan |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 629,\n    \"title\": \"Pending approval\",\n    \"sort\": 400,\n    \"color\": \"FF0000\",\n    \"systemType\": null,\n    \"entityId\": 155,\n    \"entityType\": \"G\"\n  }\n}\n```\n\n## Error response example\n\n400 — both `afterStageId` and `position` are passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Use either position or afterStageId\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | `entityId` is not a non-negative integer, or the body has other fields: `Invalid entityId or body fields` |\n| 400 | `INVALID_PARAMS` | `title` is missing or empty, or `color` or `afterStageId` has an invalid format: `A non-empty title and valid color\u002FafterStageId are required` |\n| 400 | `INVALID_PARAMS` | `position` is not `first`: `position must be first` |\n| 400 | `INVALID_PARAMS` | Both `afterStageId` and `position` are passed: `Use either position or afterStageId` |\n| 400 | `INVALID_PARAMS` | `afterStageId` is `0`: `Use position:first to make the default stage` |\n| 400 | `INVALID_PARAMS` | `afterStageId` belongs to a different kanban: `afterStageId must belong to this entity` |\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` | No group with this `entityId` exists, or the key's user has no rights to its kanban |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not return a stage ID: `Bitrix24 did not return a created stage id; reread stages before retrying` |\n| 422 | `BITRIX_ERROR` | The created stage was not found on reread: `Created stage was not found on readback; reread stages before retrying` |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the creation, text in `message` |\n\nFull list of common API errors: [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The default stage changes for the whole group.** The `systemType: NEW` flag moves from the previous first stage to the new one. New group tasks and tasks without a stage land in the default stage. The order and the default stage are shared by all group members.\n- **`sort` of neighboring stages is recalculated.** After a stage is inserted in the middle or at the start, Bitrix24 renumbers the `sort` values of all stages on the board in steps of 100. Previously saved `sort` values become stale, so reread the stages.\n\n## See also\n\n- [Tasks: kanban, My Plan and the day plan](\u002Fdocs\u002Ftasks)\n- [Task kanban stages](\u002Fdocs\u002Ftask-stages)\n- [Update a task stage](\u002Fdocs\u002Ftask-stages\u002Fupdate)\n- [Delete an empty task stage](\u002Fdocs\u002Ftask-stages\u002Fdelete)\n- [Workgroups](\u002Fdocs\u002Fentities\u002Fworkgroups)\n","2026-10-14",{},1795415511096]