Get a load balancer

Get a load balancer, with its status, addresses, services and targets.

GET https://{availability_zone}.betterstackcloud.com/v1/load-balancers/{id}
id string required

The ID of the load balancer to get.

Authorization string required

Bearer $TOKEN

200 OK
{
  "id": "example",
  "name": "Example load balancer",
  "type": "LB1",
  "algorithm": "round_robin",
  "status": "provisioning",
  "status_message": "example",
  "public_ips": [
    {
      "ip": "example",
      "type": "example"
    }
  ],
  "private_ips": [
    {
      "network_id": "123456789",
      "ip_address": "example"
    }
  ],
  "network_ids": [
    "123456789"
  ],
  "firewall_ids": [
    "123456789"
  ],
  "services": [
    {
      "id": 1,
      "protocol": "tcp",
      "listen_port": 443,
      "destination_port": 443,
      "redirect_http": false,
      "http_timeout_seconds": 180,
      "sticky_sessions": false,
      "sticky_cookie_name": "Example",
      "sticky_cookie_lifetime_seconds": 1,
      "proxy_protocol": "disabled",
      "certificate_ids": [
        "123456789"
      ],
      "target_health": [
        {
          "service_id": 123456789,
          "server_id": "123456789",
          "state": "up",
          "state_changed_at": "2026-07-01T12:00:00.000Z",
          "status_message": "example"
        }
      ],
      "health_check": {
        "protocol": "tcp",
        "port": 443,
        "interval_seconds": 180,
        "timeout_seconds": 180,
        "retries": 1,
        "domain": "example",
        "path": "example",
        "response": "example",
        "status_codes": "example",
        "tls": false
      },
      "created_at": "2026-07-01T12:00:00.000Z",
      "updated_at": "2026-07-01T12:00:00.000Z"
    }
  ],
  "targets": [
    {
      "id": 1,
      "type": "server",
      "server_id": "123456789",
      "selector": {
        "example": "value"
      },
      "use_private_ip": false,
      "created_at": "2026-07-01T12:00:00.000Z",
      "updated_at": "2026-07-01T12:00:00.000Z"
    }
  ],
  "config_applied_at": "2026-07-01T12:00:00.000Z",
  "term": "monthly",
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-01T12:00:00.000Z",
  "team_id": "t123",
  "metadata": {
    "example": "value"
  }
}

Returns the load balancer.

id string

The load balancer's ID, a UUID.

name string

The load balancer's name.

type string

The load balancer's type, such as LB1.

algorithm string

How the load balancer picks a target for each connection.
Valid values:
round_robin: Sends each new connection to the next target in turn.
least_connections: Sends each new connection to the target with the fewest open connections.
source_ip: Sends all connections from one client IP to the same target.

status string

The load balancer's state.
Valid values:
provisioning: We're starting the load balancer.
running: The load balancer is ready. status_message reports any problem. config_applied_at says when we last applied your configuration.
rescaling: We're changing the load balancer's type. The load balancer returns to running even when the change didn't finish. The load balancer's events say how the change went.
failed: We couldn't create the load balancer. status_message says why.
destroyed: The load balancer is deleted.

status_message string or null

What went wrong while we created or configured the load balancer, or what's wrong with it now. Is null when there's nothing to report.

public_ips array of objects

The load balancer's public IP addresses, one IPv4 and one IPv6.

public_ips[].ip string

The ip.

public_ips[].type string

The type.

private_ips array of objects

The load balancer's private IP in each attached network.

private_ips[].network_id string

The network id.

private_ips[].ip_address string

The ip address.

network_ids array of strings

The IDs of the networks attached to the load balancer. Order doesn't matter.

firewall_ids array of strings

The IDs of the firewalls attached to the load balancer, at most one. Order doesn't matter.

services array of objects

The services that listen for traffic, with their settings and the latest health of each target. Add, update or remove them with betterstack load-balancer-service.

services[].id integer

The id.

services[].protocol string

Possible values: tcp, http, https, udp.

services[].listen_port integer

The listen port.

services[].destination_port integer

The destination port.

services[].redirect_http boolean

The redirect http.

services[].http_timeout_seconds integer

The http timeout seconds.

services[].sticky_sessions boolean

The sticky sessions.

services[].sticky_cookie_name string

The sticky cookie name.

services[].sticky_cookie_lifetime_seconds integer

The sticky cookie lifetime seconds.

services[].proxy_protocol string

Possible values: disabled, v1, v2.

services[].certificate_ids array of strings

The certificate ids.

services[].target_health array of objects

The target health.

services[].target_health[].service_id integer

The service id.

services[].target_health[].server_id string

The server id.

services[].target_health[].state string

Possible values: up, down, unknown.

services[].target_health[].state_changed_at datetime or null

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

services[].target_health[].status_message string or null

The status message.

services[].health_check object

The health check.

services[].health_check.protocol string

Possible values: tcp, http.

services[].health_check.port integer

The port.

services[].health_check.interval_seconds integer

The interval seconds.

services[].health_check.timeout_seconds integer

The timeout seconds.

services[].health_check.retries integer

The retries.

services[].health_check.domain string or null

The domain.

services[].health_check.path string

The path.

services[].health_check.response string or null

The response.

services[].health_check.status_codes string

The status codes.

services[].health_check.tls boolean

The tls.

services[].created_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

services[].updated_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

targets array of objects

The targets you added. A label_selector target shows as one entry, not one per matching server.

targets[].id integer

The id.

targets[].type string

Possible values: server, label_selector.

targets[].server_id string or null

The server id.

targets[].selector object or null

The selector.

targets[].use_private_ip boolean

The use private ip.

targets[].created_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

targets[].updated_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

config_applied_at datetime or null

When we last applied the configuration to the load balancer, or null until we first apply it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

term string

The billing term.
Valid values:
monthly: Billed every month.
annual: Paid for a year.

created_at datetime

When the load balancer was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the load balancer 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 load balancer.

metadata object

Your own tags as string pairs.