Sanity logo

Integrate Sanity with your AI CRM

Sanity is a headless CMS platform that provides structured content storage and APIs for modern applications

Explore Triggers and Actions

Add Default Role to Users

Apply 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.

ActionTry it

Create Attribute Definition

Create a user attribute definition for a Sanity resource with a unique key and a string, number, or boolean type.

ActionTry it

Create Prompt Post

Send a one-shot prompt to the Sanity Content Agent without maintaining conversation context. HTTP errors are returned in the response's raw_response field.

ActionTry it

Delete Document

Delete a document from Sanity by ID or query. This action is irreversible when purge is true — the document cannot be recovered once permanently deleted. Use when you need to remove a specific document by ID or bulk delete documents matching a GROQ query (limited to 10,000 documents per operation). For large deletions, paginate by document ID. Set dry_run to true to test the operation without modifying data.

ActionTry it

Delete User Attribute Definition

Delete 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.

ActionTry it

Delete User Attributes

Delete specified custom attributes from a Sanity user within an organization. A 404 or empty response produces an empty attribute list, which does not establish the user's remaining attributes.

ActionTry it

Get Document by ID

Fetch a document by ID from a Sanity dataset in the project configured on the connection. The response may instead report that the document was omitted.

ActionTry it

Get Invite By Token

Retrieve an invite by its public token for a specified resource. Returns invite details when found; an HTTP 404 is returned as found=false.

ActionTry it

Get Organization Role

Retrieve 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.

ActionTry it

Get Permission

Get 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.

ActionTry it

Get Project

Retrieve details for the Sanity project configured on the connection by its ID, including available project information such as display name, organization, studio host, and timestamps.

ActionTry it

Get Robots

Tool 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.

ActionTry it

Get Role

Retrieve 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.

ActionTry it

List Datasets

List datasets in the Sanity project configured on the connection, optionally including statistics or filtering by profile or add-on parent.

ActionTry it

List Organization Roles

List 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.

ActionTry it

List Resource Users

List 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.

ActionTry it

List User Attributes

Tool 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.

ActionTry it

Mutate Documents

Apply or dry-run one atomic batch of create, replace, conditional-create, patch, and delete mutations in a Sanity dataset. Calls commit unless dry_run is true; a delete with purge permanently removes document history.

ActionTry it

Query All Screening

Execute a GROQ query against a Sanity dataset, defaulting to screening documents. Supports optional query parameters; requests are sent without authentication headers.

ActionTry it

Query Documents

Execute a GROQ query against a Sanity dataset in the project configured on the connection. Supports optional parameters, perspective control, and CDN use; results can be any JSON value, including arrays, objects, scalars, or null.

ActionTry it

Update Organization ACL

Tool to assign a role to a member in a Sanity organization. Use when adding or modifying user roles within an organization.

ActionTry it

Update User Attributes Values

Update 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.

ActionTry it

Upload Image Asset

Upload raw image bytes to a dataset in the connected Sanity project.

ActionTry it

Validate Credential

Validate Sanity API credentials by fetching the authenticated user's information. Use this action when you need to verify that an API token is valid and has proper authentication. This action returns user information and accessible projects if the token is valid.

ActionTry it

How the Sanity integration works

The Sanity integration connects your Dench AI CRM directly to Sanity, so agents can read and act on your Sanity data as part of everyday work — answering questions in chat, keeping your CRM in sync, and running automations without anyone copying data between tools.

24 actions are available for agents to invoke on your behalf. Every call runs through Sanity's own authorization, scoped to the account you connect.

Set up Sanity in Dench

  1. 1

    Sign in to your Dench workspace and open Integrations.

  2. 2

    Find Sanity and click Connect — you'll authorize access through Sanity's own sign-in flow. No API keys or code required.

  3. 3

    Ask an agent to use Sanity in chat, or call it from an automation.

  4. 4

    Manage or disconnect the connection any time from workspace settings.

Frequently asked questions

How does the Sanity integration work with Dench?

The Dench Sanity integration connects your AI CRM to Sanity, so AI agents can work with your Sanity data as part of chats, automations, and CRM workflows. You connect your account once, and every agent in your workspace can use it — governed by your workspace permissions.

What actions can AI agents perform with Sanity via Dench?

The Sanity integration currently exposes 24 actions, including Add Default Role to Users, Create Attribute Definition, Create Prompt Post, Delete Document, Delete User Attribute Definition, and Delete User Attributes. Agents invoke them on your behalf from chat or from automations.

Do I need to write code to connect Sanity to Dench?

No. You connect Sanity from your Dench workspace using Sanity's own sign-in and authorization flow — no API keys to copy, no glue code to maintain.

Is the Sanity integration secure?

Connections are authorized through Sanity's own authentication flow, and Dench stores only the authorization needed to act on your behalf. You can review and disconnect the Sanity connection from your workspace settings at any time.

Sanity | Dench AI CRM