## Package owners (`user-package-owners`)

Admin only: purchased packages grouped by user (package counts, expiry stats, tab counts).

Authentication: Admin only · Docs: https://www-sa2.kuxitong.com/en/docs/api/user-package-owners

### GET `/api/v2/user-package-owners`

List purchased packages grouped by user · 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 |
| `tab` | string |  | Tab: all, week (expiring within 7 days, not yet expired), month (expiring within 30 days, not yet expired), expired, customized (individually edited quotas or not following the base package); defaults to all. Values: ["all","week","month","expired","customized"] |
| `q` | string |  | Keyword: username, package name or base package name contains it (% and _ match literally), or it equals a user ID or package ID. |

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

Package owners object:

| Field | Type | Required | Description |
|---|---|---|---|
| `avatar_ver` | integer |  | Avatar version, increases on every upload and serves as the avatar cache key; omitted when there is no avatar. |
| `expired_count` | integer |  | Of which expired. |
| `expiring_count` | integer |  | Of which expiring within 7 days (not yet expired). |
| `next_end_at` | string |  | End time of the soonest not-yet-expired package in the tab; omitted when all are expired. |
| `nickname` | string |  | Nickname; omitted when not set (the UI shows the username). |
| `package_count` | integer |  | Packages in the tab. |
| `user_id` | integer |  | User ID (same as the tenant ID). |
| `username` | string |  | Username. |
