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

Stop the server

POST /v1/infra/servers/:id/stop

A graceful stop of a running server. The virtual machine is stopped at the provider, the status changes to sleeping, the open billing transaction for the active period is closed, and a transaction for the sleep period is opened (the sleep tariff is substantially lower). Works for any mode — both BLACKHOLE and OPEN. The server can be started again via POST /start or woken automatically by accessing the subdomain.

Parameters

Parameter In Type Required Description
id path string (UUID) yes Server ID

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/stop

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/stop

JavaScript — personal key

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

JavaScript — OAuth application

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

Response fields

Field Type Description
success boolean true on a successful stop

Response example

JSON
{ "success": true }

Error response example

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

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

404 — no server with this id (deleted, or belonging to another API key):

JSON
{
  "success": false,
  "error": {
    "code": "SERVER_NOT_FOUND",
    "message": "Server not found"
  }
}

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
404 SERVER_NOT_FOUND No server with this id — deleted, or belonging to another API key
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-wide request limit was exceeded
502 PROVIDER_ERROR The cloud provider returned an error while stopping

Full list of common API errors — Errors.

Known specifics

  • Why sleeping, not stopped. This is Infrastructure API terminology: a stopped server is called "sleeping" because billing for it follows a separate sleepPriceMonthly tariff (see provider tariffs) — lower than the active one. The value stopped does not appear in v1 responses.
  • /stop resets preventWake (the automatic flag that blocks waking) — after stopping, the server can again be woken automatically by accessing the subdomain or via /wake.
  • For BLACKHOLE there is an alternative — /sleep-now. The result is functionally identical. /sleep-now is used from the "Sleep" UI button and is explicitly marked as BH-specific; /stop is universal for any mode.

See also

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

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

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/start

JavaScript — personal key

javascript
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

javascript
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

JSON
{ "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:

JSON
{
  "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=true instead of /start. It waits for status: "running" + blackholeStatus: "CONNECTED" for up to ~6.5 minutes.
  • Manual /start bypasses preventWake. Unlike automatic wake on subdomain access, an explicit POST /start clears the preventWake flag and starts the server even if it was blocked. Billing locks (ACCOUNT_FROZEN) are cleared by a separate top-up, not via /start.
  • For running it returns 422 SERVER_WRONG_STATE. The server is already running — no repeat start is needed. For a reboot — POST /reboot.

See also