[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-infra\u002Fwork-schedules\u002Fdelete":3,"docs-tabs-infra\u002Fwork-schedules\u002Fdelete":6},{"content":4,"lastmod":5},"## Delete a schedule\n\n`DELETE \u002Fv1\u002Fwork-schedules\u002F:id`\n\nDeletes a custom schedule from the library of the Bitrix24 account. A schedule that servers run on is deleted only with consent to move them to another run mode. A deleted schedule cannot be restored through the API — create a new one if needed.\n\n## Parameters\n\n| Parameter | In | Type | Required | Description |\n|----------|---|-----|:-----:|----------|\n| `id` | path | string | yes | ID of a custom schedule. Source — `data[].id` from the [schedule list](.\u002Flist.md) |\n| `reassign` | query | string | no | `true` — consent to release the servers from the schedule before deleting it. An agent or bot switches to `ALWAYS`, and its remembered idle threshold is cleared. An application with `idleSleepProtected: true` switches to an effective run mode of `ALWAYS` while retaining its remembered threshold. All other applications go to `IDLE` with their own threshold, or with 60 minutes if they have none. Any other value is treated as a refusal |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwork-schedules\u002FWORK_SCHEDULE_ID?reassign=true\" \\\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\u002Fwork-schedules\u002FWORK_SCHEDULE_ID?reassign=true\" \\\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(\n  `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwork-schedules\u002F${workScheduleId}?reassign=true`,\n  { method: 'DELETE', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }\n)\nif (res.status === 204) {\n  console.log('Schedule deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch(\n  `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fwork-schedules\u002F${workScheduleId}?reassign=true`,\n  {\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('Schedule deleted')\n}\n```\n\n## Response\n\nA successful delete returns HTTP status `204 No Content` with an empty body. Success is signaled by the status code, not the content. The new run modes of the moved servers are read from [`GET \u002Fv1\u002Finfra\u002Fservers\u002F:id`](\u002Fdocs\u002Finfra\u002Fservers\u002Fget).\n\n## Response example\n\n```\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n409 — servers run on the schedule, and `reassign=true` was not passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"WORK_SCHEDULE_IN_USE\",\n    \"message\": \"The work schedule is assigned to servers: repeat with reassign=true to move them to another run mode and delete it\",\n    \"details\": { \"assignedCount\": 2 }\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `RUN_MODE_UNAVAILABLE` | Run modes are not enabled for the Bitrix24 account yet |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key is not recognized: no such key exists on the platform |\n| 403 | `WORK_SCHEDULE_PRESET_READONLY` | The schedule is a preset — it cannot be deleted |\n| 403 | `WORK_SCHEDULE_EDIT_FORBIDDEN` | Only the author or an administrator of the Bitrix24 account may delete the schedule |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode — it cannot delete schedules |\n| 403 | `INFRA_SCOPE_REQUIRED` | The key lacks the `vibe:infra` scope |\n| 403 | `INFRA_FORBIDDEN_FOR_COWORK_KEY` | The call was made with a Cowork key, which cannot access the schedule library. For instructions, see [Project key for deploy](\u002Fdocs\u002Fcowork\u002Fdeploy-key) |\n| 404 | `NOT_FOUND` | No schedule with this `id` exists in the key's Bitrix24 account, or the key is not bound to a Bitrix24 account |\n| 409 | `WORK_SCHEDULE_IN_USE` | Servers run on the schedule, and `reassign=true` was not passed. The number of servers is in `error.details.assignedCount`. The same response is returned if a server is assigned to the schedule during the delete — repeat the request |\n| 429 | `RATE_LIMITED` | The limit of 10 requests per minute per key is exceeded. The current limit is returned in the `x-ratelimit-limit` header |\n\nFor the full list of shared API errors, see [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The move affects other employees' servers too.** With `reassign=true` every server on the schedule moves to another run mode, not only the key owner's — and its cost changes along with the mode.\n- **Deleted servers do not block the delete.** Servers that are already deleted are not counted in `assignedCount` and are taken off the schedule without consent.\n\n## See also\n\n- [List schedules](.\u002Flist.md)\n- [Update a schedule](.\u002Fupdate.md)\n- [Set the server run mode](\u002Fdocs\u002Finfra\u002Flifecycle\u002Frun-mode)\n","2026-11-05",{},1794739578510]