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

> Update the status of a content item

Directly update a content item's status. For most workflows, use the dedicated `publish`, `unpublish`, or `discard` endpoints instead.

## 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>
  Content ID
</ParamField>

## Request Body

<ParamField body="status" type="string" required>
  The new status: `draft`, `modified`, `unpublished`, or `deleted`
</ParamField>

### Example Request

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

<Warning>
  This endpoint does not validate status transitions as strictly as the dedicated endpoints. Use `publish` to publish, `unpublish` to unpublish, and `discard` to discard changes.
</Warning>

## Response

Returns the updated Content object wrapped in a `data` field.

```json theme={null}
{
  "data": {
    "id": "cont123",
    "typeId": "ct123",
    "typeVersion": 2,
    "version": 2,
    "lastPublishedVersion": 2,
    "packageVersion": "1.0.0",
    "name": "Getting Started Guide",
    "status": "deleted",
    "isTemplate": false,
    "content": { ... },
    "compiled": "const body = () => { ... }",
    "tags": ["Tutorial"],
    "metadata": { ... },
    "createdAt": "2024-03-20T10:00:00Z",
    "updatedAt": "2024-03-22T10:00:00Z"
  }
}
```

## Status Values

| Status        | Description                            |
| ------------- | -------------------------------------- |
| `draft`       | Initial state, never published         |
| `modified`    | Published then edited                  |
| `published`   | Live and active (use publish endpoint) |
| `unpublished` | Was published, now inactive            |
| `deleted`     | Soft deleted                           |

## Error Responses

### Invalid Status Value

```json theme={null}
{
  "error": {
    "code": "VALIDATION_FAILED",
    "message": "Invalid status value",
    "details": {
      "provided": "archived",
      "allowed": ["draft", "modified", "unpublished", "deleted"]
    }
  }
}
```

## Code Examples

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

  const { data: content } = await response.json();
  console.log(`Content status changed to: ${content.status}`);
  ```
</CodeGroup>
