## Forwarding groups (`stream-groups`)

Groups that organize forwarding rules for bulk management. Group names are unique per tenant, and a group that still has rules cannot be deleted.

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

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

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

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

Create forwarding group · Authentication: User (some parameters admin only)

Query parameters:

| Field | Type | Required | Description |
|---|---|---|---|
| `tenant_id` | integer |  | Owner tenant when an admin creates on behalf of a tenant (required); ignored for tenant callers, where the owner is always the caller. |

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `des` | string |  | Description |
| `name` | string | Yes | Name |

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

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

Get forwarding group · Authentication: User (some parameters admin only)

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

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

Update forwarding group · Authentication: User (some parameters admin only)

Request body:

| Field | Type | Required | Description |
|---|---|---|---|
| `des` | string |  | Description |
| `name` | string | Yes | Name |

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

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

Delete forwarding group · Authentication: User (some parameters admin only)

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

Forwarding 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 |
| `tenant_id` | integer |  | Owner tenant (user) ID (read-only) |
| `updated_at` | string |  | Updated at (read-only) |
