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.
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.
/api/v2/cache-policyCache policy
Authentication: User (some parameters admin only)
Query parameters
| Field | Type | Description |
|---|---|---|
tenant_id | integer | Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data |
/api/v2/cache-policySet the tenant's default group
Authentication: User (some parameters admin only)
Request body application/json
| Field | Type | Description |
|---|---|---|
default_group_idRequired | integer | Platform default group; null = no group yet. |
/api/v2/cache-policy/default-impactPreview the impact of changing the default group
Authentication: User (some parameters admin only)
Query parameters
| Field | Type | Description |
|---|---|---|
tenant_id | integer | Admin only: filter by tenant (a malformed value returns 422). Ignored for tenant credentials, which only see their own tenant's data |
default_group_idRequired | integer | Id of the cache group to be used as default. |
/api/v2/cache-policy/reset-sitesReset all sites to the default group
Authentication: User (some parameters admin only)
Cache policy object
| Field | Type | Description |
|---|---|---|
affected_sites | integer | Sites following the default: no explicit group and the group in effect would change. |
applied | integer | Number of sites updated. |
default_group_id | integer | Platform default group; null = no group yet. |
my_default_group_id | integer | Default group in effect for this tenant (the one it set, or the platform default if none). |
my_default_group_set | boolean | Whether this tenant has set its own default group. |
over_limit_sites | integer | Of those, sites whose merged rules would exceed 128 after conversion, so the real change would be rejected with 422. |
overlay_sites | integer | Of those, sites with per-site changes that would be converted. |
sites | object | 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.
{
"id": 1,
"name": "example"
}{
"items": [
{
"id": 1
}
],
"page": 1,
"page_size": 20,
"total": 1
}{
"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"
}