Skip to Content
PyoDocs

Reading data

The snapshot, logs, metrics and observability.

Every endpoint here is a GET under /api/v1.

Snapshot

GET /state returns everything you can see: teams, projects, clusters, servers, services and recent deployments. Most scripts only need this one.

curl https://your-pyo/api/v1/state \
  -H "Authorization: Bearer $PYO_TOKEN"

Service logs

GET /services/{id}/logs returns the recent output of a service's running replicas.

Metrics

GET /metrics returns CPU and memory over time for a team's servers and services.

ParameterDescription
teamThe team (required)
clusterA cluster id, or all
rangeThe time range, such as 24h

Observability

GET /observability returns traffic for a team's websites: a summary, a series over time, and the previous period to compare with. A read key is enough.

ParameterDescription
teamThe team (required)
projectA project id, or all
serviceLimit it to one service's domains
siteA domain id, or all
range1h, 24h, 7d or 30d (default 7d)

If the installation has no ClickHouse set up, it returns 503.

Request logs

GET /access-logs returns the requests your sites served, newest first. It takes team, project, service, site and range like observability, plus status, method, limit and before for paging back.

Images

GET /images?team=... lists the container images a team's services have run, with each version deployed.

On this page

Edit page