Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Mutations API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
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%2Fsanity-mutation" | 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%2Fsanity-mutation" | 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.
What an agent can do with Mutations API.
Create a document with a generated or given _id, or create it only if it does not already exist
Patch a document with set, unset, inc, dec, setIfMissing, and insert operations in one call
Delete or patch every document matching a GROQ query, up to 10,000 documents per transaction
Validate a batch of mutations without writing anything by setting dryRun to true
GET STARTED
Lock against concurrent edits with ifRevisionID so the patch fails if the document has changed
Return changed document IDs or full documents with returnIds and returnDocuments
Patterns agents use Mutations API for, with concrete tasks.
★ AI agent writing content changes
An agent asked to fix typos or update prices across documents needs to write to Sanity safely. Through Jentic it searches for 'update a Sanity document', loads the mutate operation, and posts a mutations array with patch set operations while the Sanity token is injected at call time. Running first with dryRun true lets it validate the batch, and the real call applies every change in one transaction.
POST /data/mutate/production with dryRun true and a mutations array containing a patch for id '123' that sets title to 'Updated title', then repeat without dryRun and returnIds true
Bulk cleanup by GROQ query
Removing or correcting many documents at once is a single mutation when it targets a GROQ query instead of an ID. A delete or patch with a query and params acts on every matching document, up to 10,000 per transaction; larger sets are split and paginated by _id as the spec recommends.
POST /data/mutate/staging with a delete mutation whose query is '*[_type == "feature" && viewCount < $views]' and params views 10, with returnIds true
Safe concurrent editing
When several processes edit the same document, a blind write can overwrite someone else's change. Passing ifRevisionID with the revision the agent last read makes the patch fail if the document has moved on, and visibility sync makes the call return only once the change is visible to subsequent queries.
POST /data/mutate/production with a patch for id 'settings' that includes ifRevisionID from the last read and sets title, with visibility 'sync'
1 endpoints — 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.
METHOD
PATH
DESCRIPTION
/data/mutate/{dataset}
Apply an array of mutations as one transaction
/data/mutate/{dataset}
Apply an array of mutations as one transaction
What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Sanity Mutations API by hand means templating the projectId and apiVersion into the host, sending a bearer token with write access, and shaping each mutation type and patch operation exactly. Through Jentic you install once, import it from the API Directory, store the token once, and your agent calls it.
Permission scoping
Sanity puts the dataset name in the URL path (/data/mutate/{dataset}), so a rule can pin your agent to one dataset such as staging. The mutation type travels in the request body, so a rule bounds where the agent can write, not whether it creates or deletes; use a Sanity token whose own role fits the job.
Credential isolation
Your Sanity token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'update a Sanity document' or 'delete Sanity documents by query', and Jentic returns the mutate operation with its input schema, including every mutation type.
Alternatives and complements available in the Jentic catalogue.
Specific to using Mutations API through Jentic.
What authentication does the Sanity Mutations API use?
Per its OpenAPI spec, the Sanity Mutations API uses a bearer token in the Authorization header. The spec notes deleting system documents requires manage permission. Through Jentic the token is stored by your own instance and attached at call time, so it stays out of the agent's context.
What is the difference between create, createOrReplace, and createIfNotExists?
create fails if a document with the given ID already exists, and generates an ID if _id is missing or ends with a dot. createOrReplace replaces an existing document completely, or acts as delete then create if the type differs. createIfNotExists silently does nothing when the document already exists.
Can I test Sanity mutations without changing data?
Yes. Set dryRun to true and the mutations are validated but not executed, so an agent can check a batch before it writes.
What are the rate limits for the Sanity Mutations API?
The OpenAPI spec does not specify rate limits. It does cap delete and patch by query at 10,000 documents per transaction. Check the Sanity documentation at https://www.sanity.io/docs for current API limits.
Is there a Sanity MCP server?
You don't need an MCP server to give your agent the Sanity Mutations API. Jentic connects it directly from the API Directory: import it, store your Sanity token once, and your agent calls the mutate operation with the full mutation schema when it needs to write.
How do I update a Sanity document through Jentic?
Search Jentic for 'update a Sanity document', load the mutate operation, and execute POST /data/mutate/{dataset} with a mutations array containing a patch with the document id and a set object. To run it on your own infrastructure, install Jentic One from its GitHub repo.
Can I limit what my agent is allowed to do with the Sanity Mutations API?
Yes, by dataset. Write a rule that allows the mutate operation only at /data/mutate/staging, and the agent can create and patch staging documents while production stays out of reach. Every call it makes is logged.
For Agents
Create, replace, patch, and delete Sanity documents by ID or GROQ query in one transaction per call, with dry-run validation and optimistic locking by revision ID.
Use for: Update the title of article 123 in the production dataset, I need to create a new product document in Sanity, Increment the view count on this post, Delete all feature documents with fewer than 10 views
Not supported: Does not run read queries, upload assets, or publish releases. Use for transactional document writes in a Sanity dataset only.
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.
This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.
Base layer of spec validity and structural soundness.
Aggregated quality score from linter diagnostics, weighted by severity.
Percentage of `$ref` references that resolve successfully.
Checks whether the API description parses successfully and conforms to its declared specification (e.g., OpenAPI).
Structural correctness score based on schema issues using logarithmic dampening.
Clarity, completeness, and ingestion readiness for developers and tooling.
How richly the API is illustrated with examples.
Percentage of examples that conform to their schemas.
Percentage of operations with complete response definitions (success, client error, server error).
Health of API ingestion, bundling, and resolution within Jentic pipelines.
Semantic breadth, depth, and agent comprehension for AI systems.
Coverage of descriptions across API elements.
Coverage of RFC 9457 Problem Details for error responses.
Coverage, uniqueness, and casing consistency of operationIds for AI inference.
Coverage of summaries across operations/tags/info.
Functional utility, complexity comfort, and AI orchestration readiness.
Agent comfort level based on API operational and structural complexity.
Trust, risk posture, and security compliance.
Average quality of security schemes based on authentication method strength (weakest link for OAuth2).
Findability, semantic richness, and reasoning readiness.
Clarity and depth of descriptions across API elements.
Score it yourself
Every API in the directory is allowlisted, so you can re-score it with no key required.
npx @jentic/api-scorecard-cli score <openapi-url>