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

> Change an asset status to active or deleted

Update the status of an asset. This is useful for soft-deleting assets while preserving their history.

<Info>
  Soft-deleted assets (status: `deleted`) remain in the system and can be restored. Hard deletion is done via the [Delete Asset](/rest/assets/delete) endpoint.
</Info>

## Path Parameters

<ParamField path="organizationId" type="string" required>
  The unique identifier of the organization
</ParamField>

<ParamField path="projectId" type="string" required>
  The unique identifier of the project
</ParamField>

<ParamField path="id" type="string" required>
  The unique identifier of the asset
</ParamField>

## Request Body

<ParamField body="status" type="string" required>
  New status for the asset. Must be one of: `active`, `deleted`
</ParamField>

## Response

Returns the updated Asset object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/assets/asset789/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/assets/asset789/status',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        status: 'deleted'
      })
    }
  );
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "id": "asset789",
      "name": "hero-image.jpg",
      "type": "image/jpeg",
      "status": "deleted",
      "url": "https://cdn.metabind.ai/org123/proj456/assets/asset789/hero-image.jpg",
      "size": 2048576,
      "metadata": {
        "width": 1920,
        "height": 1080
      },
      "tags": ["hero"],
      "createdAt": "2024-03-20T10:00:00Z",
      "updatedAt": "2024-03-21T16:00:00Z"
    }
  }
  ```

  ```json 409 theme={null}
  {
    "error": {
      "code": "CONFLICT",
      "message": "Cannot delete asset: referenced in packages"
    }
  }
  ```
</ResponseExample>
