Sanity CMS Integration

Seamless Content Publishing: Sanity CMS & AI Integration

Connect your Sanity CMS project with our AI-driven platform to automate content publishing and maximize efficiency

100%

Integration Coverage

3-Step

Simple Setup

Auto

Image Handling

24/7

Support Available

How it Works

Understanding the Sanity CMS integration process

1

Connect Your Account

Enter your Sanity project credentials to establish a secure connection with our platform

2

Map Document Types

Configure which Sanity document types correspond to content created in our platform

3

Create Content

Generate or create content within our platform with AI assistance or manual editing

4

Publish to Sanity

Send your content to Sanity with a single click or through automated publishing workflows

Sanity Schema Integration

Our platform automatically syncs with your Sanity schema, ensuring that all published content follows your defined structure. We support Portable Text format for rich content, references for related documents, and proper image asset handling.

Learn more about setup

What is Sanity CMS?

Sanity is a flexible, headless Content Management System (CMS) that separates your content from how it's presented. Our platform integrates directly with Sanity, allowing you to:

Automated Publishing

Publish AI-generated content directly to your Sanity CMS with just a few clicks

Structured Content

Content is published with proper schema mapping for your Sanity document types

Image Handling

Automatic image uploading and reference creation in your Sanity project

Setup Guide

Follow these steps to connect your Sanity CMS project

1

Create a Sanity Project

If you don't already have a Sanity project, you'll need to create one:

  1. Visit Sanity.io and sign up for an account
  2. Create a new project from the Sanity dashboard
  3. Follow the setup wizard to initialize your project
  4. Choose a schema that matches your content needs or create a custom one

Sanity offers a free tier that works perfectly with our integration. For more information, see the Sanity documentation .

2

Get Your Sanity API Credentials

To connect our platform with your Sanity project, you'll need the following credentials:

  • Project ID

    Your unique Sanity project identifier

    Find this in your Sanity dashboard or in the sanity.json file of your project.

  • Dataset

    The dataset you want to publish to (usually "production")

    Default is "production" but you may have created custom datasets.

  • API Token

    A token with write permissions

    Create a new token in your Sanity dashboard under API > Tokens. Ensure it has at least "Editor" level permissions.

Security Note

Keep your API token private! It provides write access to your content.

3

Connect Your Sanity Project

Once you have your Sanity credentials, connect them to our platform:

  1. Navigate to Settings > Integrations in our platform
  2. Find the Sanity CMS section and enter your credentials:
    • Project ID
    • Dataset (or leave as "production")
    • API Token
  3. Click Test Connection to verify your credentials
  4. Once verified, toggle Enable Sanity Publishing to ON
  5. Click Save Settings

Tip

After connecting, the system will automatically detect document types from your Sanity schema, making them available for selection when publishing content.

4

Configure Document Types

Select which Sanity document types you want to use for publishing:

  1. In the Sanity integration settings, locate the "Default Document Type" dropdown
  2. Select the document type you primarily want to publish to (e.g., "post", "article")
  3. For resources, you can additionally select specific resource types

Standard document types include:

post

Standard blog posts with title, content, and image fields

article

Longer-form content with more structured sections

page

Website pages with flexible content blocks

resource

Resource content with additional type options

If you're using custom document types in your Sanity schema, these will also be loaded and available for selection.

Publishing Examples

Learn how to publish content to your Sanity CMS

After generating content, you can publish it to Sanity with just a few clicks:

From the Article Editor

  1. Open an article you've created or generated
  2. Click the "Publish" dropdown button
  3. Select "Publish to Sanity"
  4. Choose your document type
  5. Click "Publish Now"

From the Articles List

  1. Navigate to the Articles section
  2. Find the article you want to publish
  3. Click the "Actions" dropdown
  4. Select "Publish to Sanity"
  5. Confirm in the dialog that appears

Integration Examples

Example JSON structures for Sanity documents

Here's how a typical blog post would be structured when published to Sanity:

{
  "_type": "post",
  "title": "10 SEO Strategies for E-commerce Websites",
  "slug": {
    "_type": "slug",
    "current": "10-seo-strategies-for-e-commerce-websites"
  },
  "publishedAt": "2023-05-15T10:30:00Z",
  "mainImage": {
    "_type": "image",
    "asset": {
      "_ref": "image-a1b2c3d4e5f6g7h8i9j0-1200x800-jpg"
    },
    "alt": "E-commerce SEO strategies illustration"
  },
  "body": [
    {
      "_type": "block",
      "style": "normal",
      "children": [
        {
          "_type": "span",
          "text": "Implementing effective SEO strategies is crucial for e-commerce success..."
        }
      ]
    },
    // Additional content blocks...
  ],
  "categories": [
    { "_ref": "category-seo" },
    { "_ref": "category-ecommerce" }
  ]
}

Troubleshooting

Common issues and their solutions

Connection Issues

If you can't connect to your Sanity project:

  • Double-check your Project ID and API Token for typos
  • Ensure your API Token has write permissions
  • Verify your dataset name (case-sensitive)
  • Check if your Sanity project has CORS settings that might be blocking our requests

Missing Document Types

If your document types aren't appearing:

  • Re-test your connection to refresh the schema data
  • Verify your document types are properly defined in your Sanity schema
  • Check that your API token has permissions to read schema information

Publishing Errors

If content fails to publish:

  • Check error messages in the response for specific issues
  • Verify that your content matches the required fields in your Sanity schema
  • For duplicate slug errors, try publishing with a different title or manually set a unique slug
  • For image upload issues, check that your images are accessible and in supported formats

Need More Help?

Our support team is available 24/7 to assist you with any questions or issues regarding your Sanity CMS integration.

Contact Support

Ready to Connect Your Sanity CMS?

Start publishing your AI-generated content to Sanity in minutes with our seamless integration