Skip to main content
LocoPal AiLocoPal Ai
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

View Markdown

Sync Asset Status

Sync Asset Status

POST/api/v1/materials/sync

Authentication

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

ParameterTypeDescription
codeinteger0 on success
msgstring素材状态已同步 on success
data.groupsintegerNumber of groups refreshed in this run
data.adopted_groupsintegerNumber of groups confirmed as belonging to the current account in this run
data.assetsintegerNumber of assets refreshed in this run
data.removed_assetsintegerNumber 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

HTTPmsgDescription
401Invalid tokenThe API key is missing, wrong, or expired
502 / 503素材服务暂不可用The asset service is abnormal; keep the request information and retry
Was this page helpful?

On this page