
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis error typically means there's a mismatch between the project ID configured in your client and the project where your authentication token was created. The "session" refers to your authenticated request, and "project host" refers to the Sanity project you're trying to access.
Here are the most common causes and solutions:
The most likely issue is that your client configuration is pointing to a different project than the one where you created the token. Verify that:
sanity.config.ts or wherever you initialize your Sanity client:const client = createClient({
projectId: 'your-project-id', // Must match the token's project
dataset: 'your-dataset',
token: process.env.SANITY_API_TOKEN,
useCdn: false
}).env file has the token from one project but the project ID from anotherIf you're working with multiple Sanity projects, it's helpful to store both the project ID and token together in your environment variables to keep them paired correctly:
SANITY_PROJECT_ID=abc123 SANITY_DATASET=production SANITY_API_TOKEN=sk...
This way, you can be sure they're always in sync! Since it worked once and then failed, double-check if you recently switched projects or updated any configuration files.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store