Skip to main content
AI Visibility4 min read

Connect Sanity to Cituna and publish to your Studio

Publish AI-written articles to Sanity as drafts or live documents: the Editor token, how Cituna learns your fields, and how Studio edits are kept.

If your blog lives in a Sanity Studio, Cituna can write straight into it. It finds the questions buyers ask that AI engines answer without you, writes the articles from your own search data, and creates each one as a document of your posts’ type, so your site renders it with the template it already has. Studios differ, so Cituna reads a few of your existing posts to learn which field holds the title, the slug, the body, the main image and the SEO fields, and you can correct anything it got wrong. Articles can arrive as drafts for review in the Studio. If your posts live somewhere other than Sanity, the webhook destination hands you the article to place yourself.

What this assumes

Your site reads its posts from a Sanity dataset. Cituna creates and updates documents of one type, the one your blog lists, and never touches pages, products or anything else in the dataset.

1. Find your project ID and dataset

At sanity.io/manage, open the project and copy its project ID, a short code of letters and digits. It is also the projectId in your Studio’s sanity.config file.

Open Datasets in the project’s sidebar and note the one your Studio uses, often production. Cituna uses production when you leave the field blank.

Cituna tracked prompts: each buyer question with one mark per AI engine, ticked where that engine named the brand, and how many engines named it
In Cituna: every tracked prompt, with a mark for each engine that named you. Example workspace.Try it on your site

2. Create a token with Editor permissions

In the project, go to Settings, then API, then Tokens. Click Add new token, name it Cituna and give it Editor permissions. Sanity shows it once, so copy it before you close the dialog.

Editor lets Cituna create drafts and publish them. A Viewer token can read but not write, and an Administrator token could change your project’s members and settings, which a publishing integration has no need for.

A token without write access is refused at connect with a message saying so, rather than failing later on the first article.

3. Connect the project in Cituna

Choose the brand in the top bar, open Integrations and click Connect on the Sanity card. Enter the Project ID, the Dataset, the API token and, under Public article URL prefix, the address your posts appear under, such as https://example.com/blog. That address must be on the brand’s own site: it is where links between articles point. Tick Article URLs on this site end with a slash if yours do.

Click Connect Sanity. Cituna finds the document type that holds your posts, reads its field names from the newest of them and runs a dry-run write that saves nothing. If several types could be your blog, pick or type yours under Document type for posts and click Connect Sanity again.

Cituna sources: the sites AI engines cite for the tracked prompts, with citations per site, the change this period and the engines citing each one
In Cituna: the sites AI engines cite for your prompts, with each one’s citations and their change this period. Example workspace.Try it on your site

4. Check the field mapping

The card says which fields each article writes. If a name is wrong, click Edit fields, type the names from your schema (a nested field takes a dot, such as seo.metaTitle) and click Save. A field left empty is never written.

The body goes in as Portable Text, with headings, lists and links intact. If your schema keeps the body as Markdown or HTML in a string field, choose that under Body format and Cituna sends it that way.

With no posts to learn from yet, the mapping starts from the fields of Sanity’s own blog template. Check it before the first article.

5. Choose drafts or publishing, then turn on the daily article

Open Articles. Under Where should the articles go?, choose Sanity. Under Who approves them?, choose I review each one first, then Review in Sanity to receive each article as a draft you publish in the Studio, or Review in Cituna to send nothing until you approve it. Publish automatically publishes each document as soon as it is written. The daily articles guide compares the three.

Then, under Start writing, turn on Write articles every day. Connecting a destination does not start anything by itself.

Troubleshooting

The article is in the Studio but not on my site.

It is still a draft, which is what Review in Sanity does, or your site lists a different document type. Publish it in the Studio, or open Edit fields and set the type your blog actually queries.

Will Cituna overwrite an edit made in the Studio?

Not silently. Before an update, Cituna compares the fields it writes with what it last sent. If someone changed them in the Studio, or unpublished or deleted the document, automatic updates leave it alone, and Update on Sanity asks first. Fields it does not write, such as author and categories, are never touched.

Does sending the same article twice create a duplicate?

No. Each article has a fixed document ID built from its slug, cituna- and the slug, so a retry or a re-send updates the same document rather than adding a second one.

My post type has no image field.

Then Cituna does not make a hero image for it at all, rather than generating one with nowhere to go. Add an image field to the schema and pick it under Edit fields if you want one.

Drafted with AI assistance from our own research and Search Console data, and reviewed by Rahul A before publishing. Rules and prices change; check the linked official source before you act.

Rahul Arora

Written by

Founder, Cituna

Rahul founded Cituna and leads the product. He runs Cituna on his own sites first, in the same workspace customers use.

Find your next AI visibility fix with Cituna

Cituna asks ChatGPT, Perplexity, Gemini, Claude, Grok, Google AI Overviews and Google AI Mode your buyers' questions every day, writes the fix for every answer you are missing from, and publishes new articles to your site. Run all of it from Claude or any AI agent.

  • Your buyer questions asked on 7 AI engines every day
  • Which answers name you, and which name a competitor
  • The pages each engine cites instead of you
  • A written fix for every answer you are missing from

3-day free trial · Card required, cancel anytime · Plans from $49 a month

Join 1,783 growing businesses

The Cituna overview: visibility score, its trend and the result on each AI engine