Seedance Asset Management
Endpoint and authentication
POST /api?Action=ACTION&Version=2024-01-01&ns=asset_manager
Send a JSON object (up to 1 MiB) with Content-Type: application/json and Authorization: Bearer YOUR_ROUTERRA_API_KEY. The API key must have access to an enabled asset management channel.
| Query parameter | Meaning |
|---|---|
Action |
Required action name. Use the exact spelling from the table below. |
Version |
Optional. Defaults to 2024-01-01, the only accepted version. |
ns |
Optional. Defaults to asset_manager. Use asset_manager_intl for the international namespace. Keep the same namespace in subsequent asset requests. |
GroupId |
The target group ID. Supply it in the query or JSON body when creating an asset. If both are present, they must match. |
Create a group and an asset
Set ROUTERRA_API_KEY to your own key. Create the group first, then replace GROUP_ID in the second request with the first response's Result.Id. Replace the example URL with a public HTTP or HTTPS URL that the provider can fetch. Set AssetType to Image, Video, or Audio as appropriate.
curl --fail-with-body 'https://routerra.ai/api?Action=CreateAssetGroup&Version=2024-01-01&ns=asset_manager' \
-H "Authorization: Bearer $ROUTERRA_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"Name":"Studio","GroupType":"AIGC"}'
curl --fail-with-body 'https://routerra.ai/api?Action=CreateAsset&Version=2024-01-01&ns=asset_manager' \
-H "Authorization: Bearer $ROUTERRA_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"GroupId":"GROUP_ID","AssetType":"Image","URL":"https://example.com/image.jpg"}'
Save the asset's Result.Id as ASSET_ID. Poll GetAsset with that ID while Result.Status is Processing. Once it is Active, use asset://ASSET_ID in the corresponding media URL field of a Seedance video request. If the status is Failed, check the error returned for the asset.
curl --fail-with-body 'https://routerra.ai/api?Action=GetAsset&Version=2024-01-01&ns=asset_manager' \
-H "Authorization: Bearer $ROUTERRA_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"Id":"ASSET_ID"}'
Actions
| Action | Example JSON body | Success result |
|---|---|---|
CreateAssetGroup |
{"Name":"Studio","GroupType":"AIGC"} |
Result.Id |
GetAssetGroup |
{"Id":"GROUP_ID"} |
Result |
ListAssetGroups |
{"Filter":{"GroupType":"AIGC"},"MaxResults":10} |
Result.Items |
UpdateAssetGroup |
{"Id":"GROUP_ID","Name":"Studio 2"} |
Result |
DeleteAssetGroup |
{"Id":"GROUP_ID"} |
Result |
CreateAsset |
{"GroupId":"GROUP_ID","AssetType":"Image","URL":"https://example.com/image.jpg"} |
Result.Id |
GetAsset |
{"Id":"ASSET_ID"} |
Result.Status |
ListAssets |
{"Filter":{"GroupType":"AIGC","GroupIds":["GROUP_ID"]},"MaxResults":10} |
Result.Items |
UpdateAsset |
{"Id":"ASSET_ID","Name":"Cover"} |
Result |
DeleteAsset |
{"Id":"ASSET_ID"} |
Result |
List pagination and permissions
To restrict an asset list to specific groups, set Filter.GroupIds to an array of their IDs.
Both list calls return Result.Items. When Result.NextToken is present, pass it unchanged as NextToken in the next request body and keep the filters the same. For page-number pagination, send PageNumber and PageSize together in place of NextToken and MaxResults.
Routerra scopes requests to assets and groups owned by the current account and available through the originating channel and its upstream credentials. An account with no accessible groups gets an empty list. A specified ID or filter for an inaccessible resource can return HTTP 403. Assets created directly at the provider do not appear automatically.
Errors
Check HTTP status and the body. Routerra errors use error.message. Upstream errors may use ResponseMetadata.Error. HTTP 400 can indicate an invalid action, field, or group ID, and 503 means the asset channel is unavailable or misconfigured. If an update or deletion returns upstream 409 OperationResultUnknown, read the resource again before retrying. Keep ResponseMetadata.RequestId when reporting an upstream error.