> For the complete documentation index, see [llms.txt](https://docs.frase.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frase.io/integrations/cms-publishing/sanity.md).

# Sanity

Send finished articles from Frase into your Sanity project as a draft or a published document.

## Connect Sanity

{% stepper %}
{% step %}

### Open your project's API tab in Sanity

Log into [Sanity](https://www.sanity.io/studio), open your *Organization Settings*, pick the project you want to connect, and go to the *API* tab. Each Sanity project is usually one site.
{% endstep %}

{% step %}

### Create an API token and copy your project ID

1. Under *Tokens*, click **Add API token**.
2. Name it (for example, *Frase Integration*) and set permissions to *Read + Write*.
3. Save and copy the token value.
4. Copy your *Project ID* from the top of the project page.

<figure><img src="https://2722506614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPjiB67jRcrUcXcskiWhp%2Fuploads%2FduUdbcxZmSLbAwlsFde6%2Fimage.png?alt=media&amp;token=1f5b4b03-2008-49cf-8469-0c8170c077cc" alt="Sanity API tab with tokens and project ID"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Connect Sanity in Frase

Go to **Settings → Integrations**, select **Sanity** under *CMS Publishing*, paste your API token and project ID, choose the document type to publish to (usually *Post*), and save.
{% endstep %}

{% step %}

### Add a public URL template *(optional)*

This tells Frase where each post lives on your site, like `https://yoursite.com/blog/{slug}`. Frase swaps `{slug}` for each post's slug.

Without it, you can still publish, but Frase can't track the post's search performance, protect it with [Content Guard](https://docs.frase.io/core-workflows/publish-and-protect-with-content-guard), or republish updates to it.
{% endstep %}
{% endstepper %}

## Publish to Sanity

In the article editor, click **Publish**, choose Sanity, and send it as a draft or a published document.&#x20;

<div align="left"><figure><img src="https://2722506614-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPjiB67jRcrUcXcskiWhp%2Fuploads%2FyPuZB1ZF0PLywraskIKS%2FScreenshot%202026-02-06%20at%202.01.00%E2%80%AFPM.png?alt=media&amp;token=c4c77f4a-572d-4c3a-9477-cc69be77fd5a" alt="Publishing to Sanity from Frase"><figcaption></figcaption></figure></div>

{% hint style="warning" %}
Required fields that Frase doesn't fill, like *Publish Date* or fields custom to your setup, need to be completed in Sanity *after* you publish.
{% endhint %}

{% hint style="info" %}
**Need custom fields filled in when you publish?** Connect the [Frase MCP](/integrations/api-and-mcp.md) and [Sanity's MCP server](https://www.sanity.io/docs/ai/mcp-server) to the same AI assistant, like Claude. Then ask it to publish your article with the fields you need.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.frase.io/integrations/cms-publishing/sanity.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
