REST API
Everything the CLI does is a call to https://api.kestrel.dev/v4. Authenticate with a bearer token.
Authentication
curl https://api.kestrel.dev/v4/hosts \
-H "Authorization: Bearer $KESTREL_TOKEN"
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /v4/hosts | List hostnames in the current environment. |
| GET | /v4/hosts/{host} | Host config and TLS state. |
| POST | /v4/manifests | Create a manifest revision. |
| POST | /v4/environments/{env}/activate | Activate a revision. |
| GET | /v4/metrics | Aggregated counters, 1-minute granularity. |
| POST | /v4/purge | Purge by path, tag or full host. |
Purge example
curl -X POST https://api.kestrel.dev/v4/purge \
-H "Authorization: Bearer $KESTREL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"host":"api.example.com","tags":["release-2026-11"]}'
# {"purge_id":"pg_7c1f","accepted":1284,"propagates_in_ms":900}
Errors
{"error":{"code":"route_conflict","message":"path_prefix /v1 overlaps an earlier route","field":"routes[2].match"}}
Codes are stable; messages are not. Branch on error.code.
Rate limits
Control-plane calls are limited to 120 requests per minute per token, with a burst of 40. Exceeding it returns 429 and a retry-after header in seconds.