Asset LibraryAsset Library API
Guide
Sync Asset Status
Refresh the names, statuses, error messages, and access addresses of groups and assets for the current account
Sync Asset Status
Sync Asset Status
POST
/api/v1/materials/syncAuthentication
Authorization: Bearer <API_KEY>.
Request Body · application/json
No fields are required; you can pass an empty object {}.
Request Example
curl -X POST "$LOCOPAL_BASE_URL/api/v1/materials/sync" \
-H "Authorization: Bearer $LOCOPAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Response Parameters
| Parameter | Type | Description |
|---|---|---|
code | integer | 0 on success |
msg | string | 素材状态已同步 on success |
data.groups | integer | Number of groups refreshed in this run |
data.adopted_groups | integer | Number of groups confirmed as belonging to the current account in this run |
data.assets | integer | Number of assets refreshed in this run |
data.removed_assets | integer | Number of assets confirmed to be invalid and removed |
Response Body
{
"code": 0,
"data": {
"groups": 2,
"adopted_groups": 0,
"assets": 3,
"removed_assets": 0
},
"msg": "素材状态已同步"
}Sync reads assets group by group for the current account's own groups, refreshing names, statuses, error messages, and asset addresses. Sync does not delete an asset just because a single query returned no record; an asset is removed only after a separate query confirms that it truly does not exist. Therefore, running sync repeatedly is safe.
Error Responses
| HTTP | msg | Description |
|---|---|---|
401 | Invalid token | The API key is missing, wrong, or expired |
502 / 503 | 素材服务暂不可用 | The asset service is abnormal; keep the request information and retry |
Was this page helpful?
