Preview drafts before they go live
Editors want to see how a change looks before the world does. Mojimoto serves drafts through the same delivery API, gated behind a token ability so production can never accidentally leak unpublished work.
Mint a preview token
On the API keys page, create a custom token and tick the preview ability. Keep this token to your staging environment — unlike the public read token, it can see unpublished drafts.
Ask for the draft
Add ?ref=preview to any delivery request. The API returns the latest draft for each entry, falling back to the published version where no newer draft exists. References resolve to their drafts too, so a preview is internally consistent.
curl "https://your-domain.com/api/v1/your-project/documents?ref=preview&uid=hello-world" \ -H "Authorization: Bearer mjmt_your_preview_token"
A read-only token that requests ?ref=preview is refused with a 403 — the preview ability is required. Preview responses are marked no-store so they are never cached.
Wire it to your framework
Most frameworks have a preview or draft mode. Point that mode at your preview token and add ref=preview to the request; point normal production rendering at the public read token without it. Same code, two tokens.
Fire an outbound, HMAC-signed webhook when content is published — to rebuild a static site or sync an integration.
Query published content by type, slug and locale, paginate, sort, and resolve references — all from one REST endpoint.