Sanity
sanityAuthenticate with Sanity using API tokens or OAuth. Access content, projects, and datasets.
🔐 Authentication Methods
token
API Token
Register at: https://www.sanity.io/organization/{org}/api
- Go to your Sanity project dashboard
- Navigate to API > Tokens
- Create a new token with desired permissions
- Copy the token
oauth
OAuth
authorize: https://www.sanity.io/oauth/authorize
token: https://www.sanity.io/oauth/token
Scope: openid profile email
Register at: https://www.sanity.io/manage/personal/access-tokens
- Create tokens via the Sanity CLI or dashboard
- OAuth is primarily for studio authentication
👤 Identity
Project: e.g., project ID
🌐 APIs
rest
Base URL: https://api.sanity.io/v2021-10-01
Auth Header: Authorization: Bearer {token}
Methods: token oauth
graphql
Base URL: https://{projectId}.api.sanity.io/v1/graphql/{dataset}/default
Auth Header: Authorization: Bearer {token}
Methods: token