
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeAbsolutely! You can get draft content through the HTTP API using the perspective parameter. Sanity has built-in support for this via their Perspectives feature.
Here's how it works:
previewDrafts perspectiveThe easiest way to get the latest draft is to use the previewDrafts perspective, which prioritizes draft documents over published versions:
/v2025-02-19/data/query/YOUR_DATASET?query=*[]&perspective=previewDrafts
This will return draft versions when they exist, and fall back to published content when no draft is available.
You have several options depending on your needs:
previewDrafts - Returns drafts when available, falls back to published (perfect for preview environments)published - Returns only published content (default as of API version 2025-02-19)raw - Returns all documents including both drafts and published versionsdrafts - Returns content as if all drafts were published (useful for preview)useCdn: false in your client configuration or avoid the CDN in your HTTP requests, since draft content should never be cacheddrafts. (e.g., drafts.post-123 vs post-123)If you're using @sanity/client, you can configure it like this:
import {createClient} from '@sanity/client'
const client = createClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
useCdn: false, // Required for drafts
perspective: 'previewDrafts',
token: 'your-token' // Required for authentication
})This is similar to how other headless CMSs handle drafts (like Contentful's preview API, Strapi's publicationState=preview, or Storyblok's version=draft), but Sanity's perspective system is more flexible and works consistently across all queries.
Check out the full Perspectives documentation and the guide on presenting and previewing content for more details!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store