Skip to content

Asset groups ​

media assets groups are used to isolate media assets under the same account by project, business user or scene. Once a grouping is created, group_id is entered in upload, list and detailed query, only to access media assets within that grouping.

If group_id, MoonNexAI will use default grouping.

Create Group ​

http
POST /v1/asset-groups
bash
curl https://moonnexai.com/v1/asset-groups \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "project-a",
    "description": "Project A materials",
    "domain": "media"
  }'

Request fields ​

fieldTypeshall fillAnnotations
namestringYes.Group Name. Suggest your project name, business user ID or scene name.
descriptionstringYesDescription of the cluster.
domainstringYesGrouping uses. media assets uploads commonly used media; treated with default media assets applications when not uploaded.

Example response ​

json
{
  "object": "asset_group",
  "id": "group_xxx",
  "group_id": "group_xxx",
  "domain": "media",
  "name": "project-a",
  "description": "Project A materials",
  "group_type": "custom",
  "status": "enabled",
  "visibility": "private",
  "created_at": 1710000000,
  "updated_at": 1710000000,
  "trace_id": "2026060301010100000000000000000000",
  "request_id": "2026060301010100000000000000000000"
}

Saves the returned group_id, which is used for subsequent uploads and queries.

Query Group List ​

http
GET /v1/asset-groups
bash
curl "https://moonnexai.com/v1/asset-groups?domain=media&page=1&page_size=20" \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

Query Parameters ​

ParametersTypeAnnotations
pageintegerPage number, default 1.
page_sizeintegerNumber of pages per page, default 20.
domainstringOptional. Filter by use, e.g. media.
statusstringOptional. enabled or disabled.

Example response ​

json
{
  "object": "list",
  "data": [
    {
      "object": "asset_group",
      "id": "group_xxx",
      "group_id": "group_xxx",
      "domain": "media",
      "name": "project-a",
      "description": "Project A materials",
      "group_type": "custom",
      "status": "enabled",
      "visibility": "private",
      "created_at": 1710000000,
      "updated_at": 1710000000
    }
  ],
  "count": 1,
  "total": 1,
  "trace_id": "2026060301010100000000000000000000",
  "request_id": "2026060301010100000000000000000000"
}

Query Group Details ​

http
GET /v1/asset-groups/{group_id}
bash
curl https://moonnexai.com/v1/asset-groups/group_xxx \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

If group_id is not currently account, or the format is incorrect, the error returns.

Update Group ​

http
PATCH /v1/asset-groups/{group_id}
bash
curl -X PATCH https://moonnexai.com/v1/asset-groups/group_xxx \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "project-a-updated",
    "description": "Updated materials"
  }'

Request fields ​

fieldTypeshall fillAnnotations
namestringYesNew group name.
descriptionstringYesNote on new groups.

name and description pass at least one.

Use Grouping in Upload ​

bash
curl https://moonnexai.com/v1/assets/uploads \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.0-kz-fast",
    "mode": "asset",
    "type": "image",
    "group_id": "group_xxx",
    "url": "https://example.com/reference.png"
  }'

After uploading successfully, the group_id in response will be equal to the group ID you have uploaded.

Use grouping in queries ​

bash
curl "https://moonnexai.com/v1/assets?group_id=group_xxx&type=image&page=1&page_size=20" \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"
bash
curl "https://moonnexai.com/v1/assets/asset_xxx?group_id=group_xxx" \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>"

The details search belt group_id returns if media assets is not in that group. This mechanism can be used to verify the media assets and grouping relationships that are saved side by side of the operation.

Common Errors ​

codeAnnotationsTreatment
invalid_group_idThe group_id format is incorrect.Use the ID in group_xxx format.
asset_group_not_foundGrouping does not exist, is no longer available or does not belong to the current account.Re-examine the group list to confirm the correct account and group_id.
missing_nameCreates a group without passing name.Additional group name.
missing_update_fieldsNo updates of field were sent to update the group.Import name or description.

Relevant Pages ​