Skip to Content
PyoDocs

API overview

Automate Pyo over HTTP with an API key.

The API is what the dashboard and the CLI use. It works in one simple way. You read everything from a snapshot, and change anything through one endpoint.

Base URL

The API lives on your own Pyo:

https://your-pyo/api/v1

Authentication

Create an API key on the API keys page, then send it as a Bearer token:

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

A key is shown once, so save it when you create it.

A key expires after 30 days, 90 days (the default) or a year, or never. The API keys page shows when each key was last used and when it expires, and warns in its last week. An expired key gets a 401:

{ "error": "This API key expired. Create a new one." }

What a key can do

AccessWhat it allows
ReadReading only
DeployReading, plus deploying, cancelling, restarting, stopping and scaling
FullAnything its owner can do

A key can also be limited to some of your teams. Whatever its access, a key acts as you, with your role in each team. It can't manage your account or the installation.

Errors

Failed requests use a standard HTTP status, with the reason in the body:

{ "error": "This API key can only read." }

Pyo is at version 0.1, so the API can still change between releases.

Next

On this page

Edit page