Version 2.4.8 · latest

Cache policy cache-policy

Sets the tenant's default cache group and can reset all sites to follow it.

Pick an endpoint to see its example call on the right.

CacheAuthentication: User (some parameters admin only)4 endpoints

Authentication

Send the X-API-Key header (create a key on the API Keys page; the key is shown only once at creation). An Authorization: Bearer token obtained by logging in also works.

X-API-Key

Authentication failures return 401; forbidden returns 403 (code such as insufficient_scope).

Conventions

Paging uses page (from 1) and page_size; sort with sort=field or sort=-field.

Times are RFC 3339 (UTC); amounts are in cents.

Writes return 200/201/204 on success; duplicates of a unique key return 409.

GET/api/v2/cache-policyCache policy

Authentication: User (some parameters admin only)

Query parameters

FieldTypeDescription
tenant_idinteger Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data
PUT/api/v2/cache-policySet the tenant's default group

Authentication: User (some parameters admin only)

Request body application/json

FieldTypeDescription
default_group_idRequiredinteger Platform default group; null = no group yet.
GET/api/v2/cache-policy/default-impactPreview the impact of changing the default group

Authentication: User (some parameters admin only)

Query parameters

FieldTypeDescription
tenant_idinteger Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data
default_group_idRequiredinteger Id of the cache group to be used as default.
POST/api/v2/cache-policy/reset-sitesReset all sites to the default group

Authentication: User (some parameters admin only)

Cache policy object

FieldTypeDescription
affected_sitesinteger Sites following the default: no explicit group and the group in effect would change.
appliedinteger Number of sites updated.
default_group_idinteger Platform default group; null = no group yet.
my_default_group_idinteger Default group in effect for this tenant (the one it set, or the platform default if none).
my_default_group_setboolean Whether this tenant has set its own default group.
over_limit_sitesinteger Of those, sites whose merged rules would exceed 128 after conversion, so the real change would be rejected with 422.
overlay_sitesinteger Of those, sites with per-site changes that would be converted.
sitesobject Number of the tenant's sites: total = all sites, overlay = those with per-site cache changes, follow_default = those whose cache group follows the default (no group set, or the group set is the tenant's effective default; independent of per-site changes).

Responses and errors

Success returns the resource JSON directly (HTTP 2xx); failures return application/problem+json (code, detail, plus errors on validation failures); lists carry items + total.

Success
{
  "id": 1,
  "name": "example"
}
List
{
  "items": [
    {
      "id": 1
    }
  ],
  "page": 1,
  "page_size": 20,
  "total": 1
}
Error
{
  "code": "validation_failed",
  "detail": "Invalid request parameters",
  "errors": [
    {
      "code": "required",
      "field": "/name",
      "message": "name is required"
    }
  ],
  "request_id": "0123456789abcdef",
  "status": 422,
  "title": "Unprocessable Entity",
  "type": "about:blank"
}
Get started

Try the live demo

Open the live demo, or contact us for a quote and the install command