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

# Unpublish Content

> Unpublish content without creating a new version

Changes published content's status to unpublished without creating a new version. This removes the content from end user access while preserving the version history.

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

## Response

Returns the unpublished Content object.

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

<Note>
  Unpublishing does not increment the version number. The `lastPublishedVersion` remains unchanged.
</Note>

## Error Responses

### Not Published

```json theme={null}
{
  "error": {
    "code": "INVALID_STATUS_TRANSITION",
    "message": "Only published content can be unpublished"
  }
}
```

## Code Examples

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

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

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


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