Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change Site Theme
Sanity logo

Documentation

    • Overview
    • Platform introduction
    • Next.js quickstart
    • Nuxt.js quickstart
    • Astro quickstart
    • React Router quickstart
    • Studio quickstart
    • Build with AI
    • Content Lake
    • Functions
    • APIs and SDKs
    • Agent Actions
    • Visual Editing
    • Blueprints
    • Platform management
    • Dashboard
    • Studio
    • Canvas
    • Media Library
    • App SDK
    • Content Agent
    • HTTP API
    • CLI
    • Libraries
    • Specifications
    • Changelog
    • User guides
    • Developer guides
    • Courses and certifications
    • Join the community
    • Templates

On this page

HTTP API Reference
Overview

  • Content Lake API

    Actions
    Assets
    Copy
    Backups
    Doc
    Export
    History
    Jobs
    Listen
    Live
    Mutation
    Query
    Scheduling
    Webhooks

  • Compute and AI

    Agent Actions
    Embeddings Index

  • Apps

    Media Library

  • Management API

    Access
    Projects
    Roles

On this page

Endpoints
  • Get one or more documents
HTTP API ReferenceLast updated January 9, 2026

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

Previous

Backups

Next

Export

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

  • datasetstringrequired
  • documentIdarrayrequired
    items
    • itemsstring

Query parameters

  • includeAllVersionsbooleandefault: false

Responses

200

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

  • documentsarray
    Show child attributes
    items
    • _idstring
    • _typestring
    • additionalProperties