curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"status": "deleted"
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'deleted'
})
}
);
const data = await response.json();
{
"data": {
"id": "asset789",
"name": "hero-image.jpg",
"type": "image/jpeg",
"status": "deleted",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.jpg",
"size": 2048576,
"metadata": {
"width": 1920,
"height": 1080
},
"tags": ["hero"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T16:00:00Z"
}
}
{
"error": {
"code": "CONFLICT",
"message": "Cannot delete asset: referenced in packages"
}
}
Assets
Update Asset Status
Change an asset status to active or deleted
POST
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
assets
/
{id}
/
status
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"status": "deleted"
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'deleted'
})
}
);
const data = await response.json();
{
"data": {
"id": "asset789",
"name": "hero-image.jpg",
"type": "image/jpeg",
"status": "deleted",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.jpg",
"size": 2048576,
"metadata": {
"width": 1920,
"height": 1080
},
"tags": ["hero"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T16:00:00Z"
}
}
{
"error": {
"code": "CONFLICT",
"message": "Cannot delete asset: referenced in packages"
}
}
Update the status of an asset. This is useful for soft-deleting assets while preserving their history.
Soft-deleted assets (status:
deleted) remain in the system and can be restored. Hard deletion is done via the Delete Asset endpoint.Path Parameters
string
required
The unique identifier of the organization
string
required
The unique identifier of the project
string
required
The unique identifier of the asset
Request Body
string
required
New status for the asset. Must be one of:
active, deletedResponse
Returns the updated Asset object.curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status" \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{
"status": "deleted"
}'
const response = await fetch(
'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/status',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
status: 'deleted'
})
}
);
const data = await response.json();
{
"data": {
"id": "asset789",
"name": "hero-image.jpg",
"type": "image/jpeg",
"status": "deleted",
"url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.jpg",
"size": 2048576,
"metadata": {
"width": 1920,
"height": 1080
},
"tags": ["hero"],
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-21T16:00:00Z"
}
}
{
"error": {
"code": "CONFLICT",
"message": "Cannot delete asset: referenced in packages"
}
}