For AI agents: markdown of this page — /docs-content-en/infra/wake-schedules/update.md documentation index — /llms.txt
Update a wake window
PATCH /v1/infra/servers/:id/wake-schedules/:scheduleId
Replaces the window in full — despite the PATCH method, the semantics match a full replacement (PUT). Omitted optional fields reset to their defaults instead of keeping their previous value: enabled → true, label/lead → empty. Send the complete window object, not just the field that changed.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
Parameterid |
Inpath | Typestring (UUID) | Requiredyes | DescriptionID of the BLACKHOLE server |
ParameterscheduleId |
Inpath | Typestring | Requiredyes | DescriptionWindow ID, taken from data[].id in the window list or data.id from creating a window |
Request fields (body)
The same fields as when creating a window. Omitted optional fields don't keep their old value — they reset to the default.
| Field | Type | Required | Default when omitted | Description |
|---|---|---|---|---|
FieldcronExpr |
Typestring | Requiredyes | Default when omitted— | DescriptionA 5-field cron expression, 9 to 120 characters |
Fieldtimezone |
Typestring | Requiredyes | Default when omitted— | DescriptionIANA timezone of the window |
Fieldlabel |
Typestring | Requiredno | Default when omittedresets to empty | DescriptionWindow label, up to 80 characters |
Fieldlead |
Typenumber | Requiredno | Default when omittedresets to empty (the server's or the platform's margin is used) | DescriptionMargin, in seconds, before the time scheduled by cronExpr. 0 to 3600. A value below the platform margin is raised to it |
Fieldenabled |
Typeboolean | Requiredno | Default when omittedresets to true |
DescriptionWhether the window is active |
Examples
curl — personal key
curl -X PATCH "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/wake-schedules/SCHEDULE_ID" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cronExpr": "0 10 * * 1-5",
"timezone": "America/New_York",
"label": "daily report",
"enabled": true
}'
curl — OAuth application
curl -X PATCH "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/wake-schedules/SCHEDULE_ID" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cronExpr": "0 10 * * 1-5",
"timezone": "America/New_York",
"label": "daily report",
"enabled": true
}'
JavaScript — personal key
const res = await fetch(
`https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/wake-schedules/${scheduleId}`,
{
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
// Full window object — fields omitted here reset to their defaults
body: JSON.stringify({
cronExpr: '0 10 * * 1-5',
timezone: 'America/New_York',
label: 'daily report',
enabled: true,
}),
}
)
JavaScript — OAuth application
const res = await fetch(
`https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/wake-schedules/${scheduleId}`,
{
method: 'PATCH',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
cronExpr: '0 10 * * 1-5',
timezone: 'America/New_York',
label: 'daily report',
enabled: true,
}),
}
)
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata.id |
Typestring | DescriptionWindow ID |
Fielddata.serverId |
Typestring (UUID) | DescriptionID of the owning server |
Fielddata.cronExpr |
Typestring | DescriptionThe updated cron expression |
Fielddata.timezone |
Typestring | DescriptionThe updated timezone |
Fielddata.label |
Typestring | null | DescriptionWindow label |
Fielddata.lead |
Typenumber | null | DescriptionMargin in seconds |
Fielddata.enabled |
Typeboolean | DescriptionWhether the window is active after the update |
Fielddata.source |
Typestring | DescriptionHow the window was created. Unaffected by an update |
Fielddata.lastFiredAt |
Typestring (ISO 8601) | null | DescriptionTimestamp of the last confirmed firing. An update doesn't touch this field |
Fielddata.wakeAttemptStartedAt |
Typestring (ISO 8601) | null | DescriptionInternal scheduler marker, normally null |
Fielddata.lastWakeLateAt |
Typestring (ISO 8601) | null | DescriptionTimestamp of the last late wake |
Fielddata.createdAt |
Typestring (ISO 8601) | DescriptionRecord creation date |
Fielddata.updatedAt |
Typestring (ISO 8601) | DescriptionDate of this update |
FieldtzWarning |
Typestring | null | DescriptionTimezone-mismatch advisory, as text. null when the server has no active windows left after this mutation |
FieldtzWarningCode |
Typestring | null | DescriptionMachine-readable code for the same advisory: "SINGLE_ZONE", "MULTI_ZONE", or null |
FieldpreemptibleAdvisoryCode |
Typestring | null | Description"PREEMPTIBLE_BEST_EFFORT" when the server runs on a preemptible plan — otherwise null. The .com plans are non-preemptible, so a server on .com gets null |
FieldpreemptibleAdvisory |
Typestring | null | DescriptionAn explanation of the same advisory, as text (in English, for non-UI API clients). null when the server is on a non-preemptible plan — as every .com plan is |
tzWarning, tzWarningCode, preemptibleAdvisoryCode, and preemptibleAdvisory are top-level response fields, not nested under data.
Response example
{
"success": true,
"data": {
"id": "cm38x02qp0001ml08g7k3h2a",
"serverId": "e765edfc-ba0a-43de-b8ea-838dd872c522",
"cronExpr": "0 10 * * 1-5",
"timezone": "America/New_York",
"label": "daily report",
"lead": null,
"enabled": true,
"source": "MANUAL",
"lastFiredAt": "2026-07-10T06:00:04.000Z",
"wakeAttemptStartedAt": null,
"lastWakeLateAt": null,
"createdAt": "2026-07-03T08:12:00.000Z",
"updatedAt": "2026-07-10T09:30:00.000Z"
},
"tzWarning": "The VM may have been deployed with a different timezone (or not redeployed since this window was declared) — verify the in-VM cron or redeploy the app so TZ is re-injected.",
"tzWarningCode": "SINGLE_ZONE",
"preemptibleAdvisoryCode": null,
"preemptibleAdvisory": null
}
A server on a preemptible plan would get "preemptibleAdvisoryCode": "PREEMPTIBLE_BEST_EFFORT" and a non-empty preemptibleAdvisory instead of null in those same two fields — the rest of the response shape is unchanged. The .com plans are non-preemptible, so on .com both fields are null, as in the example above.
Error response example
404 — window not found:
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Wake window not found"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeVALIDATION_ERROR |
DescriptionBody validation failed — missing cronExpr/timezone, timezone not in the IANA timezone list, label over 80 characters, lead outside 0–3600, or an unknown field in the body |
| HTTP400 | CodeBLACKHOLE_ONLY |
DescriptionThe server is not in BLACKHOLE mode |
| HTTP400 | CodeGALAXY_NOT_SUPPORTED |
DescriptionThe server is a Galaxy host (kind: "GALAXY"). A host holds no windows at all: the schedule is declared on an app inside the galaxy, not on the host itself |
| HTTP400 | CodeALWAYS_ON_CONFLICT |
DescriptionThe server runs in always-on mode — no auto-sleep. An app in a galaxy never receives this code: it inherits the galaxy's plan, and the platform does not treat it as always-on. Nor does a server in the SCHEDULE run mode: its owner has declared sleep explicitly, and the window becomes an extra wake-up on top of the schedule |
| HTTP400 | CodeCADENCE_TOO_LOW |
DescriptionThe gap between consecutive cronExpr occurrences is below the platform's floor — currently 5 minutes |
| 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 | CodeWAKE_SCHEDULE_DISABLED |
DescriptionScheduled wake is not enabled for this portal |
| HTTP403 | CodeWAKE_SCHEDULE_GALAXY_DISABLED |
DescriptionThe server is an app inside a galaxy (kind: "GALAXY_APP"). Such an app can hold windows, but the capability for Galaxy apps is switched off on the platform. The capability is enabled separately from ordinary servers, so a kind: "STANDALONE" server never receives this code |
| HTTP403 | CodeINFRA_SCOPE_REQUIRED |
DescriptionThe key lacks the vibe:infra scope |
| HTTP403 | CodeINFRA_FORBIDDEN_FOR_COWORK_KEY |
DescriptionThe call was made with a Cowork/Code key — such a key works with data only and cannot perform write operations. To issue a key that can, see Project key for deploy |
| HTTP403 | CodeSERVER_ROLE_FORBIDDEN |
DescriptionYou are on this server's development team with the Developer role, but this operation is open to the Administrator role. error.hint carries your role, the required threshold and the list of calls that are open to you. Role breakdown — List servers |
| HTTP404 | CodeNOT_FOUND |
DescriptionNo window with that scheduleId exists on this server, or the server itself was not found, was deleted, or belongs to a different API key while you are not on its development team |
| HTTP429 | CodeRATE_LIMITED |
DescriptionThe 10-requests-per-minute limit for this endpoint was exceeded. The current limit is returned in the x-ratelimit-limit header |
For the full list of shared API errors, see Errors.
Known specifics
PATCHreplaces the window in full. This is a departure from the general partial-PATCHstandard across the Vibecode API — compare with updating a deal, where omitted fields keep their previous value. Sending only the field that changed silently resets the other optional fields to their defaults —enabledbecomestrue, andlabelandleadare cleared. Build the body from the window's last known full state, not just the fields that changed.preemptibleAdvisoryCode/preemptibleAdvisoryare an advisory, not a gate. The window is updated regardless of these fields' values — on a preemptible plan the platform does not forbid a schedule; it simply reports up front that waking the server in time for the window is best-effort. Localize by thepreemptibleAdvisoryCodevalue, not by thepreemptibleAdvisorystring — it is a fixed English string for non-UI clients.- Window existence is checked before the other gates. A non-existent
scheduleIdreturns404 NOT_FOUNDeven if the request also violatesBLACKHOLE_ONLYor another server-mode gate. - Two different galaxy refusals.
GALAXY_NOT_SUPPORTEDis about the galaxy host: it holds no windows at all.WAKE_SCHEDULE_GALAXY_DISABLEDis about an app inside a galaxy: it can hold windows, but while the capability for such apps is switched off on the platform, updating an existing window also returns this code. The first arrives with status400, the second with403.