Prompt
How do I manage content previews, approvals, and versioning in a headless CMS?
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
Managing content previews, approvals, and versioning in a headless CMS usually comes down to setting up a clean workflow, clear roles, and a publishing model that supports drafts and history.
1) Content previews
You want editors to see content as it will appear before it goes live.
Best practices:
- Use preview/draft endpoints: Expose a draft API or “preview mode” that returns unpublished content.
- Frontend preview route: Build a special preview URL in your frontend that fetches draft content from the CMS.
- Token-based access: Protect preview access with a secure token or signed link.
- Environment separation: Keep preview on a staging or preview environment so it doesn’t affect production.
- Real-time refresh: If possible, let editors instantly see changes without a full publish.
Typical flow:
- Editor saves draft in CMS.
- CMS generates a preview URL.
- Frontend loads draft content for that URL.
- Editor reviews and either revises or submits for approval.
2) Approvals
Approvals help enforce editorial control before publishing.
Common workflow states:
- Draft
- In Review
- Approved
- Scheduled
- Published
- Rejected / Needs Changes
How to implement:
- Role-based permissions:
- Authors create/edit drafts
- Reviewers approve
- Publishers or admins can publish
- Workflow automation:
- On submit, content moves from Draft to Review
- Approver can approve/reject with comments
- Publishing is blocked until approved
- Notifications:
- Email/Slack alerts when content is ready for review or approved
- Audit trail:
- Record who approved what and when
Tip: Keep approval logic outside the frontend if possible; enforce it in the CMS or backend API so it can’t be bypassed.
3) Versioning
Versioning lets you track changes and restore older content if needed.
What to support:
- Revision history: Every save creates a version or snapshot.
- Diffs: Show what changed between versions if your CMS supports it.
- Rollback: Restore a previous approved or published version.
- Version labels: Mark versions like “v1 draft,” “approved draft,” or “published 2026-01-15.”
Good practices:
- Save a version at meaningful checkpoints:
- every manual save, or
- before approval, or
- on publish
- Store metadata:
- author
- timestamp
- status
- version number
- change notes
- Keep immutable published snapshots so you always know exactly what was live.
4) Recommended workflow design
A simple and effective workflow is:
- Author creates draft
- Editor previews in draft mode
- Submit for approval
- Reviewer checks preview
- Approve or request changes
- Publish
- Archive version and keep audit history
5) Technical patterns to use
- Draft/published model: Separate draft content from published content.
- Content states: Use a status field rather than relying only on boolean flags.
- API query params:
?preview=trueor?status=draft - Webhook triggers: Rebuild frontend or invalidate cache on publish.
- Content locking: Optional, but useful if multiple editors might conflict.
- Scheduled publishing: Let approved content go live at a future time.
6) Things to avoid
- Letting preview access use public unauthenticated endpoints
- Allowing frontend clients to publish directly
- Overwriting published content without keeping history
- Using only one “published” flag with no workflow states
- Not separating editorial permissions from content delivery
7) Example setup
A practical setup might look like this:
- CMS stores content as
draft,in_review,approved,published - Each save creates a revision
- Preview URLs use a secure token to fetch draft content
- Only reviewers can move content to
approved - Only publishers can trigger publish
- Published content is snapshotted and cached
- Webhooks notify the frontend to refresh after publish
If you want, I can also show:
- a sample workflow diagram
- a database schema for drafts/approvals/versioning
- or how to implement this in a specific CMS like Contentful, Strapi, Sanity, or Directus.