Developer portal

Everything in the dashboard is an API call.

The Cache.bz REST API manages sites, deploys configuration, purges content and reads analytics. It is the same API our CLI, our Terraform provider and our own dashboard use.

BASEhttps://api.cache.bz/v1
curl
curl https://api.cache.bz/v1/sites \
  -H "Authorization: Bearer $CACHEBZ_TOKEN"

Authentication

Every request carries an API token in an Authorization: Bearer header. Tokens are created in the dashboard or the CLI, and each has a set of scopes, an optional list of sites and an expiry. The API authentication page in the documentation has the details.

Idempotency

Every POST accepts an Idempotency-Key header. Retrying with the same key within 24 hours returns the original response without repeating the action, so a CI step that timed out can always be re-run safely.

curl
curl -X POST https://api.cache.bz/v1/sites/site_7Hq2xK/purge \
  -H "Authorization: Bearer $CACHEBZ_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 4f1c2a9e-release-2291" \
  -d '{"tags": ["catalog"], "soft": true}'

Pagination

Lists are cursor-paginated. Pass the next value as the cursor parameter; when next is null you have reached the end.

JSON
{
  "data": [ ... ],
  "next": "c_9fK2"
}

Rate limits

1,200 requests per five minutes per token, with bursts up to 100 per second. Every response includes ratelimit-limit, ratelimit-remaining and ratelimit-reset headers. Over the limit, the API returns 429 with a retry-after header.

Versioning

The current version is v1. Within a version we only add things: new endpoints, optional parameters and response fields. Your code should ignore fields it does not know. Breaking changes are announced at least 12 months ahead in the changelog and by email to account owners.