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

Reboot server

POST /v1/infra/servers/:id/reboot

Reboots a running server at the cloud provider. During the reboot the server moves to provisioning, the tunnel is briefly dropped — blackholeStatus becomes DISCONNECTED — and reconnects after the virtual machine starts. The operation is atomic: an internal database-level guard prevents races if several calls arrive at once. If the provider does not support reboot, the endpoint returns 501 and the status is rolled back to running.

Parameters

Parameter In Type Required Description
Parameterid Inpath Typestring (UUID) Requiredyes DescriptionID of a server in running status

The request body is empty.

Examples

curl — personal key

Terminal
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/reboot

curl — OAuth application

Terminal
curl -X POST -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/reboot

JavaScript — personal key

javascript
await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/reboot`,
  { method: 'POST', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)

// Poll readiness after the reboot
while (true) {
  await new Promise(r => setTimeout(r, 5000))
  const res = await fetch(
    `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}`,
    { headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
  )
  const { data } = await res.json()
  if (data.status === 'running' && data.blackholeStatus === 'CONNECTED') break
}

JavaScript — OAuth application

javascript
await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/reboot`,
  {
    method: 'POST',
    headers: {
      'X-Api-Key': 'YOUR_APP_KEY',
      'Authorization': 'Bearer USER_SESSION_TOKEN',
    },
  }
)

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue. The reboot command was sent to the provider

Response example

JSON
{ "success": true }

Error response example

422 — the server exists but is not in running status. The response carries the current state and the actions available now:

JSON
{
  "success": false,
  "error": {
    "code": "SERVER_WRONG_STATE",
    "message": "Server is SLEEPING; /reboot requires RUNNING.",
    "userMessage": "Server is currently SLEEPING. Reboot only applies to a RUNNING server.",
    "currentState": { "status": "sleeping", "blackholeStatus": "DISCONNECTED", "hasExternalId": true },
    "availableActions": ["wake", "start", "repair", "delete"]
  }
}

409 — the server status changed during the operation (race):

JSON
{
  "success": false,
  "error": {
    "code": "CONFLICT",
    "message": "Server state changed during operation"
  }
}

Errors

HTTP Code Description
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header was not provided
HTTP401 CodeINVALID_API_KEY DescriptionThe key is not recognized — no such key exists on the platform
HTTP402 CodeACCOUNT_FROZEN DescriptionThe Vibecode balance is frozen. Top up and retry
HTTP403 CodeVIBE_DEMO_EXPIRED DescriptionThe server is a Vibe+ trial machine and the trial has ended: the platform froze it at the scheduled access check and refuses to reboot it. The server and its data are kept; a paid Vibe+ plan on the Bitrix24 account restores access; the server is not started automatically — start it with a new call
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, and 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 CodeSERVER_NOT_FOUND DescriptionNo server with this id — deleted, or belonging to another API key while you are not on its development team
HTTP409 CodeCONFLICT DescriptionState race — the server status changed during the operation. Retry the request after checking GET /v1/infra/servers/:id
HTTP422 CodeSERVER_WRONG_STATE DescriptionThe server exists but is not in running status. error.currentState carries the current state; error.availableActions lists what you can do now
HTTP422 CodeVM_MISSING DescriptionThe server record has no cloud VM (provisioning never finished or the VM was removed manually). Replace the server: delete it and create a new one. error.hint names the endpoint of each step only if that step is available to this request, and for an unavailable step it gives the reason for the refusal and what to change
HTTP422 CodeVM_POINTER_LOST DescriptionThe record has no externalId, but the cloud review does see a machine under this server's cloud name: the link is lost while the machine itself is most likely running and billed. Do NOT delete the server and create a new one — that would leave the machine running with no record at all. The server is not moved to error; contact support to have the link restored
HTTP429 CodeRATE_LIMITED DescriptionThe platform's overall request limit was exceeded
HTTP501 CodeNOT_SUPPORTED DescriptionThe cloud provider does not support reboot. Use the sequence /stop → /start
HTTP502 CodePROVIDER_ERROR DescriptionThe cloud provider returned an error. The server status is automatically rolled back to running

The full list of common API errors — Errors.

Known specifics

  • Atomic transition running → provisioning. The database is updated with a single updateMany conditioned on status = 'RUNNING'. If another /reboot or /stop arrives at the same moment, the second call gets 409 CONFLICT.
  • Automatic rollback on a provider error. If adapter.rebootServer() throws an exception, the record is reverted to running status — so the client is not left with a "stuck" provisioning.
  • To restart only the application (without rebooting the virtual machine), use POST /exec with the command systemctl restart app — it is dozens of times faster and does not break the tunnel. This process restart does not itself delete server or application files. If a different service name (serviceName) was configured during deployment, replace app with that name. The application itself may modify its data on startup.
  • After a reboot, wait for both fields. For the server to be ready, you need both status: "running" and blackholeStatus: "CONNECTED" at the same time — the tunnel reconnects after the virtual machine starts.

