> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sanity

> How to set up the Sanity connector, plus the actions and events that are available.

![Sanity](https://stackone-logos.com/api/sanity/filled/svg)

v1.2.0[See changelog](https://docs.stackone.com/connectors/sanity/changelog.md)

[33 actions](#actions) · [3 events](#events) · 2 auth methods

CMS
IAM

## Getting Started

**1. Create or Select a Project**

Set up a new project or select an existing one. See [Organizations & Projects](https://docs.stackone.com/gateway/concepts/organizations-and-projects.md).

**2. Configure the Connector**

Enable the connector and create a Connector Profile in your project. See [Setup Connector Profile](https://docs.stackone.com/gateway/quickstart.md#setup-connector-profile).

> [card] [API Token · Connector Profile](https://docs.stackone.com/connectors/sanity/guides/connector-profile/api-token.md)
>
> Connect with a Sanity project robot token (project > API > Tokens) with the Editor, Access Manager, and Blueprints Deplo...

> [card] [OAuth 2.0 · Connector Profile](https://docs.stackone.com/connectors/sanity/guides/connector-profile/oauth-2-0.md)
>
> Recommended for multi-user apps acting on behalf of Sanity users. Requires OAuth client credentials that Sanity provisio...

Optionally, configure receiving Events for Sanity into StackOne.

> [card] [Webhooks setup](https://docs.stackone.com/connectors/sanity/guides/webhook-setup.md)

**3. Link an Account**

Link an account [from the dashboard](https://docs.stackone.com/connect/managing-connectors/linking-accounts.md#link-from-the-dashboard) (or via [StackOne Hub](https://docs.stackone.com/embed/account-linking/overview)).

See the guide for the authentication type chosen in the Connector Profile:

> [card] [API Token · Link Account](https://docs.stackone.com/connectors/sanity/guides/link-account/api-token.md)

> [card] [OAuth 2.0 · Link Account](https://docs.stackone.com/connectors/sanity/guides/link-account/oauth-2-0.md)

**4. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).

## Actions

Authentication type

Select all
|
Clear

API Token

OAuth 2.0

No auth methods found

33 actions

ActionDescription

Query Documents`sanity_query_documents`

Query documents with GROQ

Get Document`sanity_get_document`

Get a document by ID

Mutate Documents`sanity_mutate_documents`

Create, update, patch or delete documents

Export Dataset`sanity_export_dataset`

Export all documents in a dataset

Get Document History`sanity_get_document_history`

Get the revision history of a document

Upload Image Asset`sanity_upload_image_asset`

Upload an image asset

Upload File Asset`sanity_upload_file_asset`

Upload a file asset

Link Media Library Asset`sanity_link_media_library_asset`

Link a Media Library asset into a dataset

List Projects`sanity_list_projects`

List projects

Get Project`sanity_get_project`

Get a project by ID

List Datasets`sanity_list_datasets`

List datasets

Create Dataset`sanity_create_dataset`

Create a dataset

Update Dataset`sanity_update_dataset`

Update a dataset

Delete Dataset`sanity_delete_dataset`

Delete a dataset

Copy Dataset`sanity_copy_dataset`

Copy a dataset

List Dataset Copy Jobs`sanity_list_dataset_copy_jobs`

List dataset copy jobs

List Dataset Tags`sanity_list_dataset_tags`

List tags assigned to a dataset

Create Tag`sanity_create_tag`

Create a project tag

Update Tag`sanity_update_tag`

Update a project tag

Delete Tag`sanity_delete_tag`

Delete a project tag

Assign Tag To Dataset`sanity_assign_tag_to_dataset`

Assign a tag to a dataset

Remove Tag From Dataset`sanity_remove_tag_from_dataset`

Remove a tag from a dataset

List Access Users`sanity_list_access_users`

List users and their roles

Get Access User`sanity_get_access_user`

Get a user and their roles

Replace User Roles`sanity_replace_user_roles`

Replace the set of roles assigned to a user

List Permissions`sanity_list_access_permissions`

List available permissions

Get Permission`sanity_get_permission`

Get a permission by name

List Roles`sanity_list_roles`

List assignable roles

Get Role`sanity_get_role`

Get a role by name

List Invites`sanity_list_invites`

List invites for a resource

Create Invite`sanity_create_invite`

Invite a user to a resource

Revoke Invite`sanity_revoke_invite`

Revoke an invite

List Access Requests`sanity_list_access_requests`

List access requests for the project

## Events

Tags

Select all
|
Clear

Documents

Webhooks

No tags found

3 events

EventDescriptionTags

Document Created`sanity_webhook_document_create`

Fired when a new published document is created in a Sanity dataset.

DocumentsWebhooks

Document Updated`sanity_webhook_document_update`

Fired when an existing published document is changed in a Sanity dataset.

DocumentsWebhooks

Document Deleted`sanity_webhook_document_delete`

Fired when a published document is deleted or unpublished in a Sanity dataset.

DocumentsWebhooks


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.