Path Parameters
Request Body
New status: draft, modified, published, or deleted
Components cannot be manually set to published status. Components are published automatically when included in a package. To publish a component, create a new package.
Status Transitions
| From | To | Allowed |
|---|
draft | deleted | Yes |
modified | deleted | Yes |
published | deleted | Yes |
deleted | draft | Yes (restore) |
deleted | modified | Yes (restore, if previously published) |
| Any | published | No (use package creation) |
Response
Returns the updated Component object.
{
"id": "c123",
"name": "ProductCard",
"status": "deleted",
"version": 3,
"lastPublishedVersion": 3,
"content": "...",
"metadata": {
"deletedAt": "2024-03-22T10:00:00Z",
"deletedBy": "user123"
},
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-22T10:00:00Z"
}
Use Cases
Soft Delete a Component
Set status to deleted to prevent future use while maintaining existing package references:
Restore a Deleted Component
Set status back to draft or modified to restore a deleted component:
Error Responses
Invalid Status Transition
{
"error": {
"code": "INVALID_STATUS_TRANSITION",
"message": "Cannot set status to 'published' directly",
"details": {
"currentStatus": "draft",
"requestedStatus": "published",
"hint": "Components are published automatically when included in a package"
}
}
}
Code Examples
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/components/c123/status" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "deleted"}'