Asset library overview
Single endpoint, authentication, response envelope and the action list
The asset library is not a RESTful API. Every operation goes to the same endpoint and is selected with the Action query parameter:
POST https://jiniu.ai/api/material?Action=<action>
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonThe body is JSON; actions that take no parameters accept {}.
Actions
| Category | Action | Purpose |
|---|---|---|
| Asset group | CreateAssetGroup | Create an asset group |
| Asset group | GetAssetGroup | Get an asset group |
| Asset group | UpdateAssetGroup | Update an asset group |
| Asset group | DeleteAssetGroup | Delete an asset group |
| Asset group | ListAssetGroups | List asset groups |
| Asset | CreateAsset | Upload an asset |
| Asset | GetAsset | Get an asset |
| Asset | UpdateAsset | Update an asset |
| Asset | DeleteAsset | Delete an asset |
| Asset | ListAssets | List assets |
| Verification | CreateVisualValidateSession | Create a liveness session |
| Verification | GetVisualValidateResult | Get the verification result |
| Verification | CreateRealValidateH5 | Issue a verification H5 link |
Response envelope
The business result is always wrapped in Result:
{
"ResponseMetadata": { "RequestId": "…", "Action": "CreateAssetGroup" },
"Result": { "Id": "group-xxxx" }
}On a business failure Result.Error is set:
{
"ResponseMetadata": { "RequestId": "…", "Action": "CreateAsset" },
"Result": { "Error": { "Code": "InvalidParameter", "Message": "AssetType must be one of Image/Video/Audio" } }
}Gateway-level failures (no available channel, upstream unreachable) use the standard error structure with a 4xx or 5xx status code.
Billing
Asset library calls are pure pass-through: no tokens counted, no charge, no consumption log.
Channel affinity
Assets and asset groups stay on the channel that created them — the gateway matches on the Id in the request body and routes back to the same place. Reaching the same asset with a key from another group may therefore fail, depending on your group configuration.
ListAssetGroups and ListAssets are served from the gateway's local ownership index, scoped to the current user and never forwarded upstream, so they only show records created through this gateway.