## Cache policy (`cache-policy`)

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

Authentication: User (some parameters admin only) · Docs: https://www-demo.kuxitong.com/en/docs/api/cache-policy

### GET `/api/v2/cache-policy`

Cache policy · Authentication: User (some parameters admin only)

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `tenant_id` | integer |  | Admin only: filter by tenant. Ignored for tenant credentials, which only see their own tenant's data |

```sh
curl "https://panel.example.com/api/v2/cache-policy" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### PUT `/api/v2/cache-policy`

Set the tenant's default group · Authentication: User (some parameters admin only)

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `default_group_id` | integer | Yes | Platform default group; null = no group yet. |

```sh
curl -X PUT "https://panel.example.com/api/v2/cache-policy" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/cache-policy/reset-sites`

Reset all sites to the default group · Authentication: User (some parameters admin only)

```sh
curl -X POST "https://panel.example.com/api/v2/cache-policy/reset-sites" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

Cache policy object:

| Field | Type | Required | Description |
|---|---|---|---|
| `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. |
| `sites` | object |  | Number of the tenant's sites by cache mode: group (follows a cache group) and custom (own rules). |
