Skip to main content
Enhance your chatbot with real-time access to your Sanity content. The Sanity integration allows your chatbot to search documents and automatically sync your knowledge base.

Why Connect Sanity?

Content Search

Chatbot can search and retrieve Sanity documents

Knowledge Base Sync

Automatically sync Sanity content to your knowledge base

Structured Content

Works with Sanity’s powerful structured content

Project Token Auth

Secure authentication with project tokens

Prerequisites

  • Sanity project with content
  • Admin access to your Sanity project
  • Project token (API token) generated from your Sanity dashboard
  • Sanity dataset configured

Setup Steps

1

Navigate to Integrations

Go to DashboardIntegrations and find the Sanity card
2

Click Connect

Click Connect Sanity to open the connection form
3

Get Project ID

Find your Sanity Project ID:
  1. Log in to your Sanity dashboard
  2. Navigate to your project
  3. Copy the Project ID from the project URL or settings
  4. Format: https://www.sanity.io/contacts/project/YOUR_PROJECT_ID
4

Generate API Token

Create an API Token in your Sanity dashboard:
  1. Go to ManageAPITokens
  2. Click Add API token
  3. Enter a label (e.g., “BubblaV Integration”)
  4. Select permissions: Editor or Viewer
  5. Click Add
  6. Copy the generated token (shown only once)
5

Enter Dataset

Enter your Sanity dataset name (default is “production”)
6

Enter Credentials

Enter your Project ID, Dataset, and API Token
7

Verify Connection

Click Connect. The Sanity card should now show Connected

Available Tools After Connection

ToolWhat It DoesExample Query
sanity_search_contentSearch Sanity documents”Find articles about pricing”
sanity_sync_knowledge_baseSync content to knowledge baseSyncs your Sanity content automatically

Test Your Integration

Try these queries on your website:
  • “What do you have about [topic]?”
  • “Show me articles about [subject]”
  • “Find documents related to [keyword]“

Troubleshooting

  • Verify your Project ID and API Token are correct
  • Check that the token hasn’t been revoked
  • Ensure the token has at least Viewer permissions
  • Make sure you’re entering the dataset name correctly (case-sensitive)
  • Verify your Project ID is correct
  • Check that your dataset exists and has content
  • Ensure your project is accessible via the API
  • Try using Sanity’s API explorer to test access
  • Wait a few minutes for the initial sync to complete
  • Check that your dataset has published documents (not just drafts)
  • Verify that the API Token still has valid permissions
  • Check that documents have the _id and _type fields
  • Ensure you’re using the correct dataset name
  • Default dataset is usually “production”
  • Check your dataset names in the Sanity dashboard
  • Dataset names are case-sensitive
  • Sanity uses GROQ (Graph-Relational Object Queries)
  • The integration uses standard queries that work with most schemas
  • Custom schemas may require query adjustments
  • Contact support if you have complex schema requirements
Security: We use Sanity API Tokens for authentication. These tokens can be revoked or regenerated at any time from your Sanity dashboard without affecting your application.
Important: Save your API Token securely when you create it. Sanity only shows it once and you’ll need to regenerate it if lost.
Best Practice: Create a dedicated token for the BubblaV integration with Viewer or Editor permissions rather than using Administrator tokens. This follows the principle of least privilege.