## Package groups (`package-groups`)

Groups that organize packages so customers can browse and choose.

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

### GET `/api/v2/package-groups`

List package groups · 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/package-groups" \
  -H "X-API-Key: $GOCDN_API_KEY"
```

### POST `/api/v2/package-groups`

Create package group · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `des` | string |  | Description |
| `name` | string | Yes | Name |
| `sort` | integer |  | Display order (smaller first). |

```sh
curl -X POST "https://panel.example.com/api/v2/package-groups" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"入门套餐"}'
```

### GET `/api/v2/package-groups/{id}`

Get package group · Authentication: Admin only

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

### PUT `/api/v2/package-groups/{id}`

Update package group · Authentication: Admin only

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `des` | string |  | Description |
| `name` | string | Yes | Name |
| `sort` | integer |  | Display order (smaller first). |

```sh
curl -X PUT "https://panel.example.com/api/v2/package-groups/{id}" \
  -H "X-API-Key: $GOCDN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"入门套餐"}'
```

### DELETE `/api/v2/package-groups/{id}`

Delete package group · Authentication: Admin only

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

Package groups object:

| Field | Type | Required | Description |
|---|---|---|---|
| `created_at` | string |  | Created at (read-only) |
| `des` | string |  | Description |
| `id` | integer |  | Record ID (read-only) |
| `name` | string |  | Name |
| `sort` | integer |  | Display order (smaller first). |
| `updated_at` | string |  | Updated at (read-only) |
