List servers

List the servers in this zone, with their status and type. Filter by status, name, pool or metadata.

GET https://{availability_zone}.betterstackcloud.com/v1/servers
status string

Return only servers with this status. Possible values: starting, running, stopping, stopped, pooled, snapshotting, migrating, rescuing, restoring, rescaling, destroyed, terminating, terminated.

name string

Return only servers with exactly this name.

query string

Return servers whose name contains this text, ignoring case.

metadata object

Only servers with this tag, sent as metadata[<key>]=<value>. Repeat it to match servers that have every given tag. Accepts any keys.

pool_id string

Only servers from the server pool with this ID, both spare servers and claimed ones.

sort string

Send live_first to list servers that aren't destroyed or terminated first, newest first in each group. By default, the newest server comes first. Possible values: live_first.

page integer default: 1

The page to return, starting at 1.

per_page integer default: 25

How many entries to return per page. Maximum 1000.

Authorization string required

Bearer $TOKEN

Results are paginated

Use page and per_page to move through pages. See Pagination.

200

Returns the list of servers.

200 OK
{
  "data": [
    {
      "id": "example",
      "name": "Example server",
      "status": "starting",
      "rescue_state": "activating",
      "server_type": "AM1",
      "term": "monthly",
      "disk_size_gb": 1,
      "image": "ubuntu-26-04",
      "network_ids": [
        "123456789"
      ],
      "firewall_ids": [
        "123456789"
      ],
      "placement_group_id": "123456789",
      "pool_id": "123456789",
      "claimed_at": "2026-07-01T12:00:00.000Z",
      "ssh_keys": [
        "example"
      ],
      "ip_addresses": [
        {
          "id": "example",
          "ip": "example",
          "type": "example",
          "reserved_ip": false,
          "ptr_record": "example"
        }
      ],
      "private_ips": [
        {
          "id": "example",
          "network_id": "123456789",
          "ip": "example"
        }
      ],
      "cloudflare_records": [
        {
          "id": "example",
          "type": "example",
          "domain": "example",
          "a_record": "example",
          "proxied": false,
          "ttl": 1,
          "status": "up"
        }
      ],
      "subdomain": true,
      "ddos_protection": false,
      "ai_engineer_access": true,
      "vulnerability_monitoring": false,
      "observability": false,
      "nested_virtualization": false,
      "connection_tracking": {
        "budget": 1,
        "entries": 1,
        "measured_at": "2026-07-01T12:00:00.000Z",
        "over_budget": false
      },
      "lock": {
        "reason": "fraud",
        "details": "example",
        "locked_at": "2026-07-01T12:00:00.000Z"
      },
      "created_at": "2026-07-01T12:00:00.000Z",
      "updated_at": "2026-07-01T12:00:00.000Z",
      "team_id": "t123",
      "metadata": {
        "example": "value"
      }
    }
  ],
  "meta": {}
}
400

The body isn't valid JSON.

400 Bad Request
{
  "error": {
    "message": "Malformed JSON body.",
    "code": "bad_request"
  }
}
401

The API token is missing or invalid.

401 Unauthorized
{
  "error": {
    "message": "Missing or invalid token.",
    "code": "unauthorized"
  }
}
402

The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is payment_required. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return payment. The url in payment opens a page where you make the payment. When payment has an id, the resource is created after the payment. When it has no id, send the same request again after you pay. The page works until expires_at.

402 Payment Required
{
  "error": {
    "message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
    "code": "payment_required"
  }
}
403

A rule of the resource forbids the request.

409

The resource's current status doesn't allow the request.

422

A value isn't valid, with the code validation_failed. The error's details list the messages for each field.

423

We've locked the resource, with the code locked. Every change to a locked resource is refused, and so is a change that involves one.

429

Too many requests, with the code rate_limited. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the Retry-After header says.

500

An unexpected, temporary error on our side, with the code internal_error. Try again.

500 Internal Server Error
{
  "error": {
    "message": "The request could not be completed right now. Please try again in a few moments.",
    "code": "internal_error"
  }
}
503

We couldn't set up or change the resource, with the code orchestration_failed. Or the organization is creating too many resources at the same time, with the code concurrent_create_limit. Try again after a short wait.

id string

The server's ID, a UUID.

name string

The server's name. Must be unique among your organization's servers that aren't destroyed or terminated.

status string

The server's current status. After you start, stop or change the server, get it again until the change has finished.
Valid values:
starting: The server is booting.
running: The server is running.
stopping: The server is shutting down.
stopped: The server is stopped.
pooled: The server is waiting in a server pool. The server is running and billed, and nobody has claimed it yet.
snapshotting: We're creating a snapshot of the server.
migrating: We're moving the server to another host.
rescuing: The server is in rescue mode.
restoring: We're restoring the server from a snapshot.
rescaling: We're changing the server's type.
destroyed: The server is destroyed.
terminating: We're ending a spot server.
terminated: We've ended a spot server.

