The Sanity Actions API runs content authoring actions against a Sanity dataset, the same higher-level operations Sanity Studio uses for everyday editing. A single request carries an ordered list of actions that execute in one transaction and roll back together if any fails. Document actions create, edit with a patch, publish, unpublish, and delete documents, version actions stage document changes inside a release, and release actions create, edit, schedule, publish, archive, and delete releases. It is a higher-level alternative to the Sanity Mutations API and requires API version v2024-05-23 or later, with version and release actions needing v2025-02-19.
The Sanity Doc API fetches the latest version of one or more Sanity documents by ID straight from the backend, bypassing caching and the delay of the query index. A single request takes a comma-separated list of document IDs, and includeAllVersions can add the draft and every release version of each published ID. Any ID that is not returned is listed in omitted with the reason existence or permission, and excludeContent returns only that list to check whether documents exist. It is less scalable than the Query API, so it suits read-after-write checks rather than general content fetching.
The Sanity History API returns past revisions of documents in a Sanity dataset and the transactions that changed them. A document can be fetched as it was at a given timestamp, at a specific revision ID, or at its last revision, which for a deleted document is its final state before deletion. Transaction logs come back as NDJSON for the whole dataset or for a comma-separated list of document IDs, filtered by time range, transaction range, and author IDs, with effects expressed in the Mendoza diff format. Access follows the document's current permissions, so anyone who can read a document today can read all of its earlier revisions.
The Sanity Listen API streams an event every time a document matching a GROQ filter is modified in a Sanity dataset, over a server-sent events connection the backend holds open. Each mutation event names the document ID, transaction ID, transition such as update, the identity that made the change, and the previous and resulting revisions, and can optionally include the resulting document, the document before the change, the mutations applied, and Mendoza effects. Listeners can wait until changes are visible to queries, include release version documents, and resume after a reconnect from the last event ID so no changes are missed. Sanity recommends its Live Content API for most new projects; Listen remains the way to receive per-document mutation detail.
The Sanity Live API streams sync tag invalidation events for a Sanity dataset, the signal underneath the Live Content API. Over a server-sent events connection it sends batches of sync tags on published documents as they become invalid, so a site or app knows which cached content to refetch without polling. Tokened requests can also include draft, version, and system document changes, and a stream can wait until a configured Sync Tag Invalidate Function has processed events. A client can restart from a previously returned event ID, and the stream signals restart, goaway, and error conditions as events.
The Sanity Mutations API creates, updates, and deletes documents in Sanity Content Lake, applying an array of mutations to a dataset as one transaction so either every mutation runs or none do. Mutation types are create, createOrReplace, createIfNotExists, delete, and patch, and delete and patch can target documents by ID or by a GROQ query, with patches applying set, setIfMissing, unset, inc, dec, and insert operations in a fixed order. Requests can return the changed document IDs or full documents, set their own transaction ID, auto-generate array item keys, validate without writing through a dry run, and choose whether to wait until changes are visible to queries. An ifRevisionID check gives optimistic locking so a write fails if the document changed since it was read.
The Sanity Query API runs GROQ queries against a dataset in Sanity Content Lake and returns the result along with the time taken and sync tags for cache invalidation. Queries can be sent as GET with the query in the URL or as POST for long queries and large parameter values, with GROQ parameters passed alongside. A perspective setting chooses whether the query sees published content, drafts, raw documents, or a custom stack of release IDs, and options add a query execution plan, content source maps for visual editing, and request tags for log filtering. The same endpoint is served from Sanity's API CDN for edge-cached results on the published and raw perspectives.
The Sanity Scheduling API publishes or unpublishes documents in a Sanity dataset at a set UTC time, and can also publish or unpublish a batch of documents immediately in one transaction. Each schedule carries a name, an executeAt timestamp, a publish or unpublish action, and the document IDs it targets, and moves through the scheduled, executing, succeeded, and cancelled states. Schedules can be listed and filtered, renamed or retimed, cancelled before they run, or run straight away. Sanity marks this API as deprecated and recommends Content Releases for new work, and it requires a Growth or higher plan.
BOOK A DEMO
Browse thousands of APIs and connect them all to your agent with Jentic One. One layer, one credential — every API your agent needs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fsanity.io" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fsanity.io" | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.