
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThis is a common permission issue! When you create an Editor token in Sanity, it might not have the specific permissions needed for asset operations. Here's what's happening and how to fix it:
The error Insufficient permissions; permission "create" required when using client.assets.upload() means your token doesn't have the necessary permissions to create assets in your project, even though it's labeled as an "Editor" token.
You need to ensure your token has a role with asset creation permissions:
Go to Sanity Manage - Access it via your Studio menu or run npx sanity@latest manage in your terminal
Navigate to the API tab and find your token (or create a new one)
Assign a role with asset permissions - The key is to use a role that explicitly includes asset operations. The standard "Editor" role should work, but if you're using custom roles, make sure they include:
sanity.assets.create permissionsanity.assets.upload permissionVerify you're using a Robot Token (not a Personal Token) for production use, as robot tokens can be assigned specific roles independent of individual users
Make sure you're passing the token correctly in your Next.js app:
import {createClient} from '@sanity/client'
const client = createClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
token: process.env.SANITY_API_TOKEN, // Make sure this is set
useCdn: false, // Must be false for write operations
apiVersion: '2024-01-01'
})Important: Never expose write tokens in client-side code! If you're uploading from the browser, implement a serverless function or API route that handles the upload server-side where the token remains secure.
useCdn: false in your client configurationIf you're still having issues after checking the role permissions, try creating a completely new robot token with explicit Editor or Administrator permissions to rule out any token-specific issues. You can verify the token's permissions by checking which role it's assigned in the Sanity Manage interface.
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