Skip to content

Get a server's live status

GET/servers/{server}/state

Overview

Returns the server's current power state, CPU usage, memory usage and uptime. This queries the server directly and may be slower than reading the cached server details. During a power operation, the state is starting, stopping, shutting_down or restarting. It returns to running or stopped when the operation completes or times out. Returns 503 with a message if the host cannot be reached.

Permissions

Requires the server.read (View servers) permission for the selected team. Resources outside that team return 404.

curl --request GET \
  --url 'https://console.advinservers.com/api/v1/client/servers/{server}/state' \
  --header 'Authorization: Bearer <token>' \
  --header 'Accept: application/json'
{
  "state": "running",
  "cpu_used": 0.22,
  "memory_total": 4294967296,
  "memory_used": 2164260864,
  "uptime": 1134000,
  "lock": null,
  "qmp_state": "running"
}

Authorization

Authorizationstringheaderrequired

Your API key, sent as a bearer token. Create one in the control panel under API Keys, give it only the permissions the integration needs, and copy it when it is created. It cannot be shown again. Each key is restricted to one owned team. The key determines the team for every request.

Send it as Bearer <token>.

Path parameters

serverstringrequired

The server uuid short

Response 200

application/json

The record, as a JSON object. There is no envelope.

statestringrequired

The billing state, province, or region, or null or an empty string to clear it.

One of: stopped, running, stopping, starting, shutting_down, restarting

cpu_usednumberrequired

The value of cpu_used.

memory_totalintegerrequired

The value of memory_total.

memory_usedintegerrequired

The value of memory_used.

uptimeintegerrequired

The value of uptime.

lockstring | nullrequired

The value of lock.

qmp_statestring | nullrequired

The value of qmp_state.

Errors

401
The key was missing, malformed, revoked, or belongs to an account that no longer exists.
403
Access denied. Check the key's team, permissions and allowed IP addresses. Some actions, such as managing API keys, require a browser session. The response message explains the reason.
404
The resource was not found in the selected team. Resources in another account or team also return 404.
429
Too many requests. The Retry-After header says how many seconds to wait. Limits are per account, so several keys on one account share them.
503
The server power state could not be read.