How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

How to make documents with custom prefix private like draft documents

3 repliesLast updated: Nov 29, 2025

So any document with a prefix with a
.
(like
draft.
) becomes private. So I have a singleton document that I use that has a document id prefix of
secret.
that I load when needed in the studio
AI Update

You're correct that documents with a dot (.) in their ID become private in Sanity! This is an important architectural feature that's well-documented.

How the dot-prefix privacy works:

Any document ID containing a . (dot) is considered private and has restricted accessibility. According to the IDs and Paths documentation, these documents can only be accessed when:

The root path (IDs without dots, like myDocument) is publicly accessible, while all subpaths (IDs with dots, like secret.myDocument or drafts.myDocument) are private.

Your secret. singleton pattern:

This is actually a clever use of Sanity's ID system! By using a prefix like secret.mySettings, you're creating a document that:

Important considerations:

This is a practical pattern for singleton configuration documents, settings, or secrets that should only be accessible to authenticated Studio users!

Show original thread
3 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

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.

Related contributions