> ## 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.

# Delete Component

> Delete a component

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

<ParamField path="id" type="string" required>
  Component ID
</ParamField>

<Warning>
  Components referenced by packages cannot be deleted. Use the [Update Status](/rest/components/status) endpoint to set status to `deleted` instead, which prevents future use while maintaining package references.
</Warning>

## Response

```json theme={null}
{
  "message": "Component successfully deleted",
  "id": "c123"
}
```

## Error Responses

### Component In Use by Draft Content Types

```json theme={null}
{
  "error": {
    "code": "COMPONENT_IN_USE_BY_DRAFT",
    "message": "Component cannot be deleted as it is used by 2 draft content type(s)",
    "details": {
      "contentTypes": [
        { "id": "ct123", "name": "Article" },
        { "id": "ct456", "name": "Product Page" }
      ]
    }
  }
}
```

### Not Found

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Component not found"
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const result = await response.json();
  ```
</CodeGroup>
