Assets
Upload, list, query, update, and delete assets (CreateAsset / ListAssets / GetAsset / UpdateAsset / DeleteAsset)
An asset is a concrete file (image/video/audio) attached to an asset group. Create a group first (see Asset Groups). All five Actions below use the CRUD envelope response format. Asset status enum: Active (ready), Processing (in progress), Failed (failed).
CreateAsset — Upload Asset
Uploads an asset into a group (by URL, registered asynchronously).
Request
| Field | Type | Required | Description |
|---|---|---|---|
GroupId | string | Yes | Target asset group id (must be owned by the current API key, otherwise 404) |
URL | string | Yes | Publicly accessible URL of the asset |
Name | string | Yes | Asset name (≤255 chars, no </>, otherwise 400) |
AssetType | string | Yes | Image / Video / Audio |
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/api/material/CreateAsset" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"GroupId":"group-xxx","URL":"https://example.com/image.jpg","Name":"Asset 1","AssetType":"Image"}'Response
{
"ResponseMetadata": { "RequestId": "req_xxx", "Action": "CreateAsset", "Version": "2024-01-01", "Service": "ark", "Region": "cn-beijing" },
"Result": { "Id": "Asset-xxx" }
}Registration is asynchronous; check the status via ListAssets or GetAsset.
Ark-Compatible Endpoint
When migrating code written for the Ark management plane, upload with Action in the query string instead of the path:
BASE_URL="https://api.yunjizi.cn"
curl -X POST "$BASE_URL/?Action=CreateAsset&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"GroupId":"group-xxx","URL":"https://example.com/image.jpg","Name":"Asset 1","AssetType":"Image"}'
# Alias for deployments where the root path is intercepted by a reverse proxy:
# POST "$BASE_URL/api/ark?Action=CreateAsset&Version=2024-01-01"- Request body, ownership checks and
Result.Idare identical to/api/material/CreateAsset. Versionis optional: when omitted the gateway forwards2024-01-01; any other value is forwarded as-is.- Errors use the Ark envelope instead of a top-level error object:
{"ResponseMetadata":{"Error":{"Code":"...","Message":"..."},"RequestId":"..."}}. - The query-string form works for every Action in the material library. See Ark-compatible examples below and Differences Between the Two Forms.
ListAssets — List Assets
Lists assets by asset group. Both Filter.GroupIds and Filter.GroupType are required — when empty/missing the gateway returns 400 InvalidParameter, preventing unauthorized listing of all assets under the shared account.
Request
| Field | Type | Required | Description |
|---|---|---|---|
Filter.GroupIds | []string | Yes | Asset group id list (must all be owned by the current API key, otherwise 404) |
Filter.GroupType | string | Yes | Group type filter (currently AIGC / LivenessFace) |
Filter.Statuses | []string | No | Active / Processing / Failed |
Filter.Name | string | No | Fuzzy name match |
PageNumber | int | Yes | Page number (missing → 400 MissingParameter.PageNumber) |
PageSize | int | Yes | Page size (default 20, range 1–100; required together with PageNumber) |
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/api/material/ListAssets" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"Filter":{"GroupIds":["group-xxx"],"GroupType":"AIGC"},"PageNumber":1,"PageSize":10}'Response
{
"ResponseMetadata": { "RequestId": "req_xxx", "Action": "ListAssets", "Version": "2024-01-01", "Service": "ark", "Region": "cn-beijing" },
"Result": {
"TotalCount": 1,
"Items": [
{ "Id": "Asset-xxx", "Name": "Asset 1", "URL": "https://example.com/image.jpg", "GroupId": "group-xxx", "AssetType": "Image", "Status": "Active", "CreateTime": "2026-08-19T02:10:00Z", "UpdateTime": "2026-08-19T02:10:00Z" }
],
"PageNumber": 1,
"PageSize": 10
}
}GetAsset — Get Asset Details
Queries the full information of an asset by Id (including Status, URL, Error).
Request
| Field | Type | Required | Description |
|---|---|---|---|
Id | string | Yes | Asset id (Asset-...) |
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/api/material/GetAsset" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx"}'Response
{
"ResponseMetadata": { "RequestId": "req_xxx", "Action": "GetAsset", "Version": "2024-01-01", "Service": "ark", "Region": "cn-beijing" },
"Result": { "Id": "Asset-xxx", "Name": "Asset 1", "URL": "https://example.com/image.jpg", "GroupId": "group-xxx", "AssetType": "Image", "Status": "Active", "Error": null }
}UpdateAsset — Update Asset
Renames an asset by Id.
Request
| Field | Type | Required | Description |
|---|---|---|---|
Id | string | Yes | Asset id |
Name | string | No | New name (≤255 chars, no </>, otherwise 400) |
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/api/material/UpdateAsset" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx","Name":"New name"}'Response
{
"ResponseMetadata": { "RequestId": "req_xxx", "Action": "UpdateAsset", "Version": "2024-01-01", "Service": "ark", "Region": "cn-beijing" },
"Result": {}
}DeleteAsset — Delete Asset
Deletes a single asset by Id.
Request
| Field | Type | Required | Description |
|---|---|---|---|
Id | string | Yes | Asset id |
BASE_URL="https://yunjizi.cn" # Domestic; overseas use https://api.yunjizi.cn
curl "$BASE_URL/api/material/DeleteAsset" \
-H "Authorization: Bearer sk-YOUR-KEY" \
-H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx"}'Response
{
"ResponseMetadata": { "RequestId": "req_xxx", "Action": "DeleteAsset", "Version": "2024-01-01", "Service": "ark", "Region": "cn-beijing" },
"Result": {}
}Ownership note:
GetAsset/UpdateAsset/DeleteAssetresolve ownership by calling upstreamGetAssetand checking the returnedGroupIdagainst the current API key; if upstream fails or returns noGroupId, the request is rejected with404 NotFound. The Ark-compatible entry applies the same check. Assets in groups not registered to the current API key (for example, groups created outside the gateway) are treated as not found.
Ark-Compatible Examples
Every Action on this page also accepts Action in the query string. Request bodies are unchanged; the success Result is the same object shown above, wrapped in ResponseMetadata:
BASE_URL="https://api.yunjizi.cn"
# CreateAsset
curl -X POST "$BASE_URL/?Action=CreateAsset&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" -H "Content-Type: application/json" \
-d '{"GroupId":"group-xxx","URL":"https://example.com/image.jpg","Name":"Asset 1","AssetType":"Image"}'
# ListAssets — Filter.GroupIds is required and must be non-empty
curl -X POST "$BASE_URL/?Action=ListAssets&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" -H "Content-Type: application/json" \
-d '{"Filter":{"GroupIds":["group-xxx"],"GroupType":"AIGC"},"PageNumber":1,"PageSize":10}'
# GetAsset
curl -X POST "$BASE_URL/?Action=GetAsset&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" -H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx"}'
# UpdateAsset — ownership resolved through GetAsset.GroupId
curl -X POST "$BASE_URL/?Action=UpdateAsset&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" -H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx","Name":"New name"}'
# DeleteAsset — ownership resolved through GetAsset.GroupId
curl -X POST "$BASE_URL/?Action=DeleteAsset&Version=2024-01-01" \
-H "Authorization: Bearer sk-YOUR-KEY" -H "Content-Type: application/json" \
-d '{"Id":"Asset-xxx"}'Empty Filter.GroupIds returns 400 InvalidParameter (Filter.GroupIds is required) before any upstream call. Errors use ResponseMetadata.Error; the /api/ark alias accepts the same query string when POST / is intercepted.
Asset Groups
List, create, query, update, and delete asset groups (ListAssetGroups / GetAssetGroup / CreateAssetGroup / UpdateAssetGroup / DeleteAssetGroup)
Real-Person Verification
H5 liveness verification loop for real-person (LivenessFace) materials (CreateVisualValidateSession / GetVisualValidateResult)