For Agents
List who has access to a Sanity project or organization, change their roles, send or revoke invites, approve access requests, and create robot tokens scoped to one resource.
Use for: List all users of my Sanity project and their roles, I need to give a new editor access to project c7ja4siy, Invite jane@example.com to our Sanity organization as a viewer, Find all pending access requests for this project and approve them
Not supported: Does not manage projects, datasets, content, or user sign-in and SSO. Use for Sanity users, roles, permissions, invites, access requests, and robot tokens only.
The Sanity Access API controls who can reach a Sanity organization or project, and what they can do there. Every call is made against a resourceType and resourceId in the path, such as /access/project/{resourceId}/roles, and covers the users on that resource and their roles, custom roles and permissions, email invites, access requests, and robots with their own secret tokens. It can also report or check the calling user's own permissions, apply an organization's default role to every member, and let a robot rotate or revoke its own token.
Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Sanity Access 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-access-api" | 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-access-api" | 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 Sanity Access API.
List the users of a Sanity project or organization with their roles, filtered by email or displayName and sorted with sortBy and orderBy
Replace a user's complete role set in one call with roleNames, or add and remove a single role by roleName
Create custom roles with a name, title, appliesToUsers and appliesToRobots flags, and a list of permissions with actions such as read or update
Invite people by email with a role and optional callbackUrl, list pending invites, and revoke them by inviteId
Review access requests, then accept them with roleNames or decline them
Create robots with a label, optional expiresAt, and memberships naming roleNames, and receive the secret token once
Check whether the calling user holds specific permissions on a resource with the permissions query parameter
Patterns agents use Sanity Access API for, with concrete tasks.
★ AI agent running access reviews
An agent asked who can change a Sanity project searches Jentic for 'list Sanity project users and roles', loads the getUsers operation, and calls it for the project's resourceId. It can then pull getUser for anyone with an administrator role and getRobots for robot access, and report the full picture without the bearer token ever entering its context.
Call GET /v2025-07-11/access/project/{resourceId}/users for project c7ja4siy, then GET /v2025-07-11/access/project/{resourceId}/robots, and summarize which users and robots hold the administrator role
Onboarding through invites and access requests
New collaborators reach a Sanity project two ways. An admin sends an invite with createInvite, giving an email and a role, and Sanity emails a link to accept; each invitee gets one invite per resource and role. People can also ask for access themselves with createRequest, and an admin lists them with getRequests and either accepts with roleNames or declines.
POST /v2025-07-11/access/project/{resourceId}/invites with email jane@example.com and role editor, then GET /v2024-07-01/access/project/{resourceId}/requests and accept each pending request with roleNames ["viewer"]
Scoped robot tokens for automation
CI jobs and scripts should not reuse a person's token. The createRobot operation makes a robot with a label, an optional expiresAt, and memberships that name a resourceType, resourceId, and roleNames, and returns its secret token once. Only the specified resource and its children can be granted, and the robot itself can later call the rotate or revoke endpoints under /access/robots/me.
POST /v2025-07-11/access/project/{resourceId}/robots with label ci-deploy, expiresAt set to 90 days out, and memberships [{resourceType: project, resourceId: c7ja4siy, roleNames: ["editor"]}], then store the returned token
Custom roles for least-privilege access
Built-in roles do not fit every team. The createRole operation defines a role with a lowercase name, a title, and a permissions list pairing a permission name with an action, and appliesToUsers or appliesToRobots controls who can hold it. Creating roles requires the advancedRolesManagement feature, and getUserPermissions shows what the caller ends up with.
POST /v2025-07-11/access/project/{resourceId}/roles with name translator, title Translator, and a permissions list, then PUT /v2025-07-11/access/project/{resourceId}/users/{sanityUserId}/roles/translator for the translator's user id
40 endpoints — the sanity access api controls who can reach a sanity organization or project, and what they can do there.
METHOD
PATH
DESCRIPTION
/v2025-07-11/access/{resourceType}/{resourceId}/users
List users of a resource and their roles
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}/roles
Replace a user's role set
/v2025-07-11/access/{resourceType}/{resourceId}/roles
Create a custom role
/v2025-07-11/access/{resourceType}/{resourceId}/invites
Invite a user by email
/v2024-07-01/access/{resourceType}/{resourceId}/requests/{requestId}/accept
Accept an access request
/v2025-07-11/access/{resourceType}/{resourceId}/robots
Create a robot and its token
/v2025-07-11/access/{resourceType}/{resourceId}/user-permissions/me/check
Check the caller's permissions
/v2025-07-11/access/{resourceType}/{resourceId}/users
List users of a resource and their roles
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}/roles
Replace a user's role set
/v2025-07-11/access/{resourceType}/{resourceId}/roles
Create a custom role
/v2025-07-11/access/{resourceType}/{resourceId}/invites
Invite a user by email
/v2024-07-01/access/{resourceType}/{resourceId}/requests/{requestId}/accept
Accept an access request
/v2025-07-11/access/{resourceType}/{resourceId}/robots
Create a robot and its token
/v2025-07-11/access/{resourceType}/{resourceId}/user-permissions/me/check
Check the caller's permissions
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>What agents get from Jentic-routed access to this vendor.
Setup
Wiring the Sanity Access API by hand means juggling two dated path prefixes (v2025-07-11 and v2024-07-01), a resourceType and resourceId on every call, a user bearer token for most operations and a robot's own token for rotation. Through Jentic you install once, import it from the API Directory, store the token once, and your agent calls it.
Permission scoping
Sanity puts both the resource type and its id in the URL path (/access/{resourceType}/{resourceId}/...), so a rule can pin your agent to one project or organization and the operations you pick. You choose the operations it may call, so destructive ones like removeUser, deleteRole, or deleteRobot are not included unless you add them.
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 'invite a user to a Sanity project' or 'create a Sanity robot token', and Jentic returns the matching operation, such as createInvite or createRobot, with its input schema.
Alternatives and complements available in the Jentic catalogue.
Specific to using Sanity Access API through Jentic.
What authentication does the Sanity Access API use?
Per its OpenAPI spec, the Sanity Access API uses a bearer token (bearerAuth, a JWT) in the Authorization header for most operations. The two self-service robot operations, revoking and rotating the current robot token under /v2025-07-11/access/robots/me, use robotTokenAuth instead: the robot's own bearer token. Each operation also lists the Sanity permission it needs, such as sanity.organization.members.update. Through Jentic the token is stored by your own instance and attached at call time.
Can I create robot tokens with the Sanity Access API?
Yes. The createRobot operation takes a label, memberships naming a resourceType, resourceId, and roleNames, and an optional expiresAt, and returns the secret token once; it cannot be retrieved again. Only the specified resource and its children can be granted. Set sendNotification to false to skip the notification email.
How do I change a user's roles in Sanity?
Call replaceRolesForUser with a roleNames list to make it the user's complete role set: missing roles are added and extra ones removed, and at least one role must remain. To change a single role, use addRoleToUser or removeRoleFromUser with the roleName in the path.
What are the rate limits for the Sanity Access API?
The OpenAPI spec does not specify rate limits. Check the Sanity documentation at https://www.sanity.io/docs for current API limits for your plan.
Is there a Sanity MCP server?
You don't need an MCP server to give your agent the Sanity Access API. Jentic connects it directly from the API Directory: import it, store your Sanity token once, and your agent calls the user, role, invite, and robot operations it needs without loading a separate server's tool definitions.
How do I invite someone to a Sanity project through Jentic?
Search Jentic for 'invite a user to a Sanity project', load the createInvite operation, and execute POST /v2025-07-11/access/project/{resourceId}/invites with the email and role. The invitee receives an email with a link to accept. 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 Access API?
Yes. Allow only the GET operations under /v2025-07-11/access/project/c7ja4siy, and the agent can review that project's users, roles, invites, and robots while role changes, user removal, and robot creation stay off its list. Every call it makes is logged.
GET STARTED