Access API reference
A centralized API to manage resource access control through roles and permissions.
A centralized API to manage resource access control through roles and permissions.
Authentication
- All requests must be authenticated.
- See the individual endpoints below for required usage permissions.
Terms
Throughout this document the terms {resourceType} and {resourceId} refer to the resource the API request is being applied to.
{resourceType}can be an organization or project.{resourceId}is the ID of the resource the API request affects.
When a client uses this API, it acts in the context of a specific resource. For example:
- https://api.sanity.io/v2025-07-11/access/organization/or0Bc1hcJ/roles
- https://api.sanity.io/v2025-07-11/access/project/c7ja4siy/roles
Key concepts
Resource
A resource is an entity that can be managed and accessed through the API. Currently, the supported resources are organization and project.
Permission
Every resource has a list of permissions. These permissions represent actions that can be performed on the resource. A user or robot must be granted a permission (through a role) in order to perform the action.
The permission typically takes the form of {company}.{resourceType}.{objectName}.{action} but this is not always the case due to legacy terms.
There are both pre-defined and custom permissions. Pre-defined permissions are included with the product and are not editable.
Role
A role is a named collection of permissions that can be applied to a user or robot. Roles are in the scope of a resource and can only receive permissions that are in the same resource scope. For example, a project role can only include document permissions for that project.
A role is specific to a single resource and can only include permissions within that resource's scope. In the future, roles will be able to include permissions for child resources as well. For example, an organization role will be able to include document permissions for specific projects or all projects.
A user cannot be part of a resource without a role. Each user in an organization must have at least one role assigned to them.
There are both pre-defined and custom roles. Pre-defined roles are included with the product and are not editable, but can be removed from a resource if the feature is enabled.
User
A user is a person that has one or more roles assigned to them.
A user is initially added to a resource via invitation or access request. A user that already has one role can be assigned roles in another project within the same organization or at the organization level without requiring a separate invite.
As an organization owns multiple resources (e.g., projects), any users with roles on these resources are also returned when reading the users of an organization.
If a user has roles in multiple projects, they are considered a single user and can be referenced by their sanityUserId. For example, inviting user A to project B and project C in the same organization will result in a single user with two memberships.
Administrator Rules
Changing Administrators
Only administrators can assign or remove roles with admin permissions. This prevents unauthorized permission elevation.
This rule applies only to the default roles. Custom roles are fully managed by the organization and can be assigned to users without restriction.
Last Administrator
Each resource must have at least one role assigned to at least one user that can read users, read roles, and assign roles to users. This prevents an organization from losing control over their resources.
This is designed as a permission-level check and not a role-level check, so that the default roles can be removed from a resource. Customers with advanced roles management enabled can remove the default roles from a resource.
Breaking Changes from previous versions
See the details of the existing API for a better understanding of the changes.
Summary:
Accessis now the root path for managing access-based resources. Previously it was organization and project but these are now nested under the access root.- Internal IDs are no longer exposed for permissions or roles. The
nameproperty is now used as the unique identifier for permissions and roles. Permissionsnow representgrants,resources, andpermissionResourceSchema. These are now legacy terms.- The endpoint
/organization/:organizationId/usersreturns users for all resources owned by the organization. Previously, a client would have to make a request for each resource (e.g., project) individually. usersreplaces the termACL. Users represents individuals assigned roles within the organization.- The pre-defined roles can be completely removed from a resource. Previously, default roles could not be removed from a resource. E.g., a project required at least one project administrator, even if there were custom roles that would cover the same use case.
Base API server URL
Production External API
https://api.sanity.ioUsers
Manage users who have been assigned organization roles.
List all users of a resource and their assigned roles.
/v2025-07-11/access/{resourceType}/{resourceId}/usersRetrieve a list of all users of a resource along with their assigned roles. When the resourceType is organization, this endpoint will return users of projects owned by the organization. Requires permission
sanity.{resourceType}.members.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Whether to include implied roles in the response.
- sortBystring
Field by which to sort result. Currently supports field 'displayName'
Example:displayName - orderBystring
In which order to list results
Example:desc - emailstring
Filter results based on
emailmatch - displayNamestring
Filter results based on
displayNamematch
Responses
A paginated list of resource users and their assigned roles
Show child attributes
items
- Example:
gDdcnv42e Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Cursor to get the next page of results,
nullif there are no more results.Total number of users available
Example:1
Apply organization default role to all users.
/v2025-07-11/access/organization/{resourceId}/users/roles/defaultAdd default role to all resource users. Limited to Organization. Requires permission
sanity.organization.members.update
Path parameters
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Responses
Roles assigned to the resource users
Get user and roles.
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}Get the users for a single user of a resource. Requires permission - sanity.{resourceType}.members.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe User ID
Example:gDdcnv42e
Query parameters
Whether to include implied roles in the response.
Responses
Get resource user and their roles.
- Example:
gDdcnv42e Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Remove a user from a resource.
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}This removes all roles. If the resourceType is organization, this will also remove the user from all projects owned by the organization. Requires permission
sanity.{resourceType}.members.delete
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe User ID
Example:gDdcnv42e
Responses
User removed from the resource
Remove own user from a resource.
/v2025-07-11/access/{resourceType}/{resourceId}/users/meThis removes the currently authenticated user from the given resource. If the resourceType is organization, this will also remove the user from all projects owned by the organization. This is a specific route which does not require resource permissions, since users should be able to remove themselves from resources without requiring an administrator to intervene for them.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Responses
User removed from the resource
Add a role to a user.
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}/roles/{roleName}Add a role to a user. Requires permission
sanity.{resourceType}.members.update
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe User ID
Example:gDdcnv42eThe role name.
Example:administrator
Responses
Role assigned to the user
- Example:
gDdcnv42e Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Remove a role from a user in a resource.
/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}/roles/{roleName}You cannot remove the last role from a user. You must have at least one role assigned to a user. Requires permission
sanity.{resourceType}.members.update
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe User ID
Example:gDdcnv42eThe role name.
Example:administrator
Responses
Role removed from user
Robots
Manage robots and robot tokens.
Get robots with access to this resource
/v2025-07-11/access/{resourceType}/{resourceId}/robotsRetrieves a list of robots that have access to the specified resource.
Access to children resources
By default, this endpoint returns robots that have at least one role on
the specified resource. Use the optional includeChildren parameter to
include robots that have a role on children resources as well. This
only applies to organization resources.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.tokens.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- includeChildrenboolean
Whether to include children resources in the response. Only applies to
organizationresources.Example:false - nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Responses
A paginated list of robots
Show child attributes
items
The unique identifier for the robot.
- tokenIdstring
The unique identifier for the active token.
A human-readable label for the robot.
The creation date of the robot.
- expiresAtstring (date-time)
When the active token expires.
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Cursor to get the next page of results,
nullif there are no more results.
Create robot and associated token
/v2025-07-11/access/{resourceType}/{resourceId}/robotsCreates a robot with the specified role grants and returns its secret token.
Only the specified resource and its children resources can be specified in the role grants. The robot will not have access to other resources.
Secret token
The secret token is only returned once and can not be retrieved again. If the token is lost, a new robot must be created. The previous robot should be deleted.
Email notifications
For project robots, an email notification is sent to all project administrators
by default when a robot is created. This can be disabled by setting
sendNotification=false, but only for projects created within the last 5 minutes.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.tokens.create
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
Whether to send email notification to administrators when creating project robots. Only applies to project resource types. Can be set to false for projects created within the last 5 minutes.
Example:true
Request body application/json
A human-readable label for the robot.
Example:My Robot- expiresAtstring (date-time)
When the token should expire.
Example:2030-01-01T00:00:00.000Z Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Responses
Robot created.
The secret token for the robot.
The unique identifier for the robot.
- tokenIdstring
The unique identifier for the active token.
A human-readable label for the robot.
The creation date of the robot.
- expiresAtstring (date-time)
When the active token expires.
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Get robot metadata
/v2025-07-11/access/{resourceType}/{resourceId}/robots/{robotId}Retrieves a robot using its unique identifier.
It's not possible to retrieve a robot token.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.tokens.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe robot's unique identifier.
Example:gJh7daoq4
Responses
Robot found.
The unique identifier for the robot.
- tokenIdstring
The unique identifier for the active token.
A human-readable label for the robot.
The creation date of the robot.
- expiresAtstring (date-time)
When the active token expires.
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Update robot token
/v2025-07-11/access/{resourceType}/{resourceId}/robots/{robotId}Updates the expiry date for a robot token.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.tokens.create
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe robot's unique identifier.
Example:gJh7daoq4
Request body application/json
When the robot token should expire.
Example:2030-01-01T00:00:00.000Z
Responses
Robot token expiry updated.
The unique identifier for the robot.
- tokenIdstring
The unique identifier for the active token.
A human-readable label for the robot.
The creation date of the robot.
- expiresAtstring (date-time)
When the active token expires.
Show child attributes
items
- addedAtstring (date-time)Example:
2024-01-15T12:15:30Z - Example:
project - Example:
c7ja4siy - Example
["administrator","editor"]Show child attributes
items
- string
- lastSeenAtstring (date-time) | nullExample:
2024-01-15T12:15:30Z - resourceUserIdstring | null
An alternative ID for the user in the resource. Only present for project memberships. That is, a user can be assigned to multiple projects, and each project will have a different resourceUserId to reference the same user.
Example:projectUserId123
Delete robot and associated token
/v2025-07-11/access/{resourceType}/{resourceId}/robots/{robotId}Deletes a robot and revokes its token.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.tokens.delete
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe robot's unique identifier.
Example:gJh7daoq4
Responses
Robot deleted.
Roles
Manage roles assignable to users of an organization or application.
List roles assignable to a user on this resource.
/v2025-07-11/access/{resourceType}/{resourceId}/rolesRequires permission
sanity.{resourceType}.roles.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- includeChildrenboolean
Whether to include children resources in the response. Only applies to
organizationresources.Example:false - nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Whether to include implied roles in the response.
Responses
A paginated list of roles for a resource
Show child attributes
items
- Example:
administrator - Example:
Administrator - descriptionstringExample:
Administrators can manage billing details, legal contacts, organization users, and manage project ownership. - isCustombooleanExample:
false - Example:
organization - Example:
or0Bc1hcJ - Example:
true - Example:
true Show child attributes
items
- typestring
The resource for the permission.
Example:sanity.document.filter.mode Show child attributes
- stringenum:
"create", "read", "update", "manage", "history", "editHistory"
- namestring
The name of the permission.
Example:legal-documents - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"dataset":"development"}
Cursor to get the next page of results,
nullif there are no more results.
Create a role
/v2025-07-11/access/{resourceType}/{resourceId}/rolesRequires permission:
sanity.{resourceType}.roles.createRequires feature:advancedRolesManagement
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Request body application/json
- Example:
Custom Role - Example:
custom-role - Example:
Custom role for project Show child attributes
items
Responses
Role created
- Example:
administrator - Example:
Administrator - descriptionstringExample:
Administrators can manage billing details, legal contacts, organization users, and manage project ownership. - isCustombooleanExample:
false - Example:
organization - Example:
or0Bc1hcJ - Example:
true - Example:
true Show child attributes
items
- typestring
The resource for the permission.
Example:sanity.document.filter.mode Show child attributes
- stringenum:
"create", "read", "update", "manage", "history", "editHistory"
- namestring
The name of the permission.
Example:legal-documents - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"dataset":"development"}
Get a role
/v2025-07-11/access/{resourceType}/{resourceId}/roles/{roleName}Requires permission
sanity.{resourceType}.roles.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe role name.
Example:administrator
Responses
Get a role
- Example:
administrator - Example:
Administrator - descriptionstringExample:
Administrators can manage billing details, legal contacts, organization users, and manage project ownership. - isCustombooleanExample:
false - Example:
organization - Example:
or0Bc1hcJ - Example:
true - Example:
true Show child attributes
items
- typestring
The resource for the permission.
Example:sanity.document.filter.mode Show child attributes
- stringenum:
"create", "read", "update", "manage", "history", "editHistory"
- namestring
The name of the permission.
Example:legal-documents - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"dataset":"development"}
Update a role
/v2025-07-11/access/{resourceType}/{resourceId}/roles/{roleName}Requires permission:
sanity.{resourceType}.roles.update
Requires feature:
advancedRolesManagement
Replaces existing object values including permissions.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe role name.
Example:administrator
Request body application/json
- Example:
Custom Role - Example:
custom-role - Example:
Custom role for project Show child attributes
items
Responses
Role updated
- Example:
administrator - Example:
Administrator - descriptionstringExample:
Administrators can manage billing details, legal contacts, organization users, and manage project ownership. - isCustombooleanExample:
false - Example:
organization - Example:
or0Bc1hcJ - Example:
true - Example:
true Show child attributes
items
- typestring
The resource for the permission.
Example:sanity.document.filter.mode Show child attributes
- stringenum:
"create", "read", "update", "manage", "history", "editHistory"
- namestring
The name of the permission.
Example:legal-documents - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"dataset":"development"}
Delete a role
/v2025-07-11/access/{resourceType}/{resourceId}/roles/{roleName}Requires permission:
sanity.{resourceType}.roles.deletefor resource scoped roles (e.g. project admin)
Requires feature:
advancedRolesManagement
Cannot delete a role that is assigned to a user. The role needs to be removed from users first.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe role name.
Example:administrator
Responses
Role deleted
Permissions
View permissions available to roles within an organization or application.
Get Permissions.
/v2025-07-11/access/{resourceType}/{resourceId}/permissionsGets the available permissions within the scope of a resource. These permissions can be applied to roles and are used to determine user/robot access to resources.
Requires permission: sanity.{resourceType}.roles.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Responses
A paginated list of permission resources for the resource
Show child attributes
items
The resource for the permission.
Example:sanity.document.filter.modeThe actions allowed by the permission for this role.
Example:["mode"]Show child attributes
- namestring
- titlestringExample:
Sanity Document Filter - descriptionstringExample:
Defines a permission resource for a filtered collection of Sanity documents
items
The name of the permission. This is the unique identifier for the resource.
Example:legal-documentsThe human-readable title of the permission.
Example:Permission for "Legal" Folder- descriptionstring
The description of the permission.
Example:Permission for "Legal" Folder The resource the permission applies to.
Example:projectThe resource ID the permission applies to.
Example:c7ja4siy- ownerOrganizationIdstring
The organization ID the permission applies to. Used for wildcard permissions where the resourceId is
*.Example:or0Bc1hcJ - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"filter":"*[_type == \"legal\"]"}
Cursor to get the next page of results,
nullif there are no more results.
Create a permission.
/v2025-07-11/access/{resourceType}/{resourceId}/permissionsCreates a custom permission on a resource.
Requires permission: sanity.{resourceType}.roles.create
Requires feature: advancedRolesManagement
See Example. It creates a permission to allow a user to read legal documents in project c7ja4siy and dataset production.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Request body application/json
The resource for the permission.
Example:sanity.document.filter.modeThe name of the permission resource. A unique identifier for a permission.
Example:legal-documentsA human-readable title of the permission resource. This is used for display purposes.
Example:Permission for "Legal" FolderThe description of the permission resource.
Example:Permission for "Legal" Folder- configobject
Some permissions allow for additional configuration when used with document permissions. Accepts a groq filter or a dataset name.
Example{"filter":"*[_type == 'legal']"}
Responses
Permission resource created successfully
The resource for the permission.
Example:sanity.document.filter.modeThe actions allowed by the permission for this role.
Example:["mode"]Show child attributes
- namestring
- titlestringExample:
Sanity Document Filter - descriptionstringExample:
Defines a permission resource for a filtered collection of Sanity documents
items
The name of the permission. This is the unique identifier for the resource.
Example:legal-documentsThe human-readable title of the permission.
Example:Permission for "Legal" Folder- descriptionstring
The description of the permission.
Example:Permission for "Legal" Folder The resource the permission applies to.
Example:projectThe resource ID the permission applies to.
Example:c7ja4siy- ownerOrganizationIdstring
The organization ID the permission applies to. Used for wildcard permissions where the resourceId is
*.Example:or0Bc1hcJ - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"filter":"*[_type == \"legal\"]"}
Get a permission
/v2025-07-11/access/{resourceType}/{resourceId}/permissions/{permissionName}Gets a permission for a resource by name. Requires permission
sanity.{resourceType}.roles.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe name of the permission. This is a unique identifier for the permission.
Example:sanity.project.members.read
Responses
The permission resource for the resource
The resource for the permission.
Example:sanity.document.filter.modeThe actions allowed by the permission for this role.
Example:["mode"]Show child attributes
- namestring
- titlestringExample:
Sanity Document Filter - descriptionstringExample:
Defines a permission resource for a filtered collection of Sanity documents
items
The name of the permission. This is the unique identifier for the resource.
Example:legal-documentsThe human-readable title of the permission.
Example:Permission for "Legal" Folder- descriptionstring
The description of the permission.
Example:Permission for "Legal" Folder The resource the permission applies to.
Example:projectThe resource ID the permission applies to.
Example:c7ja4siy- ownerOrganizationIdstring
The organization ID the permission applies to. Used for wildcard permissions where the resourceId is
*.Example:or0Bc1hcJ - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"filter":"*[_type == \"legal\"]"}
Update a permission
/v2025-07-11/access/{resourceType}/{resourceId}/permissions/{permissionName}Updates a permission for a resource. Requires permission
sanity.{resourceType}.roles.updateRequires feature:advancedRolesManagement
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe name of the permission. This is a unique identifier for the permission.
Example:sanity.project.members.read
Request body application/json
The resource for the permission.
Example:sanity.document.filter.modeThe name of the permission resource. A unique identifier for a permission.
Example:legal-documentsA human-readable title of the permission resource. This is used for display purposes.
Example:Permission for "Legal" FolderThe description of the permission resource.
Example:Permission for "Legal" Folder- configobject
Some permissions allow for additional configuration when used with document permissions. Accepts a groq filter or a dataset name.
Example{"filter":"*[_type == 'legal']"}
Responses
Permission resource updated successfully
The resource for the permission.
Example:sanity.document.filter.modeThe actions allowed by the permission for this role.
Example:["mode"]Show child attributes
- namestring
- titlestringExample:
Sanity Document Filter - descriptionstringExample:
Defines a permission resource for a filtered collection of Sanity documents
items
The name of the permission. This is the unique identifier for the resource.
Example:legal-documentsThe human-readable title of the permission.
Example:Permission for "Legal" Folder- descriptionstring
The description of the permission.
Example:Permission for "Legal" Folder The resource the permission applies to.
Example:projectThe resource ID the permission applies to.
Example:c7ja4siy- ownerOrganizationIdstring
The organization ID the permission applies to. Used for wildcard permissions where the resourceId is
*.Example:or0Bc1hcJ - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"filter":"*[_type == \"legal\"]"}
Delete a permission
/v2025-07-11/access/{resourceType}/{resourceId}/permissions/{permissionName}Deletes a specific permission for a resource. Can only be used with custom permissions. Requires permission
sanity.{resourceType}.roles.deleteRequires feature:advancedRolesManagement
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe name of the permission. This is a unique identifier for the permission.
Example:sanity.project.members.read
Responses
Permission deleted successfully
Get current user permissions.
/v2025-07-11/access/{resourceType}/{resourceId}/user-permissions/meGets current user permissions within scope of a resource. These permissions can be applied to roles and are used to determine user/robot access to resources.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Responses
A paginated list of permissions for all resources the current user has access to
Show child attributes
items
The name of the permission.
Example:sanity-project-members- typestring
The type of the permission.
Example:sanity.project.members - actionrequired
Show child attributes
- stringenum:
"create", "read", "update", "manage", "history", "editHistory"
Resources are entities that can be managed and accessed through the Access API.
Example:project- Example:
project-id - paramsobject
The parameters for the permission. This is a key-value map of the permission's configuration.
Example{"dataset":"development"}
Cursor to get the next page of results,
nullif there are no more results.
Check if current user has specified permissions
/v2025-07-11/access/{resourceType}/{resourceId}/user-permissions/me/checkChecks if the current user has the specified permissions for the given resource. Returns an object mapping each requested permission to a boolean indicating whether the user has that permission.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
An array of permissions to check
items
- itemsstring
Responses
Map of permissions to whether the user has them
- Example
{"sanity.project.members.read":true,"sanity.project.members.invite":false}
Requests
Request access to resources. View requests to access resources.
List all requests for given project/organization.
/v2024-07-01/access/{resourceType}/{resourceId}/requestsPermissions sanity.{resourceType}.members.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- includeChildrenboolean
Whether to include children resources in the response. Only applies to
organizationresources.Example:false
Responses
A list of resource requests
- Example:
request-id - Example:
pending - Example:
project-id - Example:
project - Example:
2024-07-10T12:00:00Z - updatedAtstring (date-time)Example:
2024-07-10T12:00:00Z - updatedByUserIdstringExample:
admin-id - Example:
user-id - notestringExample:
Text describing the reason of the request. - requestedByUserProfileobject
Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
- typestring
The type of request.
Example:access - requestedRolestringExample:
editor
items
Create a new Request
/v2024-07-01/access/{resourceType}/{resourceId}/requestsCreates a new request for the given project/organization. Requires an authenticated user.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Request body application/json
- notestringExample:
Text describing the reason of the request - requestUrlstring
Optional URL to redirect the user to after their request has been accepted. Do not include PII or other confidential information.
Example:https://sanity-studio.mycompany.io/doc/1234567890 - requestedRolestring
Optional role requested by the user. The approver can assign a different role, but this is just a suggestion. If the role does not exist, the request will still be created and no validation on the role will be done.
Example:editor - typestring
The type of request.
Example:access
Responses
Request created successfully
- Example:
request-id - Example:
pending - Example:
project-id - Example:
project - Example:
2024-07-10T12:00:00Z - updatedAtstring (date-time)Example:
2024-07-10T12:00:00Z - updatedByUserIdstringExample:
admin-id - Example:
user-id - notestringExample:
Text describing the reason of the request. - requestedByUserProfileobject
Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
- typestring
The type of request.
Example:access - requestedRolestringExample:
editor
Accept request
/v2024-07-01/access/{resourceType}/{resourceId}/requests/{requestId}/acceptPermissions sanity.{resourceType}.members.invite
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe ID of the request.
Request body application/json
- roleNamesarray
Show child attributes
items
- stringExample:
admin
Responses
Request accepted successfully
- Example:
request-id - Example:
pending - Example:
project-id - Example:
project - Example:
2024-07-10T12:00:00Z - updatedAtstring (date-time)Example:
2024-07-10T12:00:00Z - updatedByUserIdstringExample:
admin-id - Example:
user-id - notestringExample:
Text describing the reason of the request. - requestedByUserProfileobject
Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
- typestring
The type of request.
Example:access - requestedRolestringExample:
editor
Decline request
/v2024-07-01/access/{resourceType}/{resourceId}/requests/{requestId}/declinePermissions sanity.{resourceType}.members.invite
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe ID of the request.
Responses
Request declined successfully
- Example:
request-id - Example:
pending - Example:
project-id - Example:
project - Example:
2024-07-10T12:00:00Z - updatedAtstring (date-time)Example:
2024-07-10T12:00:00Z - updatedByUserIdstringExample:
admin-id - Example:
user-id - notestringExample:
Text describing the reason of the request. - requestedByUserProfileobject
Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
- typestring
The type of request.
Example:access - requestedRolestringExample:
editor
Responses
A list of user Requests
- Example:
request-id - Example:
pending - Example:
project-id - Example:
project - Example:
2024-07-10T12:00:00Z - updatedAtstring (date-time)Example:
2024-07-10T12:00:00Z - updatedByUserIdstringExample:
admin-id - Example:
user-id - notestringExample:
Text describing the reason of the request. - requestedByUserProfileobject
Show child attributes
- familyNamestring
- givenNamestring
- middleNamestring | null
- imageUrlstring (uri)
- tosAcceptedAtstring (date-time)
- updatedAtstring (date-time)
- isCurrentUserboolean
- providerIdstring
- typestring
The type of request.
Example:access - requestedRolestringExample:
editor
items
Invites
Manage and accept invites.
Get current user's invites filtered by status/resource
/v2025-07-11/access/invites/meRetrieves a list of invites for the current user, using the email.
Path parameters
The resource type to scope the access requests to.
Query parameters
- statusarray
Filter invites by status.
items
- itemsstring
- nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Responses
A paginated list of invites
Show child attributes
items
Resources are entities that can be managed and accessed through the Access API.
Example:project- emailstring
The email address of the invitee. Only present if the invite is still pending.
- inviterIdstring
The ID of the user or service that created the invite. Only present if the invite was created by a user.
- inviteeIdstring
The ID of the user that accepted the invite. Only present if the invite has been accepted.
Cursor to get the next page of results,
nullif there are no more results.
Get invites
/v2025-07-11/access/{resourceType}/{resourceId}/invitesRetrieves a list of invites for the specified resource.
Only pending invites are retrieved by default. Use the optional status
parameter to change the filter behavior. You can select multiple
statuses by repeating the parameter.
Children invites
By default, only invites for the specified resource are returned. Use the
optional includeChildren parameter to include invites for children
resources as well. This only applies to organization resources.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.members.read
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Query parameters
- statusarray
Filter invites by status.
items
- itemsstring
- includeChildrenboolean
Whether to include children resources in the response. Only applies to
organizationresources.Example:false - nextCursorstring
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The number of items to return per page.
Responses
A paginated list of invites
Show child attributes
items
Resources are entities that can be managed and accessed through the Access API.
Example:project- emailstring
The email address of the invitee. Only present if the invite is still pending.
- inviterIdstring
The ID of the user or service that created the invite. Only present if the invite was created by a user.
- inviteeIdstring
The ID of the user that accepted the invite. Only present if the invite has been accepted.
Cursor to get the next page of results,
nullif there are no more results.
Create invite
/v2025-07-11/access/{resourceType}/{resourceId}/invitesCreates an invite for the specified resource.
The invitee will receive an email with a link to accept the invite.
Each invitee can only receive one invite per resource and role. Attempting to create an invite using a non-existent role, or a role that cannot be granted to users will result in a Bad Request error.
Unavailable resources
If the underlying resource is unavailable then a Bad Request error will be returned. A common example of an unavailable resource is a project that is blocked or archived.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.members.invite
Additionally, only administrators can invite other administrators.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siy
Responses
Invite created.
Resources are entities that can be managed and accessed through the Access API.
Example:project- emailstring
The email address of the invitee. Only present if the invite is still pending.
- inviterIdstring
The ID of the user or service that created the invite. Only present if the invite was created by a user.
- inviteeIdstring
The ID of the user that accepted the invite. Only present if the invite has been accepted.
Revoke invite
/v2025-07-11/access/{resourceType}/{resourceId}/invites/{inviteId}Revokes an invite.
Attempting to revoke an invite that has already been accepted or revoked will result in a Bad Request error.
Authorization
This endpoint requires an authenticated user session with the following permissions:
sanity.{resourceType}.members.invite
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe invite's unique identifier.
Responses
Invite revoked.
Get invite
/v2025-07-11/access/{resourceType}/{resourceId}/invites/token/{inviteToken}Retrieves an invite using its token.
Authorization
This endpoint does not require authentication.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe public token for the invite. This token is shared with the invitee.
Responses
Invite found.
Resources are entities that can be managed and accessed through the Access API.
Example:project- emailstring
The email address of the invitee. Only present if the invite is still pending.
- inviterIdstring
The ID of the user or service that created the invite. Only present if the invite was created by a user.
- inviteeIdstring
The ID of the user that accepted the invite. Only present if the invite has been accepted.
Accept invite
/v2025-07-11/access/{resourceType}/{resourceId}/invites/token/{inviteToken}/acceptAccepts an invite using its token.
Attempting to accept an invite that is already accepted or revoked will result in a Bad Request error.
Once the invite has been accepted, the user will have access to the resource with the role assigned as part of the invitation.
Access is propagated internally and may take a up to a few minutes to be fully available across all systems.
Unavailable resources
If the underlying resource is unavailable then a Bad Request error will be returned. A common example of an unavailable resource is a project that is blocked or archived.
Member quota
Some resources have a limit on the number of members. If accepting an invite would go over this limit, then a Payment Required error is returned.
Authorization
This endpoint requires an authenticated user session.
Path parameters
The resource type to scope the access requests to.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Example:c7ja4siyThe public token for the invite. This token is shared with the invitee.
Responses
Invite accepted.