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

Documentation Index

Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt

Use this file to discover all available pages before exploring further.

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": "BAD_REQUEST",
    "message": "Validation failed",
    "details": {
      "status": "Use publish() method to publish component"
    }
  }
}

Cannot Restore Deleted Component

{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Validation failed",
    "details": {
      "status": "Deleted components can only be restored to draft status"
    }
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/status" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{"status": "deleted"}'