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

# Update Asset Status

> Update component asset status

## Path Parameters

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

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

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

<ParamField path="assetId" type="string" required>
  Asset ID
</ParamField>

## Request Body

<ParamField body="status" type="string" required>
  New status: `active` or `deleted`
</ParamField>

### Example Request

```json theme={null}
{
  "status": "deleted"
}
```

## Response

Returns the Component Asset object with updated status.

```json theme={null}
{
  "data": {
    "id": "asset123",
    "componentId": "c123",
    "name": "logo-2x.png",
    "type": "image/png",
    "url": "https://cdn.metabind.ai/.../logo-2x.png",
    "size": 24576,
    "status": "deleted",
    "metadata": {},
    "tags": ["logo"],
    "createdAt": "2024-03-20T10:00:00Z",
    "updatedAt": "2024-03-22T10:00:00Z"
  }
}
```

## Status Values

| Status | Description |
| - | - |
| `uploading` | File is being uploaded |
| `processing` | File is being processed (optimization, metadata extraction) |
| `active` | Asset is available for use |
| `deleted` | Asset is soft-deleted |
| `error` | Processing failed |

<Note>
  You can only transition between `active` and `deleted` statuses. Other statuses are managed by the system.
</Note>

## Error Responses

### Asset In Use

```json theme={null}
{
  "error": {
    "code": "ASSET_IN_USE",
    "message": "Asset is referenced in published packages and cannot be deleted",
    "details": {
      "packages": ["1.0.0", "1.1.0"]
    }
  }
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/assets/asset123/status" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{"status": "deleted"}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/assets/asset123/status',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ status: 'deleted' })
    }
  );

  const { data: asset } = await response.json();
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.