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, it returns 501 and the status is rolled back to running.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string (UUID) | yes | ID of a server in running status |
The request body is empty.
Examples
curl — personal key
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/reboot
curl — OAuth application
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
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
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 |
|---|---|---|
success |
boolean | true. The reboot command was sent to the provider |
Response example
{ "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:
{
"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):
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "Server state changed during operation"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 401 | MISSING_API_KEY |
The X-Api-Key header was not provided |
| 401 | INVALID_API_KEY |
Invalid or expired API key |
| 402 | ACCOUNT_FROZEN |
Vibecode balance is frozen. Top up and retry |
| 404 | SERVER_NOT_FOUND |
No server with this id — deleted, or belonging to another API key |
| 409 | CONFLICT |
State race — the server status changed during the operation. Retry the request after checking GET /v1/infra/servers/:id |
| 422 | SERVER_WRONG_STATE |
The server exists but is not in running status. error.currentState carries the current state; error.availableActions lists what you can do now |
| 422 | VM_MISSING |
The server record has no cloud VM (provisioning never finished or the VM was removed manually) — delete the server and create a new one |
| 429 | RATE_LIMITED |
The platform's overall request limit was exceeded |
| 501 | NOT_SUPPORTED |
The cloud provider does not support reboot. Use the sequence /stop → /start |
| 502 | PROVIDER_ERROR |
The 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 singleupdateManyconditioned onstatus = 'RUNNING'. If another/rebootor/stoparrives at the same moment, the second call gets 409CONFLICT. - Automatic rollback on a provider error. If
adapter.rebootServer()throws an exception, the record is reverted torunningstatus — so the client is not left with a "stuck"provisioning. - To restart only the application (without rebooting the virtual machine) use
POST /execwith the commandsystemctl restart app— it is dozens of times faster and does not break the tunnel. - After a reboot, wait for both fields. For the server to be ready, you need both
status: "running"andblackholeStatus: "CONNECTED"at the same time — the tunnel reconnects after the virtual machine starts.
See also
- Start server —
POST /v1/infra/servers/:id/start. - Stop server —
POST /v1/infra/servers/:id/stop. - Repair tunnel — if the tunnel does not recover after a reboot.
- Run a command — restart the application without rebooting the virtual machine.
Start the server
POST /v1/infra/servers/:id/start
Brings a server up from the sleeping, error, or provisioning states. For sleeping, the virtual machine is started again at the provider and returns to running status as it becomes ready — the call returns a response immediately, without waiting for actual readiness; track it by polling GET /v1/infra/servers/:id. For error with a connected tunnel (blackholeStatus: "CONNECTED"), the server is moved straight to running without contacting the provider. For provisioning, the start is retried without resetting the wait timer. If the server is not in one of these states — for example, already running — the call returns 422 SERVER_WRONG_STATE with the current state (currentState) and the list of available actions (availableActions).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string (UUID) | yes | Server ID |
The request body is empty.
Examples
curl — personal key
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/start
curl — OAuth application
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/start
JavaScript — personal key
await fetch(
`https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/start`,
{ method: 'POST', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
// Wait for readiness — poll GET /v1/infra/servers/:id
JavaScript — OAuth application
await fetch(
`https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/start`,
{
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
}
)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true. The virtual machine has been started at the provider, or the start command has been dispatched in the background |
Response example
{ "success": true }
Error response example
422 — the server exists but is not in sleeping/error/provisioning status, for example already running. The response carries the current state and the actions available now:
{
"success": false,
"error": {
"code": "SERVER_WRONG_STATE",
"message": "Server is RUNNING; /start requires one of SLEEPING, ERROR, PROVISIONING.",
"userMessage": "Server is currently RUNNING. Start only applies to SLEEPING, ERROR, or PROVISIONING servers.",
"currentState": { "status": "RUNNING", "blackholeStatus": "CONNECTED", "hasExternalId": true },
"availableActions": ["reboot", "sleep-now", "delete"]
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 401 | MISSING_API_KEY |
The X-Api-Key header was not provided |
| 401 | INVALID_API_KEY |
Invalid or expired API key |
| 402 | ACCOUNT_FROZEN |
Vibecode balance is frozen. Top up and retry |
| 404 | SERVER_NOT_FOUND |
No server with this id — deleted, or belonging to another API key |
| 409 | CONFLICT |
The server status changed during the operation — retry the request |
| 422 | SERVER_WRONG_STATE |
The server exists but is not in sleeping/error/provisioning status. error.currentState carries the current state; error.availableActions lists what you can do now |
| 422 | VM_MISSING |
The record has no externalId — the virtual machine was not created or was deleted externally. Delete the server and create a new one |
| 429 | RATE_LIMITED |
The platform-wide request limit was exceeded |
| 502 | PROVIDER_ERROR |
The cloud provider returned an error while starting the virtual machine |
Full list of common API errors — Errors.
Known specifics
- Blocking variant. If the client needs the server fully ready before the next step — use
POST /wake?wait=trueinstead of/start. It waits forstatus: "running"+blackholeStatus: "CONNECTED"for up to ~6.5 minutes. - Manual
/startbypassespreventWake. Unlike automatic wake on subdomain access, an explicitPOST /startclears thepreventWakeflag and starts the server even if it was blocked. Billing locks (ACCOUNT_FROZEN) are cleared by a separate top-up, not via/start. - For
runningit returns 422SERVER_WRONG_STATE. The server is already running — no repeat start is needed. For a reboot —POST /reboot.
See also
- Stop the server —
POST /v1/infra/servers/:id/stop. - Wake the server (with
?wait=true) — blocking variant that waits for readiness. - Sleep now — the reverse operation.
- Refresh status — force a provider poll after start.
- Get the server — poll for readiness.