Galaxy apps (kind=GALAXY_APP)

For a Galaxy app container (kind=GALAXY_APP — it has no virtual machine of its own), /reboot restarts the container on the host rather than rebooting a VM. It is a self-recovery kick for a stuck or crash-looping app: it does not wipe the persistent /data volume (unlike deletion).

The restart is advisory — it does not change the record's status and does not clear the crash marker. After the restart the container is probed, and the response carries a healthy verdict: whether the container came up and stopped restarting. This inspects the container state (docker inspect), not the app's HTTP response. A crash-looping app is authoritatively fixed by redeploying its source via POST /v1/infra/servers/:id/deploy — redeploy is what clears the error state.

The app accepts /reboot in the running or error status (a regular server accepts only running).

Response fields

The verdict is nested under data (unlike a regular server reboot, whose body is the flat { "success": true }).

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue — the command ran
Fielddata.restarted Typeboolean Descriptiontrue — the container was restarted; false — it could not be restarted (container missing / image deleted) — redeploy needed
Fielddata.healthy Typeboolean Descriptiontrue — the container came up and stopped restarting; false — it is crashing again (redeploy needed). This inspects the container, not the app's HTTP response
Fielddata.hint Typestring Descriptionpresent only when data.healthy: false — how to deploy a fixed version
JSON
{ "success": true, "data": { "restarted": true, "healthy": false, "hint": "Redeploy the fixed source via POST /v1/infra/servers/:id/deploy" } }

Errors

HTTP Code Description
HTTP404 CodeGALAXY_APP_NOT_FOUND DescriptionNo app with this id on the host — the container is already gone, or the record does not match the host
HTTP409 CodeCONFLICT DescriptionThe app status changed during the operation. Re-read the state and retry
HTTP409 CodeGALAXY_APP_REBOOT_USE_AGENT_CONTROLS DescriptionThe app was created by an agent or a bot — manage it from that agent's or bot's controls, not via /reboot
HTTP409 CodeGALAXY_APP_BUSY DescriptionBusy — either another command is running on the host (a neighbouring app's build) or another operation already holds the lock for this same app (a repeat click / a deploy). Retryable: the response carries a Retry-After header plus error.retryable: true and error.retryAfter in the body
HTTP422 CodeSERVER_WRONG_STATE DescriptionThe app is not in running/error status (e.g. sleeping). error.availableActions lists what you can do now. In any status outside running/error this refusal additionally starts a host repair — see below
HTTP502 CodeGALAXY_HOST_UNREACHABLE DescriptionThe galaxy host is unreachable — its tunnel has dropped. error.hint says what to do. Retry after the host recovers

An app refusal also repairs the host

A Galaxy app whose host has lost its connection to the platform hits the same barrier in every operation: both waking and deploying go through the host, and the host is unreachable. So before the 422 SERVER_WRONG_STATE refusal, the platform starts restoring the host connection in the background — the refusal itself still stands, but the next attempt has a chance to go through.

If the repair did start, the error body carries an optional hint object:

Field Type Description
Fielderror.hint.reason Typestring DescriptionWhy the request was refused and what was started
Fielderror.hint.recovery Typestring DescriptionWhich operation to retry — POST /deploy
Fielderror.hint.retryAfterSeconds Typenumber DescriptionLower bound of the wait, in seconds. A guideline, not a promise of readiness

The hint object may be absent, and that is not an error. It is missing when no repair was started: the host connection is in fact alive, a repair is already under way or finished recently, the host itself is off or asleep, it was woken recently, the guest system on the machine does not boot, the machine is blocked from waking, or automatic recovery is switched off on the platform. Read hint as an optional cue — if it is there, wait the stated time and retry the deploy; if it is not, act on the error code.

Repeat calls do not start a new repair. While a repair is running, and for 10 minutes after it ends — successfully or not — the platform starts no new one, so a repeat refusal arrives without hint. This is the same ten-minute window as the lifetime of a completed record in Repair status. A repair that broke off and stopped reporting is treated as dead after 20 minutes and may be started again.

The retryAfterSeconds value is 300 and stays a lower bound on the wait rather than a promise of readiness: retrying sooner buys nothing, retrying later is fine.

The 502 GALAXY_HOST_UNREACHABLE refusal carries a different hint — four fields instead of three, with their own set of values. They are described under "The error.hint field of GALAXY_HOST_UNREACHABLE" on the Galaxy app page. The shape of the cue is set by the refusal code, so parse it by the code rather than by the page it appeared on.

See also