Sanity · GraphQL Specification

Sanity GraphQL API

Sanity provides a project-scoped GraphQL API that exposes Content Lake documents as a typed, queryable schema. The API is deployed per-project and per-dataset: you generate and deploy the schema from your Sanity Studio using the CLI (`sanity graphql deploy`), which introspects your studio's schema definitions and produces a GraphQL schema with PascalCase type names (e.g., a `bookAuthor` type becomes `BookAuthor`). For each document type in your schema, two root query fields are generated — `all` for list queries with filtering, sorting, and pagination, and `` for fetching a single document by its `_id`.

Documentation Endpoint View on GitHub Headless CMSContent ManagementGROQReal-TimeStructured ContentDeveloper PlatformGraphQL

Overview

Sanity GraphQL API is a GraphQL API specification published by Sanity on the APIs.io network.

Sanity provides a project-scoped GraphQL API that exposes Content Lake documents as a typed, queryable schema. The API is deployed per-project and per-dataset: you generate and deploy the schema from your Sanity Studio using the CLI (sanity graphql deploy), which introspects your studio’s schema definitions and produces a GraphQL schema with PascalCase type names (e.g., a bookAuthor type becomes BookAuthor). For each document type in your schema, two root query fields are generated — all<TypeName> for list queries with filtering, sorting, and pagination, and <TypeName> for fetching a single document by its _id.

The GraphQL endpoint is available at https://{projectId}.api.sanity.io/v2025-02-19/graphql/{dataset}/default. documentation is published at https://www.sanity.io/docs/graphql.

The specification includes 2 reference links.

Tagged areas include Headless CMS, Content Management, GROQ, Real-Time, and Structured Content.

Endpoint

`https://{projectId}.api.sanity.io/v2025-02-19/graphql/{dataset}/default`

References

Related API Specs

Sanity Assets API (OpenAPI) Sanity Projects API (OpenAPI) Sanity Webhooks API (AsyncAPI) Sanity Listen API (OpenAPI) Sanity Assets API (OpenAPI) Sanity Listen API (OpenAPI) Sanity Mutations API (OpenAPI) Sanity Projects API (OpenAPI) Sanity Query API (OpenAPI) Sanity Webhooks API (OpenAPI)
Back to Sanity · All GraphQL Specs · GitHub

Work with this as data

Every GraphQL schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for graphql

4 MCP tools reach this
  • find_graphqlBrowse and filter every GraphQL schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This GraphQL schema
curl "https://apis.io/api/v1/graphql/sanity-graphql"
All graphql
curl "https://apis.io/api/v1/graphql?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.