
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat questions! Let me break down the deployment permissions for GraphQL APIs (and Studio deployment):
Unfortunately, only users with the Administrator role can deploy the GraphQL API using sanity graphql deploy. According to the CLI errors documentation, if you try to run this command with only Write or Read+Write access, you'll get an "Unauthorized" error.
However, there is a workaround using deploy tokens:
You can create a robot token (API token) with Administrator permissions specifically for deployment purposes. Your collaborator can use this token to deploy without being added as a full Administrator:
# Set the token as an environment variable
export SANITY_AUTH_TOKEN=your-deploy-token
# Then run the deploy command
sanity graphql deployTo create a deploy token:
npx sanity manageThis approach is mentioned in the schema deployment docs and follows the same pattern for other deployment commands like sanity schema deploy.
Unfortunately, you cannot restrict GraphQL deployment to specific datasets at the permission level. The Administrator role (or deploy token with Admin permissions) grants access to deploy for all datasets in the project.
Workarounds:
The sanity graphql deploy command does support a --dataset <name> flag to specify which dataset to deploy for, but the permission to run the command itself is all-or-nothing at the project level.
Hope this helps! The deploy token approach is probably your best bet for controlled deployment access without full Administrator privileges.
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 backend


The only platform powering content operations


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