Noma

Unpublish an Entry

Unpublish an Entry

Take an entry offline from the public API without deleting it. Unpublishing clears the published_version_id pointer so state=published reads return 404, but all historical versions are retained and remain accessible via the versions endpoints for audit and recovery.

Request

POST /api/{collection}/{uuid}/unpublish HTTP/1.1
Host: app.nomacms.com
project-id: <project-uuid>
Authorization: Bearer <api-token>
Accept: application/json

Requires the update ability on the token.

Path parameters

ParamDescription
collectionCollection slug
uuidEntry UUID

No body is required.

What this does

  • Sets content_entries.state = 'draft'.
  • Clears published_version_id and published_version_number on the entry.
  • Does not delete any rows in content_entry_versions — history is preserved.
  • Public API state=published reads will now return 404 for this entry.
  • The working draft is untouched; state=draft reads continue to work.

Response (200)

{ "message": "Content unpublished." }

Errors

StatusWhen
400Missing project-id or project cannot be resolved
401Missing or invalid bearer token
403Token does not have update (or *)
404Collection or entry not found

Example

import { createClient } from "@nomacms/js-sdk"
 
const client = createClient({
  projectId: process.env.NOMA_PROJECT_ID!,
  apiKey: process.env.NOMA_API_KEY!,
})
 
await client.content.unpublish("blog-posts", entryUuid)
 
// Versions are retained:
const versions = await client.content.versions.list("blog-posts", entryUuid)
curl -sS -X POST "https://app.nomacms.com/api/blog-posts/${ENTRY_UUID}/unpublish" \
  -H "project-id: $NOMA_PROJECT_ID" \
  -H "Authorization: Bearer $NOMA_API_KEY" \
  -H "Accept: application/json"

Search documentation

Find guides and reference pages