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

Wake server

POST /v1/infra/servers/:id/wake

Wakes a server from sleeping or provisioning. Unlike /start, /wake supports a blocking mode via ?wait=true — the response is returned only when the server is fully ready (the virtual machine has started and the tunnel has connected) or the timeout fires. Use the blocking mode when the client needs readiness before the next step (a cron job, a triggered call), and the asynchronous one when you can afford to poll.

Parameters

Parameter In Type Required Default Description
id path string (UUID) yes ID of a server in sleeping or provisioning status
wait query string no true — blocking mode: the response returns only when the server is ready (up to 6.5 minutes) or the timeout fires. Any other value — asynchronous mode, the response returns immediately

The request body is empty.

Examples

curl — personal key

Terminal
# Asynchronous call — response immediately, check readiness by polling
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/wake

# Blocking — waits for readiness up to ~6.5 minutes
curl -X POST -H "X-Api-Key: YOUR_API_KEY" \
  "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/wake?wait=true"

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/wake?wait=true"

JavaScript — personal key

javascript
// Blocking variant — simplest for subsequent steps
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/wake?wait=true`,
  { method: 'POST', headers: { 'X-Api-Key': 'YOUR_API_KEY' } }
)
const body = await res.json()
if (!body.success) {
  // Rich error: show the user userMessage, suggest alternatives
  console.error(body.error.userMessage ?? body.error.message)
  if (body.error.alternatives) console.log('Options:', body.error.alternatives)
  throw new Error(body.error.code)
}
console.log(`Server ready: ${body.data.appUrl}`)

JavaScript — OAuth application

javascript
const res = await fetch(
  `https://vibecode.bitrix24.com/v1/infra/servers/${serverId}/wake?wait=true`,
  {
    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 wake
data.id string (UUID) Server ID
data.status string Current status (RUNNING on success with wait=true; PROVISIONING in asynchronous mode)
data.blackholeStatus string Tunnel state (CONNECTED in blocking mode on success)
data.appUrl string | null HTTPS address of the application

Response example

Successful wake (?wait=true):

JSON
{
  "success": true,
  "data": {
    "id": "e765edfc-ba0a-43de-b8ea-838dd872c522",
    "status": "RUNNING",
    "blackholeStatus": "CONNECTED",
    "appUrl": "https://app-05b67cf7.vibecode.bitrix24.com"
  }
}

Error response example

402 — a commercial plan is required (rich error for AI agents):

JSON
{
  "success": false,
  "error": {
    "code": "COMMERCIAL_PLAN_REQUIRED",
    "message": "Waking this server requires a commercial Bitrix24 plan or an active trial",
    "userMessage": "Waking the server requires a commercial Bitrix24 plan or an active trial. Get a plan at https://www.bitrix24.com/prices/",
    "alternatives": [
      "Upgrade the Bitrix24 plan and retry",
      "Switch to AI Router with BYOK keys — it works on any plan"
    ],
    "hint": "Do not retry automatically — a user action is required"
  }
}

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 COMMERCIAL_PLAN_REQUIRED The plan is free and the trial is unavailable — upgrade your Bitrix24 plan
402 INT_TARIFF_REQUIRED The Bitrix24 plan is free — waking requires a commercial plan (a demo plan grants a limited trial)
402 TRIAL_EXPIRED The trial was used and has ended
402 BILLING_EXHAUSTED The Vibecode balance is exhausted — top it up
402 ACCOUNT_FROZEN The balance is frozen
403 SERVER_WAKE_BLOCKED Wake blocked for a non-billing reason (an ended trial, an administrative block, security violations)
404 NOT_FOUND The server is not in sleeping/provisioning status, was deleted, or belongs to another API key
422 VM_MISSING The record has no externalId — the virtual machine was not created on the provider side. Delete the server and create a new one
429 RATE_LIMITED The request rate limit was exceeded. The response carries a Retry-After header with the recommended pause
502 PROVIDER_ERROR The cloud provider returned an error while starting the virtual machine
503 WAKE_TIMEOUT The blocking ?wait=true call timed out (~6.5 minutes) before the server became ready. The server returns to sleeping — try again

The full list of common API errors — Errors.

Known specifics

  • Behavior on a ?wait=true timeout. If the virtual machine has not come up within ~6.5 minutes, the endpoint returns 503 WAKE_TIMEOUT and tries to roll the server back to sleeping — so the quota is not left hanging on a "forever stuck" server. Retry /wake or call /repair.
  • Rich-error fields for AI agents. On 402/403 the error body additionally contains userMessage (a localized message for the user), alternatives (a list of resolution paths), and hint (advice to the AI agent on whether to retry automatically or not). Use these fields in the UI instead of the bare code/message.
  • /wake is not needed when accessing through the HTTPS subdomain. Any request to the server's HTTPS subdomain automatically wakes the Black Hole server. An explicit /wake is needed when:
    • The client needs a programmatic "wake first, then act" gate — via wait=true.
    • The server is marked preventWake=true (a billing block that requires manual action).
  • Check availability BEFORE the call. Before calling /wake, call GET /v1/me and look at capabilities.servers.wake.available. If it is false, the user must take action (top up the balance, upgrade the plan) before waking becomes possible.
  • /wake is not suitable for an error server — use /start or /repair.

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