For AI agents: markdown of this page — /docs-content-en/infra/work-schedules/get.md documentation index — /llms.txt
Get a schedule
GET /v1/work-schedules/:id
Returns one work schedule from the library of the Bitrix24 account: windows by weekday, time zone, version and the number of assigned servers.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
Parameterid |
Inpath | Typestring | Requiredyes | DescriptionSchedule ID. Source — data[].id from the schedule list or workSchedule.id in GET /v1/infra/servers/:id |
Examples
curl — personal key
curl -H "X-Api-Key: YOUR_API_KEY" \
https://vibecode.bitrix24.com/v1/work-schedules/WORK_SCHEDULE_ID
curl — OAuth application
curl -H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
https://vibecode.bitrix24.com/v1/work-schedules/WORK_SCHEDULE_ID
JavaScript — personal key
const res = await fetch(
`https://vibecode.bitrix24.com/v1/work-schedules/${workScheduleId}`,
{ headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const { data } = await res.json()
console.log(`${data.name}: ${data.windows.length} windows, ${data.assignedCount} servers`)
JavaScript — OAuth application
const res = await fetch(
`https://vibecode.bitrix24.com/v1/work-schedules/${workScheduleId}`,
{
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.id |
Typestring | DescriptionSchedule ID |
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 time windows |
Fielddata.windows |
Typearray | DescriptionWindows { isoDay, start, end }: isoDay from 1 (Monday) to 7, start and end in local HH:MM, the end of the day is 24:00 |
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 galaxy applications in the Bitrix24 account use this schedule if no mode is specified when they are created. 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 when they are created. At most one schedule has true; this flag is set independently of defaultForNewMachines |
Response example
{
"success": true,
"data": {
"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
404 — no such schedule in the key's Bitrix24 account:
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Work schedule not found"
}
}
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 manages servers and their billing, so Cowork keys cannot access it, including for read operations. For the next steps, 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. A schedule of another account gets the same answer — the response does not confirm that it exists |
| 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.