Publish an Entry

Publish an Entry

Mints a new immutable version from the entry’s current draft and makes it the live published version.

Endpoint

[POST]

/{collection_slug}/{entry_uuid}/publish

Permissions

Project token with the update ability.

Path Parameters

NameRequiredDescription
collection_slugYesCollection slug
entry_uuidYesEntry UUID

Example

import { createClient } from '@elmapicms/js-sdk'
 
const client = createClient({
  baseUrl: 'https://your-domain.com/api',
  projectId: 'YOUR_PROJECT_UUID',
  apiKey: 'YOUR_PROJECT_TOKEN',
})
 
await client.content.publish('blog-posts', 'a1b2c3d4-e5f6-7890-1234-567890abcdef')
curl -X POST "https://your-domain.com/api/blog-posts/a1b2c3d4-e5f6-7890-1234-567890abcdef/publish" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_PROJECT_TOKEN" \
  -H "project-id: YOUR_PROJECT_UUID"

After publish, GET …?state=published serves the new snapshot and is_draft_dirty is cleared.

See also: Unpublish, Versions, Creating & Editing Content.

Search documentation

Find guides and reference pages