rescue_state string or null

Whether the rescue system is ready. null when the server isn't in rescue mode. After you start rescue mode, get the server again until rescue_state is active or null.
Valid values:
activating: The server is booting the rescue system. You can sign in when it's up.
active: The rescue system is up, and you can sign in.

server_type string

The name of the server type, such as AM4. The type sets the server's size. Get the types via List server types.

term string

The billing term. The server's public IPs and add-ons are billed on the same term.
Valid values:
monthly: Billed each month.
annual: Paid for a year at a time.

disk_size_gb integer

The size of the root disk, in GiB. Can differ from the type's storage_gb after a rescale that kept the disk size. A later rescale needs a type with at least this much storage, because disks never shrink.

image string or null

The slug of the server's image, such as ubuntu-26-04. null when the image was removed after the server was created. Get the images via List images.

network_ids array of strings

The IDs of the private networks attached to the server. Order doesn't matter.

firewall_ids array of strings

The firewall attached to the server, as a list with at most one ID. Order doesn't matter.

placement_group_id string or null

The ID of the placement group the server is in.

pool_id string or null

The ID of the server pool the server came from. null for a server you created directly.

claimed_at datetime or null

When the server was claimed from its server pool. null for a server that's still in its pool, and for a server you created directly. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

ssh_keys array of strings

The slug of each of the server's SSH keys. We add them to the server at its first boot. Order doesn't matter.

ip_addresses array of objects

The server's public addresses. Get the network interface of each via List server public IPs.

ip_addresses[].id string

The ID of the address on the server.

ip_addresses[].ip string

The address.

ip_addresses[].type string

Whether it's an ipv4 or ipv6 address.

ip_addresses[].reserved_ip boolean

Whether it's a reserved IP.

ip_addresses[].ptr_record string or null

The reverse DNS name. null when none is set.

private_ips array of objects

The server's addresses in private networks.

private_ips[].id string

The ID of the address on the server.

private_ips[].network_id string

The ID of the network.

private_ips[].ip string

The address in that network.

cloudflare_records array of objects

The Cloudflare DNS records that point to the server. The list holds the A and AAAA records you asked for on create, and the CNAME, A and AAAA records of the server's subdomain in onbetterstack.com.

cloudflare_records[].id string

The record's ID.

cloudflare_records[].type string

The record type, A, AAAA or CNAME.

cloudflare_records[].domain string

The Cloudflare zone of the record.

cloudflare_records[].a_record string

The record's name.

cloudflare_records[].proxied boolean

Whether Cloudflare proxies the record.

cloudflare_records[].ttl integer or null

The record's TTL in seconds. 1 means automatic.

cloudflare_records[].status string

Whether we've created the record, pending, created or failed.

subdomain boolean

Whether the server has a free subdomain in onbetterstack.com, made from its name. The subdomain's records are in cloudflare_records.

ddos_protection boolean

Whether DDoS protection is on.

ai_engineer_access boolean

Whether the Better Stack AI Engineer can sign in to the server over SSH.

vulnerability_monitoring boolean

Whether we scan the server daily for open ports and vulnerable software versions. Get the latest findings via Get a server's security scan.

observability boolean

Whether we installed the Better Stack collector when the server was created.

nested_virtualization boolean

Whether the server can run its own virtual machines. Always false for a server you create.

connection_tracking object

How many connections the server has, and the most it can have. When the server goes over its budget, new connections are dropped.

connection_tracking.budget integer

The most connections the server can have at once, 60,000 per vCPU of its type.

connection_tracking.entries integer or null

How many connections the server had at the last count. null before the first count.

connection_tracking.measured_at datetime or null

When we last counted the connections. We count once a minute. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

connection_tracking.over_budget boolean

Whether the server has more connections than its budget. New connections are dropped until it's back under the budget.

lock object or null

Why and when we locked the server. null when the server isn't locked. A locked server keeps running, but its network is cut and you can't change it.

lock.reason string

Why we locked the server. Possible values: fraud, non_payment, abuse, legal, security, maintenance, other.

lock.details string or null

More about the lock, or null.

lock.locked_at datetime

When we locked the server. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

created_at datetime

When the server was created. For a server moved to your team from another team's server pool, when it was moved. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the server was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

The ID of the team that owns the server. Get the team ID via List teams.

metadata object

Your own tags, as string keys and values. At most 10.