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

List schedules

GET /v1/work-schedules

Returns the work schedule library of the Bitrix24 account — platform presets and custom schedules — with the number of servers assigned to each.

Parameters

No parameters. The library of a Bitrix24 account is limited to the platform presets and 50 custom schedules, so filtering and pagination are not provided.

Examples

curl — personal key

Terminal
curl -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/work-schedules

curl — OAuth application

Terminal
curl -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  https://vibecode.bitrix24.com/v1/work-schedules

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/work-schedules', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})
const { data } = await res.json()
const own = data.filter(s => s.kind === 'CUSTOM')
console.log(`Schedules: ${data.length}, custom: ${own.length}`)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/work-schedules', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionSchedules of the Bitrix24 account: presets first, then custom schedules in the order they were created
Fielddata[].id Typestring DescriptionSchedule ID. Accepted by setting a server's run mode and the other library operations
Fielddata[].kind Typestring DescriptionPRESET — a platform preset, CUSTOM — a custom schedule
Fielddata[].name Typestring DescriptionName. A preset's name is returned in the key owner's language
Fielddata[].presetKey Typestring | null DescriptionPreset key: weekdays-9-18, weekdays-9-19, weekdays-9-20, weekdays-8-19, weekdays-8-20, daily-9-21. null for a custom schedule
Fielddata[].timezone Typestring DescriptionIANA time zone used to interpret the windows
Fielddata[].windows Typearray DescriptionWindows { isoDay, start, end } in local time. Window rules are on the section index
Fielddata[].version Typenumber DescriptionVersion number. Passed to update
Fielddata[].canEdit Typeboolean DescriptionWhether the key owner may edit and delete the schedule. Always false for a preset
Fielddata[].assignedCount Typenumber DescriptionHow many servers of the Bitrix24 account run on the schedule, other employees' servers included. The servers themselves are not named
Fielddata[].defaultForNewMachines Typeboolean DescriptionNew servers and applications in the Bitrix24 account's galaxy use this schedule when no run mode is specified at creation. At most one schedule has true. A Bitrix24 account administrator sets this flag — Set the default schedule
Fielddata[].defaultForNewAgents Typeboolean DescriptionNew agents and bots in the Bitrix24 account use this schedule by default. At most one schedule has true; this flag is set separately from defaultForNewMachines

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": "cmfp4qz7x00031ocg5d1a8k2m",
      "kind": "PRESET",
      "name": "Weekdays 9–18",
      "presetKey": "weekdays-9-18",
      "timezone": "Europe/Berlin",
      "windows": [
        { "isoDay": 1, "start": "09:00", "end": "18:00" },
        { "isoDay": 2, "start": "09:00", "end": "18:00" },
        { "isoDay": 3, "start": "09:00", "end": "18:00" },
        { "isoDay": 4, "start": "09:00", "end": "18:00" },
        { "isoDay": 5, "start": "09:00", "end": "18:00" }
      ],
      "version": 1,
      "canEdit": false,
      "assignedCount": 3,
      "defaultForNewMachines": false,
      "defaultForNewAgents": false
    },
    {
      "id": "cmfp4r0q2000a1ocg7h2k9x3d",
      "kind": "CUSTOM",
      "name": "Warehouse shifts",
      "presetKey": null,
      "timezone": "Europe/Berlin",
      "windows": [
        { "isoDay": 1, "start": "09:00", "end": "18:00" },
        { "isoDay": 2, "start": "09:00", "end": "13:00" },
        { "isoDay": 2, "start": "14:00", "end": "24:00" }
      ],
      "version": 2,
      "canEdit": true,
      "assignedCount": 1,
      "defaultForNewMachines": true,
      "defaultForNewAgents": false
    }
  ]
}

Error response example

403 — the key lacks the vibe:infra scope:

JSON
{
  "success": false,
  "error": {
    "code": "INFRA_SCOPE_REQUIRED",
    "message": "This API key does not have infrastructure rights (scope vibe:infra).",
    "details": { "requiredScope": "vibe:infra" }
  }
}

Errors

HTTP Code Description
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 CodeINFRA_SCOPE_REQUIRED DescriptionThe key lacks the vibe:infra scope
HTTP403 CodeINFRA_FORBIDDEN_FOR_COWORK_KEY DescriptionThe call was made with a Cowork key. The schedule library controls servers and their billing, so Cowork keys cannot access it, even for read operations. For the required key, see — Project key for deploy
HTTP404 CodeNOT_FOUND DescriptionThe key is not bound to a Bitrix24 account
HTTP429 CodeRATE_LIMITED DescriptionThe limit of 60 requests per minute per key is exceeded. The current limit is returned in the x-ratelimit-limit header

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

Known specifics

  • The list is empty until run modes are enabled. The presets are added to the account's library when run modes are enabled, and custom schedules cannot be created before that. An empty data for such an account is not an error.
  • A preset's name depends on the key. The name is not stored in the data — it is translated into the key owner's language, so two keys of the same Bitrix24 account can get different strings. Identify a preset reliably by presetKey.

See also