## File validation (`pki-validations`)

Admin only. Provides content for the CA file validation, answered by nodes via the controller; no longer served after expiry.

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

### GET `/api/v2/pki-validations`

List validation file contents · Authentication: Admin only

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `page` | integer |  | Page number, starting from 1 Default: 1 |
| `page_size` | integer |  | Items per page Default: 20 |
| `sort` | string |  | Sort fields, comma-separated; prefix `-` for descending, e.g. `-created_at,id` |

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

### POST `/api/v2/pki-validations`

Create validation file content · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `content` | string | Yes | Validation file content. |
| `name` | string | Yes | Name |
| `ttl_s` | integer |  | Seconds after which the file is no longer served; 0 or omitted = never expires. |

```sh
curl -X POST "https://panel.example.com/api/v2/pki-validations" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"example-validation-content","name":"0123456789ABCDEF0123456789ABCDEF.txt","ttl_s":86400}'
```

### DELETE `/api/v2/pki-validations/{id}`

Delete validation file content · Authentication: Admin only

```sh
curl -X DELETE "https://panel.example.com/api/v2/pki-validations/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

File validation object:

| Field | Type | Required | Description |
|---|---|---|---|
| `content` | string |  | Validation file content. |
| `created_at` | string |  | Created at (read-only) |
| `expires_at` | string |  | Expires at |
| `id` | integer |  | Record ID (read-only) |
| `name` | string |  | Name |
| `ttl_s` | integer |  | Seconds after which the file is no longer served; 0 or omitted = never expires. |
| `updated_at` | string |  | Updated at (read-only) |
