Skip to content

Manage assets ​

Edit an asset's name, description or group, or disable an asset you no longer need. These operations use the MoonApiX asset_id. See Query assets for details and preparation status for a target model.

Edit an asset or move it to another group ​

http
PATCH /v1/assets/{asset_id}

Only an asset owned by the authenticated account and not disabled can be edited. Send at least one of name, description or group_id; omitted fields keep their current values.

bash
curl -X PATCH https://moonapix.com/v1/assets/asset_xxx \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "product-reference",
    "description": "Updated reference",
    "group_id": "group_target"
  }'
FieldTypeDescription
namestringOptional. Must not be empty after trimming whitespace.
descriptionstringOptional. An empty string clears the description.
group_idstringOptional. Move to this group, which must belong to the authenticated account, be enabled and have the same domain as the asset.

Success returns HTTP 200 with the updated asset object. V2 assets retain their identity and storage representation; historical assets keep their existing response representation. Editing does not start model preparation. Moving preserves the asset_id, file content and existing authentication references without uploading or authenticating again. This operation cannot replace the asset's file content.

HTTP statusError codeDescription
400invalid_asset_id, invalid_name, invalid_group_id, missing_update_fieldsInvalid ID, name or update fields.
404asset_not_foundThe asset does not exist, belongs to another account or is disabled.
404group_not_foundThe target group does not exist, belongs to another account or is not enabled.
409group_domain_mismatchThe target group and asset have different domains.

Delete an asset ​

http
DELETE /v1/assets/{asset_id}
bash
curl -X DELETE https://moonapix.com/v1/assets/asset_xxx \
  -H "Authorization: Bearer <MOONAPIX_API_KEY>"

Deletion is a soft delete: it changes the asset owned by the authenticated account to status=disabled. No request body is required. Success returns HTTP 200 with the asset object and deleted=true. Key response fields are:

json
{
  "object": "asset",
  "asset_id": "asset_xxx",
  "status": "disabled",
  "deleted": true
}

Other fields follow the asset's existing representation. This example is not a target-model preparation query. Confirm deletion using HTTP 200, deleted=true and status=disabled. A missing asset, an asset owned by another account or an already disabled asset returns HTTP 404 / asset_not_found; a repeated deletion does not return another success object.

Soft deletion retains history and audit records. It does not physically remove managed files or revoke existing authentication references in other services. It is not a storage cleanup operation, an immediate invalidation of issued URLs or cancellation of submitted generation tasks. Deleting a group is a separate operation and does not delete its member assets; see Delete an asset group.