Content Lake (Datastore)

URL format

Every Sanity HTTP API request uses a URL made of your project's hostname, an API version, and an endpoint path: https://YOUR_PROJECT_ID.api.sanity.io/API_VERSION/PATH

Every Sanity HTTP API request uses a URL made of your project's hostname, an API version, and an endpoint path.

Take this generic document query URL:

https://.api.sanity.io/v2026-06-09/data/query/production?query=*[0]

Each project has its own hostname, which is always .api.sanity.io for the uncached API and .apicdn.sanity.io for the API CDN (cache) endpoint. Replace with your project ID. The path (what comes after the hostname) always starts with the API version (API_VERSION): the letter v followed by a date in YYYY-MM-DD format. To use the latest version, set the date to today. After the version comes the path to the API endpoint (PATH). So, to sum it up, these are the URL prefixes:

  • API: https://.api.sanity.io/API_VERSION/PATH
  • API CDN: https://.apicdn.sanity.io/API_VERSION/PATH

In the rest of this document we will generally only refer to the PATH part of the URL.

Note about the API CDN

Find your project ID

In a configured studio, you find the project ID in the sanity.config.ts (or sanity.config.js) file at the root of your project. Otherwise, you can always find it by locating your project on sanity.io/manage or running sanity debug in the terminal in your studio folder.

URL encoding

For clarity, the URLs in this article are written with their components unencoded. When you make a request, encode each component (using encodeURIComponent or equivalent) so that this:

https://.api.sanity.io/v2026-06-09/data/query/production?query=*[_id == $id]&$id="myId"

Becomes this:

https://.api.sanity.io/v2026-06-09/data/query/production?query=*%5B_id%20%3D%3D%20%24id%5D&%24id=%22myId%22

Gotcha

Was this page helpful?

Sanity logosanity.ioAll Systems Operational© Sanity 2026
Change site theme