Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
{id}
/
unpublish
Unpublish Content
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/unpublish
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

organizationId
string
required
Organization ID
projectId
string
required
Project ID
id
string
required
Content ID

Response

Returns the unpublished Content object.
{
  "id": "cont123",
  "typeId": "ct123",
  "typeVersion": 2,
  "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"
}
Unpublishing does not increment the version number. The lastPublishedVersion remains unchanged, allowing you to re-publish at the same version or make modifications first.

Error Responses

Not Published

{
  "error": {
    "code": "INVALID_STATUS",
    "message": "Cannot unpublish: content is not currently published"
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/cont123/unpublish" \
  -H "Authorization: Bearer YOUR_API_KEY"