Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
components
/
{id}
/
status
Update Component Status
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/status \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "<string>"
}
'

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID
id
string
required
Component ID

Request Body

status
string
required
New status: draft, modified, published, or deleted
{
  "status": "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

FromToAllowed
draftdeletedYes
modifieddeletedYes
publisheddeletedYes
deleteddraftYes (restore)
deletedmodifiedYes (restore, if previously published)
AnypublishedNo (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:
{
  "status": "deleted"
}

Restore a Deleted Component

Set status back to draft or modified to restore a deleted component:
{
  "status": "draft"
}

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"}'