For AI agents: markdown of this page — /docs-content-en/infra/work-schedules/delete.md documentation index — /llms.txt

Delete a schedule

DELETE /v1/work-schedules/:id

Deletes 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.

Parameters

Parameter In Type Required Description
Parameterid Inpath Typestring Requiredyes DescriptionID of a custom schedule. Source — data[].id from the schedule list
Parameterreassign Inquery Typestring Requiredno Descriptiontrue — 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

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/work-schedules/WORK_SCHEDULE_ID?reassign=true" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/work-schedules/WORK_SCHEDULE_ID?reassign=true" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/work-schedules/${workScheduleId}?reassign=true`,
  { method: 'DELETE', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
if (res.status === 204) {
  console.log('Schedule deleted')
}

JavaScript — OAuth application

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/work-schedules/${workScheduleId}?reassign=true`,
  {
    method: 'DELETE',
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  }
)
if (res.status === 204) {
  console.log('Schedule deleted')
}

Response

A 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 /v1/infra/servers/:id.

Response example

HTTP/1.1 204 No Content

Error response example

409 — servers run on the schedule, and reassign=true was not passed:

JSON
{
  "success": false,
  "error": {
    "code": "WORK_SCHEDULE_IN_USE",
    "message": "The work schedule is assigned to servers: repeat with reassign=true to move them to another run mode and delete it",
    "details": { "assignedCount": 2 }
  }
}

Errors

HTTP Code Description
HTTP400 CodeRUN_MODE_UNAVAILABLE DescriptionRun modes are not enabled for the Bitrix24 account yet
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key is not recognized: no such key exists on the platform
HTTP403 CodeWORK_SCHEDULE_PRESET_READONLY DescriptionThe schedule is a preset — it cannot be deleted
HTTP403 CodeWORK_SCHEDULE_EDIT_FORBIDDEN DescriptionOnly the author or an administrator of the Bitrix24 account may delete the schedule
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode — it cannot delete schedules
HTTP403 CodeINFRA_SCOPE_REQUIRED DescriptionThe key lacks the vibe:infra scope
HTTP403 CodeINFRA_FORBIDDEN_FOR_COWORK_KEY DescriptionThe call was made with a Cowork key, which cannot access the schedule library. For instructions, see Project key for deploy
HTTP404 CodeNOT_FOUND DescriptionNo schedule with this id exists in the key's Bitrix24 account, or the key is not bound to a Bitrix24 account
HTTP409 CodeWORK_SCHEDULE_IN_USE DescriptionServers 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
HTTP429 CodeRATE_LIMITED DescriptionThe limit of 10 requests per minute per key is exceeded. The current limit is returned in the x-ratelimit-limit header

For the full list of shared API errors, see Errors.

Known specifics

  • 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.
  • 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.

See also