APIActive

Sanity HTTP API

Higher-level HTTP API for mutating documents, versions, and releases in Sanity Content Lake.

Open source page ↗

Field note

What it does

Authenticated HTTP endpoint used by Studio for authoring workflows; alternative to the Mutations API.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

rest

Not filed / https://www.sanity.io/docs/http-reference

rest

Not filed / https://www.sanity.io/docs/http-reference/actions

cli

Not filed / Not filed

rest

Not filed / https://www.sanity.io/docs/http-reference/embeddings-index

rest

Not filed / https://www.sanity.io/docs/http-reference/activity-log

rest

Not filed / https://www.sanity.io/docs/http-reference/assets

rest

Not filed / https://www.sanity.io/docs/http-reference/doc

Product features

Product features

Applications management

List, create, get, update, and delete org-owned applications.

Assets API

HTTP API reference for assets.

Chat

Send a message to the agent and receive a streaming response with persisted history.

Configs

Register user application configs and deploy or delete installation configurations.

Copy dataset

PUT endpoint that copies an existing dataset to a new target dataset.

Core components

Create an embeddings index

POST endpoint to create a new embeddings index for an existing dataset.

Deployments

Deploy applications and user applications, and list deployments.

Dispatch endpoint

Dispatch one or more actions in a single request to the Actions HTTP endpoint.

Document Actions

Create, delete, edit, publish, and unpublish documents via sanity.action.document types.

Enable or disable backups

PUT endpoint to enable or disable backups for a dataset.

Export activity log events as CSV

GET /v2021-02-01/activity/export/csv returns CSV export of matching events.

Feature overrides

Explicit feature overrides applied on top of capability-derived defaults, e.g. webSearch.

Filtering content

Follow the guided steps

Send an instruction to Generate

POST /agent/action/generate/{dataset} sends an instruction request to Generate for a specific dataset.

Get a backup

GET endpoint for retrieving backup details, designed for the Sanity CLI backup download command.

Get activity log events

GET /v2021-02-01/activity returns events matching supplied filters.

Get all embeddings indexes

GET endpoint to retrieve a list of all embeddings indexes for a dataset.

Get one or more documents

GET endpoint retrieves documents by ID, cutting through caching middleware.

GROQ filters

GROQ boolean expressions control document visibility and mutation permissions.

How it fits together

includeAllVersions parameter

If true, includes all versions including drafts and releases. Default false.

Install the Sanity Context skill

Installations

Install and uninstall singleton applications and list installations.

Job status

Check copy operation status via the Jobs API using the returned jobId.

List backups

GET endpoint returning a list of backups with limit, after, and before filters.

Listen API

HTTP API reference for listening to changes.

MCP endpoint

MCP endpoint segments

Mutation API

HTTP API reference for mutations.

Perspective locking

Controls which document perspectives the agent can read from and write to.

Prerequisites

Projects API

HTTP API reference for projects.

Prompt

Send a one-shot prompt to the agent.

Prompt the LLM for a response

Prompt the LLM for a response through the Agent Actions HTTP API.

Prompt your coding agent to run the setup skill

Query API

HTTP API reference for querying content.

Query an embeddings index

Endpoint to query an embeddings index.

Release Actions

Create, edit, publish, archive, schedule, and delete releases via sanity.action.release types.

Sanity Context

Sanity Context document

Make a schema-aware patch to a document

Make a schema-aware patch to a document using the Agent Actions HTTP API.

Skip history

skipHistory option skips document history to reduce copy time.

SSE streaming

Streaming responses via Server-Sent Events, compatible with the Vercel AI SDK.

Studio hosts

Get appHost availability and studio auto-updating version status.

Supported groqFilter operators

Transform a document

POST /agent/action/transform/{dataset} transforms a source document into a new document.

Translate a document

Translate a document via the Agent Actions HTTP API.

Upload a file asset

POST to /assets/files/{dataset} to upload a file and create a sanity.fileAsset document.

Upload an image asset

POST to /assets/images/{dataset} to upload an image and create a sanity.imageAsset document.

User applications

Create, get, update, and delete user applications, including per-project routes.

Version Actions

Create, discard, replace, and unpublish document versions via sanity.action.document.version types.

Webhooks API

HTTP API reference for webhooks.