Changes a published component’s status to unpublished without creating a new version. This makes the component unavailable for new packages while preserving the version history.
Path Parameters
Response
Returns the unpublished Component object.
{
"id": "comp123",
"name": "ProductCard",
"type": "view",
"status": "unpublished",
"version": 3,
"lastPublishedVersion": 3,
"content": "const body = (props) => { return VStack([...]); }",
"schema": { ... },
"metadata": { ... },
"createdAt": "2024-03-20T10:00:00Z",
"updatedAt": "2024-03-22T10:00:00Z"
}
Unpublishing does not increment the version number. The lastPublishedVersion remains unchanged, allowing you to re-publish at the same version or make modifications first.
Existing packages that include this component will continue to work. Unpublishing only prevents the component from being included in new packages.
Error Responses
Not Published
{
"error": {
"code": "INVALID_STATUS",
"message": "Cannot unpublish: component is not currently published"
}
}
Code Examples
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/components/comp123/unpublish" \
-H "Authorization: Bearer YOUR_API_KEY"