HTTP API Reference

Doc API reference

Retrieve one or more documents by ID and bypass the caching layer.

Use the Doc API with caution as it bypasses caching and can lead to unexpected usage. Prefer the Query API for traditional fetching.

Base API server URL

Parameterized base URL

https://{projectId}.api.sanity.io/{apiVersion}

Variables

  • projectIdstringdefault: "your-project-id"

    Sanity project ID

  • apiVersionstringdefault: "v2025-02-19"

    API version

Endpoints

Get one or more documents

get/data/doc/{dataset}/{documentId}

This endpoint cuts through any caching/indexing middleware that may involve delayed processing. It is designed for use cases where you want to be very sure to get the absolute latest possible version of a document as it is known to the backend. It can only fetch documents by id and it is less scalable/performant than the other query-mechanisms, so should be used sparingly.

Path parameters

Query parameters

Responses

200

Returns a list of matching documents. Document shape matches a Sanity document and includes all non-null fields.