Noma

Publish an Entry

Publish an Entry

Mint a new immutable version from the entry's current working draft and make it the live snapshot served under state=published.

Publishing is always an explicit action. Saving the entry with PUT / PATCH only mutates the draft — it never changes what public state=published reads return. This gives you the classic draft-and-publish workflow: edit freely, then publish when the copy is ready.

Request

POST /api/{collection}/{uuid}/publish 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

  • Captures the current working draft into a new immutable row in content_entry_versions (with a monotonic version_number).
  • Sets content_entries.state = 'published', published_version_id and published_version_number on the entry.
  • Resets is_draft_dirty to false.
  • Enforces plan-based retention (Basic 10, Grow 50, Pro unlimited), pruning the oldest non-live versions if needed.

Response (200)

{
  "message": "Content published as v3.",
  "version_number": 3,
  "entry": { "uuid": "", "locale": "en", "published_at": "", "fields": { } }
}

The entry object is the same shape you get from GET /api/{collection}/{uuid}?state=published — rendered from the just-minted snapshot.

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.patch("blog-posts", entryUuid, {
  data: { title: "Launch copy v2" },
})
 
const { version_number } = await client.content.publish("blog-posts", entryUuid)
console.log("Published as v" + version_number)
curl -sS -X POST "https://app.nomacms.com/api/blog-posts/${ENTRY_UUID}/publish" \
  -H "project-id: $NOMA_PROJECT_ID" \
  -H "Authorization: Bearer $NOMA_API_KEY" \
  -H "Accept: application/json"

Search documentation

Find guides and reference pages