# 创建素材分组

创建一个新的素材分组（AssetGroup），用于组织管理素材文件。

每个分组归属于当前认证用户，不同用户之间的分组相互隔离。
同一用户下的所有 API Key 共享素材分组。

**第三方 SaaS** 集成方可在 body 里传 `external_user_id`，把新建的 group 绑到具体 end-user（同 API key 下的其他 end-user 看不到）。

## POST /v1/asset-groups

> Create asset group

Create a new asset group (AssetGroup) for organizing and managing asset files.

Each group belongs to the authenticated user. Groups are isolated between users.
All API keys under the same user share asset groups.

**Third-party SaaS** callers can pass `external_user_id` in the body to scope the new group to a specific end-user (so other end-users behind the same API key won't see it).

### Authentication

`Authorization: Bearer tr-xxx`

### Request Body

Content-Type: `application/json`

- **name** `string` **(required)**  
  Group name
- **description** `string`  
  Group description (optional)
- **external_user_id** `string`  
  Optional third-party SaaS end-user identifier (opaque, ≤128 chars). Scopes the group to (api_user, external_user_id) so end-user A can't see end-user B's groups under the same API key. Omit for legacy single-tenant behaviour.

### Response

- **Id** `string`  
  Asset group ID
- **Name** `string`  
  Group name
- **Description** `string`  
  Group description
- **GroupType** ``AIGC``  
  Group type, fixed value `AIGC`
- **CreateTime** `string`  
  Creation time
- **UpdateTime** `string`  
  Last updated time

### Error Codes

- `400`: 
- `401`: 
- `429`: 
- `502`:
