cURL
curl --request POST \ --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/publish
Publish a component, creating a new version
{ "id": "comp123", "name": "ProductCard", "type": "view", "status": "published", "version": 4, "lastPublishedVersion": 4, "content": "const body = (props) => { return VStack([...]); }", "schema": { ... }, "metadata": { "author": "[email protected]", "publishedAt": "2024-03-22T10:00:00Z", "publishedBy": "user123" }, "createdAt": "2024-03-20T10:00:00Z", "updatedAt": "2024-03-22T10:00:00Z" }
draft
published
modified
unpublished
deleted
{ "error": { "code": "INVALID_STATUS", "message": "Cannot publish component with status: deleted" } }
{ "error": { "code": "VALIDATION_FAILED", "message": "Component code contains syntax errors", "details": { "errors": [ { "line": 5, "message": "Unexpected token" } ] } } }
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/components/comp123/publish" \ -H "Authorization: Bearer YOUR_API_KEY"