Publishing integration
Publish to Sanity
Creates a document via the Content Lake mutate API. Body content is sent as a single plain-text Portable Text block -- richer formatting needs your schema's mapping tightened once known.
How it works
Publishes through Sanity's Content Lake mutate API using an API token. Sanity content is normally structured Portable Text rather than plain markdown, so content lands as a single plain-text block unless your schema is mapped more precisely.
Before you start
- A Sanity project with a document schema suitable for blog posts
- An API token with write access (manage.sanity.io, then API, then Tokens)
- Your Project ID and target dataset name
Setup
Three steps to connect
Step 1
Get your api token
manage.sanity.io -> your project -> API -> Tokens -> Add API token, with Editor or Write permissions.
Step 2
Enter your site details
- Project ID *manage.sanity.io -> your project -> Project ID is on the overview page.
- Dataset *manage.sanity.io -> your project -> Datasets tab.
- Document typeThe _type value your schema uses for blog posts -- check schemaTypes/ in the client's Sanity Studio project.
- API version
Step 3
Connect and publish
Once connected, approved posts publish straight to Sanity automatically. No export, no import, no copy-pasting into a CMS. Setup runs from your own client portal, so credentials for Sanity stay with you; the agency never has to hold or request them separately.
Troubleshooting
If something doesn’t connect
Connection test fails with a permission error
Sanity tokens are scoped per-project with a role (Viewer, Editor, Administrator). A Viewer-role token will authenticate but can't create documents.
Body content looks unformatted in Sanity's Studio
This is expected without a tightened schema mapping. Since Portable Text is structured JSON specific to your schema, the safe default sends plain text; ask to have the mapping refined once your schema is known.
Frequently asked questions
It ships with a safe plain-text fallback. If your schema expects real Portable Text formatting like bold, links, or embeds, that mapping can be tightened once we know your schema.
You tell it which dataset to target (production, staging, or otherwise) during setup.
They're created live by default; if your Studio workflow expects a draft first, that can be set during the field mapping step.
Credentials are encrypted at rest and only ever used server-side to publish. Nobody, including us, can view them again once saved.
Nothing changes on Sanity itself. Everything already published stays exactly as it is. New posts just stop syncing until it's reconnected.
Still have questions? Talk to our team.
Ready to connect Sanity?
Book a call and we'll get your site's publishing integration set up together.