## CC settings (`cc-settings`)

Platform-level default CC rule group and automatic switching settings; admin only.

Authentication: Admin only · Docs: https://www-demo.kuxitong.com/en/docs/api/cc-settings

### GET `/api/v2/cc-settings`

Get CC settings · Authentication: Admin only

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

### PUT `/api/v2/cc-settings`

Update CC settings · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `auto_switch` | CcAutoSwitch | Yes | Settings for automatically switching to a stricter CC rule group. |
| `default_page_rule_id` | integer |  | Platform CC rule group id used by the default page (requests to unbound domains); null or omitted = no protection. |
| `default_rule_id` | integer | Yes | Platform CC rule group id used when a site has not chosen one; null = node default. |
| `expected_updated_at` | string |  | Optimistic lock - the updated_at as the caller read it (the version of the node.global config key, shared by CC and WAF settings; use 1970-01-01T00:00:00Z when the read value is null). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
| `updated_at` | string |  | Version in the response (updated_at of the node.global config key; null if never changed); ignored on update - use expected_updated_at for the optimistic lock. |

```sh
curl -X PUT "https://panel.example.com/api/v2/cc-settings" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auto_switch":{"enabled":false,"hold_s":300,"qps_50x":10,"qps_total":500,"rule_id":2},"default_rule_id":10002}'
```

CC settings object:

| Field | Type | Required | Description |
|---|---|---|---|
| `auto_switch` | CcAutoSwitch |  | Settings for automatically switching to a stricter CC rule group. |
| `default_page_rule_id` | integer |  | Platform CC rule group id used by the default page (requests to unbound domains); null or omitted = no protection. |
| `default_rule_id` | integer |  | Platform CC rule group id used when a site has not chosen one; null = node default. |
| `expected_updated_at` | string |  | Optimistic lock - the updated_at as the caller read it (the version of the node.global config key, shared by CC and WAF settings; use 1970-01-01T00:00:00Z when the read value is null). If it differs from the stored one, 409 stale_version is returned and nothing is saved; omit to skip the check. |
| `updated_at` | string |  | Version in the response (updated_at of the node.global config key; null if never changed); ignored on update - use expected_updated_at for the optimistic lock. (read-only) |
