# Sanity integration

> Sanity Content Lake HTTP APIs: GROQ queries, document mutations, assets, history, export, plus project, dataset, token, CORS and webhook management.

- Authentication: apiKey

## Tools (204)

- **Accept invite**: Accept an invite by token as the authenticated user.
- **Accept request**: Accept an access request, optionally assigning roles.
- **Add a role to a user**: Add a role to a user in a project.
- **Add a role to a user.**: Add a single role to a user on a resource.
- **Apply organization default role to all users.**: Add the organization's default role to all of its users.
- **Assign a tag to a dataset**: Assign a tag to a dataset.
- **Check if current user has specified permissions**: Check whether the current user or token has the given permissions on a resource.
- **Check invite eligibility**: Preflight check whether the current session passes the invite entry gate.
- **Check whether an application can be embedded**: Check whether an application's host allows framing from a given origin.
- **Copy**: Cloud Clone: copy a dataset to a new dataset and get a job ID (Enterprise).
- **Copy a dataset**: Copy a dataset to a new dataset (Business and Enterprise).
- **Create a CORS entry**: Add a CORS origin to a project.
- **Create a dataset**: Create a new dataset in a project.
- **Create a grant**: Create a grant linked to a permission resource that can be assigned to a role.
- **Create an application**: Create a studio or app in the application registry.
- **Create a new Request**: Request access or a role on a project or organization.
- **Create a new signing key**: Create a Media Library signing key; the private key is returned once.
- **Create a new tag for the project**: Create a dataset tag for a project.
- **Create a new token for the project**: Create a new API token for a project with a role; the secret is returned once.
- **Create a permission.**: Create a custom permission on a resource (requires advancedRolesManagement).
- **Create a permission resource schema**: Create a permission resource schema defining which documents a user can interact with.
- **Create a project**: Create a new Sanity project.
- **Create a role (access-api)**: Create a custom role on a resource (requires the advancedRolesManagement feature).
- **Create a role (roles)**: Create a custom role in a project.
- **Create Attribute Definition**: Create an API-managed user attribute definition for an organization.
- **Create a user application**: Create a user application (studio or core app) for an organization.
- **Create a user application for a project**: Create a user application (studio or core app) in a project.
- **Create a webhook**: Create a document or transaction webhook for a project.
- **Create invite**: Invite someone by email to an organization or project with a role.
- **Create robot and associated token**: Create a robot with role grants and return its secret token once, with an optional expiry.
- **Create/update project role mappings**: Create or update SAML SSO group-to-role mappings for a project (not usable with robot tokens).
- **Decline request**: Decline an access request.
- **Delete a CORS entry**: Delete a CORS origin from a project.
- **Delete a dataset**: Delete a dataset by name.
- **Delete an application**: Soft-delete an application and all its deployments.
- **Delete an environment variable**: Delete an environment variable from a Sanity Function.
- **Delete an installation configuration**: Soft-delete a configuration snapshot of an installation.
- **Delete a permission**: Delete a custom permission of a resource.
- **Delete a project**: Delete a project by ID.
- **Delete a role (access-api)**: Delete a custom role that is not assigned to any user.
- **Delete a role from a user**: Remove a role from a user in a project.
- **Delete a role (roles)**: Delete a custom role in a project.
- **Delete a signing key**: Delete a Media Library signing key.
- **Delete a subtitle**: Delete a video subtitle and its track.
- **Delete a tag by identifier**: Delete a project tag; it must not be assigned to any dataset.
- **Delete a token for the project**: Delete (revoke) a project API token.
- **Delete Attribute Definition**: Delete an unused API-managed attribute definition by key.
- **Delete a user application**: Delete a user application.
- **Delete a user application for a project**: Delete a project's user application.
- **Delete a webhook**: Delete a webhook.
- **Delete logs for a function**: Delete the stored logs of a Sanity Function.
- **Delete project role mappings**: Delete all SAML SSO role mappings for a provider and project.
- **Delete User Attributes**: Delete a user's API-managed attribute values by key.
- **Deploy an application**: Deploy a new version (multipart upload with tarball) to an existing application.
- **Deploy a user application**: Deploy a studio or core app version to a user application (multipart).
- **Deploy a user application for a project**: Deploy a studio or core app version to a project's user application (multipart).
- **Deploy installation configuration**: Push a configuration tarball snapshot to an installed singleton.
- **Dispatch one or more actions**: Execute document, version and release actions (create, edit, publish, unpublish, discard, schedule, archive) in one transaction.
- **Enable or disable backups**: Enable or disable backups for a dataset.
- **Export activity log events as CSV**: Export activity log events matching filters as CSV.
- **Export documents in a dataset**: Stream all non-deleted documents in a dataset as NDJSON, with optional type filter and cursor mode.
- **Generate subtitles using AI**: Start AI subtitle generation for a Media Library video.
- **Get a backup**: Get a backup's file listing with download URLs, paged by cursor.
- **Get access request state**: Preflight check whether the current session can request access to a resource.
- **Get activity log events**: Return management activity log events (invites, role changes, plan changes) matching filters.
- **Get a document revision**: Return a document as it was at a past revision or time.
- **Get all grants for current user**: List the current user's grants in an organization.
- **Get all transactions**: Return NDJSON transactions for all documents in a dataset; use limit.
- **Get all user applications**: List user applications (studios and core apps) for a project or organization.
- **Get all user applications for a project**: List the user applications of a project.
- **Get an application by ID**: Get one application by ID with optional deployment, interface and config includes.
- **Get an installation by ID**: Get one active singleton installation with optional config, access and interfaces.
- **Get a permission**: Get a permission of a resource by name.
- **Get appHost availability**: Check whether a hosted studio hostname is available.
- **Get application by host**: Resolve a user application by host name, optionally with resource links.
- **Get a role (access-api)**: Get a role and its permissions by name (Access API).
- **Get a role (roles)**: Get a role in a project by name.
- **Get a specific signing key**: Get one Media Library signing key by ID.
- **Get a user application**: Get a user application with its active deployment, manifest data and config.
- **Get a user application for a project**: Get a project's user application by ID.
- **Get a user's roles**: Get the role of a user in a project.
- **Get a webhook by ID**: Get a single webhook's configuration by ID.
- **Get current user permissions.**: List the permissions the current user or token has within a resource.
- **Get current user's invites filtered by status/resource**: List the invites addressed to the current user's email.
- **Get dataset ACL**: Get the access control list of a dataset.
- **Get dataset grants**: Get all grants for a dataset.
- **Get embeddings index settings for a dataset**: Get the embeddings index settings for a dataset.
- **Get interfaces by type for an application**: Get an application's interfaces of one type from its active deployment.
- **Get interfaces by type for an installation**: Get a singleton's interfaces of one type via an installation ID.
- **Get invite**: Get an invite by its public token (no authentication required).
- **Get invites**: List the invites of an organization or project; pending only by default.
- **Get My Attributes**: Get the authenticated user's attributes in an organization.
- **Get one or more documents**: Fetch documents by ID, bypassing the caching and indexing layer.
- **Get Permissions.**: List the permissions available within a resource that can be applied to roles.
- **Get project by application**: Resolve the project that owns an application host name.
- **Get resource access for an application**: Get the Sanity resources an application accesses, from its active deployment.
- **Get resource access for an installation**: Get the resource access declarations of an installation.
- **Get robot metadata**: Get a robot's metadata by ID (the token itself cannot be retrieved).
- **Get robots with access to this resource**: List robots (API token identities) with access to an organization or project.
- **Get studio auto-updating version status**: Get a studio's auto-updating version status, based on the X-App-Host header.
- **Get the roles of a single organization member**: Get the roles of one organization member.
- **Get the transactions for a list of documents**: Return NDJSON transactions for the given comma-separated document IDs.
- **Get user and roles.**: Get a single user of a resource with their memberships and roles.
- **Get user application deployments**: List the deployments of a user application.
- **Get user application deployments for a project**: List the deployments of a project's user application.
- **Get User Attributes**: Get a user's attributes in an organization with SAML and Sanity values.
- **Get video playback information**: Get playback URLs, thumbnails, subtitles and renditions for a Media Library video.
- **Get workspaces for an application**: Get a studio application's workspaces from its active deployment.
- **Get workspaces for a user application**: List the workspaces of one user application as a flat list.
- **Get workspaces for studio applications**: List workspaces across studio applications as a flat list with schema descriptor IDs.
- **Give an organization member a role**: Add a role to an organization member.
- **Install a singleton application**: Install a singleton application for an organization with optional resource access.
- **Invoke a function**: Invoke a Sanity Function with an event payload, synchronously or asynchronously.
- **Job status**: Get the status of a job, such as a dataset copy.
- **Link a Media Library asset to a document**: Create a linked Media Library asset document in a dataset so it can be attached to documents.
- **List active features for the project**: List the active features for a project.
- **List all CORS entries**: List all CORS origins for a project.
- **List all datasets available to the project**: List all datasets in a project.
- **List all projects**: List all projects the token's user is a member of.
- **List all request for current user**: List the access requests made by the current user.
- **List all requests for given project/organization.**: List access and role requests for a project or organization.
- **List all roles**: List all roles in a project.
- **List all signing keys**: List the signing keys of a Media Library.
- **List all user grants**: List all grants for users in a project.
- **List all users of a resource and their assigned roles.**: List the users of an organization or project with their roles (Access API).
- **List all webhooks**: List all webhooks configured for a project.
- **List applications for an organization**: List an organization's studios and apps with optional deployment, interface and config includes.
- **List Attribute Definitions**: List an organization's user attribute definitions (SAML and API-managed).
- **List backups**: List the backups of a dataset.
- **List configs for an installation**: List the configuration snapshot history of an installed singleton.
- **List copy jobs history**: List dataset copy job history (Business and Enterprise).
- **List deployments for an application**: List an application's deployment history, newest first.
- **Listen for job updates**: Stream status updates for a job.
- **List environment variable keys**: List the environment variable keys set on a Sanity Function.
- **List functions**: List Sanity Functions for a project or organization scope.
- **List installations for an organization**: List an organization's active singleton app installations.
- **List organization members**: List the members of an organization with their roles.
- **List permission resources**: List the permission resource schemas of a project.
- **List permissions for the project**: List the permissions for a project.
- **List references to an asset**: List documents and datasets that reference a Media Library asset (vX only).
- **List roles assignable to a user on this resource.**: List the roles of an organization or project (Access API).
- **List tags for a dataset**: List the tags assigned to a dataset.
- **List the singleton catalog for an organization**: Report the singleton apps in the catalog with their installation state for an organization.
- **List tokens for the project**: List the API tokens of a project (details only, not the secret).
- **List users with roles**: List all users (and robots) of a project with their roles.
- **List webhook attempts**: List delivery attempts for a webhook.
- **List webhook messages**: List the messages sent by a webhook with their delivery status.
- **Make a schema-aware patch to a document**: Agent Action Patch: patch a document with paths and values validated against the schema, without an LLM.
- **Mutate documents**: Create, update, or delete documents in a dataset in one transaction.
- **Mutate media in the Media Library**: Create, update or delete Media Library documents using Content Lake mutation syntax.
- **Prompt the LLM for a response**: Agent Action Prompt: get a free-form LLM response without modifying documents.
- **Query media in the Media Library**: Run a GROQ query against a Media Library.
- **Query using GET method**: Run a GROQ query against a dataset using a GET request (URL limit 11 KB).
- **Query using POST method**: Run a GROQ query with a POST body, for queries longer than 11 KB.
- **Read a function**: Get one Sanity Function's details.
- **Redirect to video playback URL**: 302 redirect to a video's thumbnail, animated, storyboard or stream URL.
- **Redirect to video rendition URL**: 302 redirect to a downloadable MP4 rendition of a video.
- **Register a user application config**: Register a configuration value (such as live-manifest) for a user application.
- **Register a user application config for a project**: Register a configuration value (such as live-manifest) for a project's user application.
- **Remove a role from an organization member**: Remove a role from an organization member.
- **Remove a role from a user in a resource.**: Remove one role from a user on a resource; the last role cannot be removed.
- **Remove a tag from a dataset**: Remove a tag from a dataset.
- **Remove a user from a resource.**: Remove all roles of a user on a resource, removing them from it.
- **Remove own user from a resource.**: Remove the authenticated user from a resource without needing admin permissions.
- **Replace the role set for a user.**: Replace a user's complete role set on a resource.
- **Retrieve a dataset**: Return the details of a dataset by name (documented as a POST).
- **Retrieve a project**: Get the details of a project by ID.
- **Retrieve a user**: Get user details for a project member; "me" works with user tokens.
- **Retrieve function logs**: Get recent log entries of a Sanity Function (default last 100).
- **Revoke current robot token**: Revoke the robot token used for the request and delete its robot.
- **Revoke invite**: Revoke a pending invite.
- **Revoke robot token and delete robot**: Permanently revoke a robot's token and delete the robot.
- **Rotate current robot token**: Replace the robot token used for the request with a new one, keeping roles and expiry.
- **Search for assets and references**: Search a Media Library for assets and references by term.
- **Send a chat message**: Content Agent: send a message in a persisted conversation thread and stream the reply.
- **Send an instruction to Generate**: Agent Action Generate: have an LLM write content into a document following an instruction and the dataset schema.
- **Send a one-shot prompt**: Content Agent: stateless single-turn prompt with a streamed reply.
- **Stream document mutation events**: Server-sent events stream whenever documents matching a GROQ filter change.
- **Stream function logs**: Stream live logs of a Sanity Function.
- **Stream sync tag invalidation events**: Server-sent events stream of sync tags as they become invalid on published documents.
- **Transform a document**: Agent Action Transform: transform a source document into a new or edited document with an LLM instruction.
- **Translate a document**: Agent Action Translate: translate a source document into another language.
- **Uninstall a singleton application**: Uninstall a singleton application from an organization.
- **Update a dataset**: Update a dataset's ACL mode.
- **Update an application**: Update an application's title, icon, visibility, slug or studio config.
- **Update an environment variable**: Set the value of a Sanity Function environment variable.
- **Update a permission**: Update a custom permission of a resource (requires advancedRolesManagement).
- **Update a project**: Update a project's display name, studio host, color or settings.
- **Update a role (access-api)**: Replace a custom role's definition and permissions (requires advancedRolesManagement).
- **Update a role (roles)**: Update a role's title, description and applicability.
- **Update a tag by identifier**: Update a project tag by identifier.
- **Update a user application**: Update a user application's settings.
- **Update a user application for a project**: Update a project's user application.
- **Update a webhook**: Enable or disable a webhook.
- **Update embeddings index settings for a dataset**: Enable, disable or reconfigure the embeddings index for a dataset.
- **Update robot token**: Update the expiry date of a robot token.
- **Update User Attributes**: Set or update a user's attribute values by key.
- **Upload a file asset**: Upload a file binary to Content Lake and create a linked sanity.fileAsset document.
- **Upload a file asset from a URL**: Have Sanity fetch a file from an HTTPS URL and create a sanity.fileAsset document.
- **Upload an asset to the media library**: Upload an image, video or file to a Media Library (multipart or raw body).
- **Upload an asset to the media library from a URL**: Have Sanity fetch an HTTPS URL and upload it to a Media Library.
- **Upload an image asset**: Upload an image binary to Content Lake and create a linked sanity.imageAsset document.
- **Upload an image asset from a URL**: Have Sanity fetch an image from an HTTPS URL and create a sanity.imageAsset document.
- **Upload a subtitle file**: Upload a VTT or SRT subtitle file for a Media Library video.

Connect Sanity in General Input: https://www.generalinput.com/apps/sanity