## DNS API (cert validation) (`dns-apis`)

DNS provider API credentials used for DNS-01 validation and wildcard certificates. Credentials are write-only; responses return only masks.

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

### GET `/api/v2/dns-apis`

List DNS API credentials · Authentication: User (some parameters 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` |
| `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/dns-apis" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/dns-apis`

Create DNS API credential · 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 |

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `auth` | object |  | Credential key name to mask (last 4 chars shown as `****abcd` when 16+ chars, otherwise `********`); plaintext is never returned. |
| `des` | string |  | Description |
| `name` | string | Yes | Name |
| `type` | string | Yes | DNS provider. |

```sh
curl -X POST "https://panel.example.com/api/v2/dns-apis" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auth":{"DP_Id":"12345","DP_Key":"${DP_KEY}"},"name":"my-dns","type":"dnspod_cn"}'
```

### GET `/api/v2/dns-apis/{id}`

Get DNS API credential · Authentication: User (some parameters admin only)

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

### PUT `/api/v2/dns-apis/{id}`

Update DNS API credential · Authentication: User (some parameters admin only)

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `auth` | object |  | Credential key name to mask (last 4 chars shown as `****abcd` when 16+ chars, otherwise `********`); plaintext is never returned. |
| `des` | string |  | Description |
| `name` | string | Yes | Name |
| `type` | string | Yes | DNS provider. |

```sh
curl -X PUT "https://panel.example.com/api/v2/dns-apis/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auth":{"DP_Id":"12345","DP_Key":"${DP_KEY}"},"name":"my-dns","type":"dnspod_cn"}'
```

### DELETE `/api/v2/dns-apis/{id}`

Delete DNS API credential · Authentication: User (some parameters admin only)

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

DNS API (cert validation) object:

| Field | Type | Required | Description |
|---|---|---|---|
| `auth` | object |  | Credential key name to mask (last 4 chars shown as `****abcd` when 16+ chars, otherwise `********`); plaintext is never returned. |
| `created_at` | string |  | Created at (read-only) |
| `des` | string |  | Description |
| `id` | integer |  | Record ID (read-only) |
| `name` | string |  | Name |
| `tenant_id` | integer |  | Owner tenant (user) ID (read-only) |
| `type` | string |  | DNS provider. |
| `updated_at` | string |  | Updated at (read-only) |
