---
title: "List hosts"
method: GET
path: "/hosts"
tags: ["Hosts"]
---

# List hosts

`GET /hosts`

## Request

- Base URL: `https://api.spectate.net/v1`
- URL: `https://api.spectate.net/v1/hosts`
- Auth: HTTP bearer

Returns the team's hosts, newest first unless you sort.

## Query parameters

- `page` integer
- `per_page` integer
- `filter[state]` 'up' | 'stale' | 'pending': Whether a host's agent reports. | | |---| | `up` <br/> Reported in the last 15 minutes. | | `stale` <br/> Reported before, but not in the last 15 minutes. | | `pending` <br/> The agent never reported. |
- `filter[project_id]` string, uuid
- `filter[search]` string
- `sort` string

## Response `200`

Paginated set of `Host`

- object
  - `current_page` integer, required
  - `data` Host[], required
    - `id` string, uuid, required: Host ID
    - `label` string, nullable, required: Name shown in the dashboard and alerts; the agent sets the hostname until you change it
    - `state` 'up' | 'stale' | 'pending', required: Whether a host's agent reports. | | |---| | `up` <br/> Reported in the last 15 minutes. | | `stale` <br/> Reported before, but not in the last 15 minutes. | | `pending` <br/> The agent never reported. |
    - `host_info` object, nullable, required: What the agent reports about the system, as key-value pairs (for example `hostname`, `os`, `platform`, `kernel_version`); the keys depend on the agent version and platform
    - `cpu_info` object[], nullable, required: The CPUs, each as key-value pairs (for example `model_name`, `cores`, `mhz`)
    - `agent_version` string, nullable, required: Version of the agent
    - `agent_update_version` string, nullable, required: A newer agent release, when the host runs an older one (`sudo spectate-agent update`)
    - `clock_offset_ms` integer, nullable, required: Server time minus the host's clock, in milliseconds, as last measured by a v2 agent; `null` when unknown
    - `last_seen_at` string, date-time, nullable, required: When the agent last reported
    - `no_data_alert_minutes` integer, nullable, required: Minutes without data before the "no data received" alert fires; `null` when that alert is off
    - `paused_reason` 'plan_limit' | 'team_paused', required: Why the system (not the user) paused a monitor, host, domain or status page. | | |---| | `plan_limit` <br/> Over the plan limit (trial expired, downgrade); the oldest resources stay active. | | `team_paused` <br/> The whole team's monitoring is paused (no paid plan, staff action or scheduled deletion). |
    - `project_id` string, uuid, nullable, required: The project the host belongs to; `null` for none
    - `escalation_paths` EscalationPathReference[], required: Escalation paths the host's alerts follow. Empty: the project's paths, else the team's default path
      - `id` string, uuid, required: Escalation path ID
      - `name` string, required: Escalation path name
    - `created_at` string, date-time, required: When the host registered
    - `health` HostHealthCheckResult[], required: Health checks (agent 2.1 or later): failed services, out of memory, reboot, updates, clock, file handles and pressure. Checks of collectors that are switched off, and Linux-only checks on other systems, are left out
      - `check` 'services' | 'oom' | 'reboot' | 'updates' | 'clock' | 'files' | 'pressure', required: A host health check, computed from what agent 2.1+ reports. | | |---| | `services` <br/> Failed systemd services. | | `oom` <br/> Processes killed for lack of memory (OOM kills) in the last 24 hours. | | `reboot` <br/> The system needs a reboot (after kernel or library updates). | | `updates` <br/> Pending package updates, security updates in particular. | | `clock` <br/> Whether the clock is synchronised (NTP) and close to the server's. | | `files` <br/> Open file handles against the system's maximum. | | `pressure` <br/> Tasks stalled waiting for memory or I/O (pressure stall information). |
      - `status` 'ok' | 'warning' | 'critical' | 'unknown', required: Verdict of a host health check. | | |---| | `ok` <br/> Nothing to do. | | `warning` <br/> Needs attention soon: a reboot or security updates pending, the clock not synchronised. | | `critical` <br/> Needs attention now: a service failed, processes were killed for lack of memory. | | `unknown` <br/> The agent does not report it (yet): an older agent, or nothing to report on this host. |
      - `detail` string, nullable, required: What was found, in one line
      - `since` string, date-time, nullable, required: Since when the problem has lasted (for out of memory: the last kill); `null` when there is none
    - `health_issues` integer, required: Number of health checks that need attention (`warning` or `critical`)
  - `first_page_url` string, nullable, required
  - `from` integer, nullable, required
  - `last_page_url` string, nullable, required
  - `last_page` integer, required
  - `links` object[], required: Generated paginator links.
    - `url` string, nullable, required
    - `label` string, required
    - `active` boolean, required
  - `next_page_url` string, nullable, required
  - `path` string, nullable, required: Base path for paginator generated URLs.
  - `per_page` integer, required: Number of items shown per page.
  - `prev_page_url` string, nullable, required
  - `to` integer, nullable, required: Number of the last item in the slice.
  - `total` integer, required: Total number of items being paginated.

## Other responses

- `401`: `UNAUTHENTICATED`: no token was sent. `INVALID_TOKEN`: the token is unknown or revoked. `TOKEN_EXPIRED`: the token has expired.
- `403`: `FORBIDDEN`: the token lacks an ability this endpoint requires (listed in `details.required_abilities`). `TEAM_PENDING_DELETION`: the team is scheduled for deletion. `TEAM_SUSPENDED`: Spectate suspended the team.
- `429`: `RATE_LIMITED`: too many requests for this token. Wait for the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/spectate/apis/spectate-api.md) - [All operations](https://skmtc.dev/spectate/apis/spectate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/spectate/apis/spectate-api/revisions/9b1a233997de?raw)
