Home / Formulas / Sanity

Sanity

sanity

Authenticate with Sanity using API tokens or OAuth. Access content, projects, and datasets.

🔐 Authentication Methods

token
API Token
  • 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
  • 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
← Back to all formulas