Sanity connects to a Nagent workspace with an API key. Once it is connected, agents can call 16 Sanity actions, such as "Add Default Role to Users", "Create Attribute Definition" and "Create Prompt Post". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Sanity, with input parameters and output schema.
SANITY_ADD_DEFAULT_ROLE_TO_USERSApply organization default role to all users. Use when you need to assign the organization's default role to all existing users in the organization. Requires the resource ID of the organization.
Input parameters
The resource ID to scope the access request to. Must be a valid ID for the resource type.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_CREATE_ATTR_DEFINITIONTool to create a new user attribute definition in Sanity. Use when you need to define a custom attribute (like 'customer-tier' or 'subscription-level') that can be attached to resources. The key must be unique within the resource. The attribute can have a type of 'string', 'number', or 'boolean' and can optionally be a list of values or read-only.
Input parameters
The unique key/name for the attribute definition. This must be unique within the resource.
When true, the attribute accepts an array of values. When false or omitted, it accepts a single value.
The data type of the attribute. Must be one of: 'string', 'number', 'boolean'.
When true, the attribute value cannot be modified after creation. Defaults to false.
An optional description explaining what this attribute is used for.
The unique identifier of the specific resource (e.g., organization ID, project ID).
The type of resource the attribute definition belongs to. Examples: 'organizations', 'projects', 'datasets'.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_CREATE_PROMPT_POSTSend a one-shot prompt to the Sanity Content Agent. Stateless one-shot prompt endpoint. No thread management or message persistence. Ideal for simple, single-turn interactions. Use when you need to send a single prompt and receive a response without maintaining conversation context.
Input parameters
Agent configuration. Controls behavior, capabilities, and document access.
Controls how directives in the response are formatted.
The prompt message to send to the agent
Custom instructions for the agent
Your Sanity organization ID
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_DELETE_ATTR_DEFINITIONDelete a user attribute definition. Use when you need to remove a custom attribute definition from an organization or project in Sanity. The attribute definition controls how user attributes are structured and validated for a given resource. Deleting a definition does not delete existing user attribute values, but users will no longer be able to set values for that attribute.
Input parameters
The unique identifier of the resource. For organizations, this is typically like 'oN7sjLEfL'. For projects, this is the project ID.
The unique identifier of the attribute definition to delete.
The type of resource to scope the user attribute definitions to. Common values: 'organization' or 'project'.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_DELETE_USER_ATTRIBUTESDelete custom attributes from a Sanity user within an organization. Use this tool when you need to remove specific custom attributes from a user account. The action deletes the attributes specified in the request and returns the updated attribute list for the user. Example use case: Removing outdated metadata like 'location' or 'year_started' from a user profile.
Input parameters
List of attribute keys to delete from the user
Unique identifier of the Sanity user
Unique identifier of the organization
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_INVITE_BY_TOKENRetrieve an invite by its public token. Use this action when you need to fetch details about an invite using the invite token that was shared with the invitee. Returns invite information including status, role, and inviter details.
Input parameters
The resource ID to scope the access request to. Must be a valid ID for the resource type.
The public token for the invite. This token is shared with the invitee.
The resource type to scope the access requests to. Must be one of: organization, project, media-library, canvas, dashboard, view.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_ORG_ROLERetrieve a specific organization role by its ID. Use this action when you need to fetch details about an organization role including its permissions, title, description, and whether it applies to users or robots. The role must exist for the specified organization.
Input parameters
The unique identifier of the role to retrieve
The unique identifier of the organization
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_PERMISSIONGet a permission for a specific resource. Use when you need to retrieve details about a particular permission including its actions, parameters, and scope. The action retrieves permission information based on the resource type, resource ID, and permission name provided in the path parameters.
Input parameters
The resource ID to scope the access request to. Must be a valid ID for the resource type.
The resource to scope access requests to. Must be one of: 'organization' or 'project'.
The name of the permission. This is a unique identifier for the permission.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_ROBOTSTool to get robots with access to a resource. Use when you need to retrieve a list of robots (service accounts) that have been granted access to a specific resource along with their assigned roles. This action supports pagination through the next_cursor parameter.
Input parameters
The number of items to return per page. Defaults to 100.
The cursor for pagination. Use the nextCursor from the previous response to get the next page.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
The resource type to scope the access requests to. One of: organization, project, media-library, canvas, dashboard, view.
Whether to include children resources in the response. Only applies to organization resources.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_ROLERetrieve a specific role for a given resource type and resource ID. Use this action when you need to fetch details about a role including its permissions, title, description, and whether it applies to users or robots. The role must exist for the specified resource.
Input parameters
The name of the role to retrieve.
The resource ID to scope the access request to. Must be a valid ID for the resource type.
The resource type to scope the access requests to. Must be one of: organization, project, media-library, canvas, dashboard, view.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_GET_USERSList all users of a resource and their assigned roles. Use when you need to retrieve user information and role assignments for a specific project or organization. Supports pagination via cursor.
Input parameters
Number of items to return per page. Defaults to 100. Maximum value is 100.
Cursor for pagination. Use the nextCursor from the previous response to get the next page of results.
The resource ID to scope the access request to. Must be a valid ID for the resource type (e.g., project ID or organization ID).
The resource to scope access requests to. Use 'organization' for organization-level access or 'project' for project-level access.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_LIST_ORG_ROLESList all roles available for an organization. Use this action to retrieve all available roles that can be assigned to users within a specific Sanity organization. The organization_id is required to identify which organization's roles to list.
Input parameters
The unique identifier of the organization
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_LIST_USER_ATTRIBUTESTool to retrieve user attributes from a Sanity organization. Use when you need to get the attributes (such as roles, permissions, or custom properties) associated with a specific user in a Sanity organization. Supports pagination via the cursor parameter.
Input parameters
Maximum number of attributes to return
The last attribute key from the previous page (used for pagination)
Unique identifier of the Sanity user
Unique identifier of the organization
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_QUERY_ALL_SCREENINGExecute a GROQ query to fetch all screening documents from Sanity. Uses the Sanity HTTP query API endpoint. Default query retrieves all documents of type 'screening'. Supports optional query parameters for dynamic queries.
Input parameters
GROQ query string to execute. Defaults to querying all documents of type 'screening'.
Optional parameters to pass to the GROQ query. Use $variableName syntax in query.
The Sanity dataset to query. Defaults to 'production'.
If true, returns query execution plan details.
If true, includes source map information in the response.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_UPDATE_ORG_ACLTool to assign a role to a member in a Sanity organization. Use when adding or modifying user roles within an organization.
Input parameters
The role name to assign (e.g., 'administrator', 'member')
The Sanity user ID to assign the role to
The ID of the organization
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
SANITY_UPDATE_USER_ATTRIBUTES_VALUESUpdate user attribute values for a resource. Use this action to set or update custom attributes for a user within an organization or project. When setting a value for an attribute key that also exists in SAML, the Sanity value will take precedence and shadow the SAML value.
Input parameters
The unique identifier of the user whose attributes to update.
A dictionary of attribute key-value pairs to set for the user. Values can be strings, numbers, booleans, arrays, or nested objects. These will shadow any SAML values for the same keys.
The unique identifier of the resource. For organizations, this is the organization ID.
The type of resource that scopes the user attributes (e.g., 'organization' or 'project').
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 16 Sanity actions on Nagent, including "Add Default Role to Users", "Create Attribute Definition" and "Create Prompt Post". Add Default Role to Users: Apply organization default role to all users. Each action is listed on this page with its input parameters and its output.
Sanity connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Add Default Role to Users takes 1 required input: resource_id. It returns data, error and successful.