API reference

Base URL https://api.cache.bz/v1. All requests and responses are JSON. Authenticate with a bearer token.

Errors

StatusMeaning
400The request body is invalid. The response explains which field.
401Missing or invalid token.
403The token is valid but not allowed to do this.
404The resource does not exist.
429Rate limit exceeded. Retry after the time in Retry-After.

Sites

GET/v1/sitesList sites
POST/v1/sitesCreate a site
GET/v1/sites/{id}Get a site
PUT/v1/sites/{id}Update a site
DELETE/v1/sites/{id}Delete a site

Cache rules

GET/v1/sites/{id}/rulesList cache rules
PUT/v1/sites/{id}/rulesReplace cache rules

Purge

POST/v1/sites/{id}/purgePurge by URL, prefix or tag

Analytics

GET/v1/sites/{id}/analyticsTraffic and cache statistics

Certificates

GET/v1/sites/{id}/certificatesList certificates
POST/v1/sites/{id}/certificatesUpload a certificate

Pagination

List endpoints return up to 50 items and a next_cursor. Pass it as ?cursor= to get the next page.

Example: purge by tag

POST /v1/sites/st_8KfQ2m/purge
{ "tags": ["article-1842", "homepage"] }

202 Accepted
{ "id": "pg_3Hx9", "status": "queued", "estimated_seconds": 1 }