# Sanity

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

- **Category:** developer tools
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 16
- **Triggers:** 0
- **Slug:** `SANITY`
- **Version:** 00000000_00

## Tools

### Add Default Role to Users

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource_id` | string | Yes | The resource ID to scope the access request to. Must be a valid ID for the resource type. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Attribute Definition

**Slug:** `SANITY_CREATE_ATTR_DEFINITION`

Tool 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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `key` | string | Yes | The unique key/name for the attribute definition. This must be unique within the resource. |
| `list` | boolean | No | When true, the attribute accepts an array of values. When false or omitted, it accepts a single value. |
| `type` | string ("string" | "number" | "boolean") | Yes | The data type of the attribute. Must be one of: 'string', 'number', 'boolean'. |
| `read_only` | boolean | No | When true, the attribute value cannot be modified after creation. Defaults to false. |
| `description` | string | No | An optional description explaining what this attribute is used for. |
| `resource_id` | string | Yes | The unique identifier of the specific resource (e.g., organization ID, project ID). |
| `resource_type` | string | Yes | The type of resource the attribute definition belongs to. Examples: 'organizations', 'projects', 'datasets'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Create Prompt Post

**Slug:** `SANITY_CREATE_PROMPT_POST`

Send 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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `config` | object | No | Agent configuration. Controls behavior, capabilities, and document access. |
| `format` | string ("markdown" | "directives") | No | Controls how directives in the response are formatted. |
| `message` | string | Yes | The prompt message to send to the agent |
| `instructions` | string | No | Custom instructions for the agent |
| `organizationId` | string | Yes | Your Sanity organization ID |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete User Attribute Definition

**Slug:** `SANITY_DELETE_ATTR_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource_id` | string | Yes | The unique identifier of the resource. For organizations, this is typically like 'oN7sjLEfL'. For projects, this is the project ID. |
| `definition_id` | string | Yes | The unique identifier of the attribute definition to delete. |
| `resource_type` | string ("organization" | "project") | Yes | The type of resource to scope the user attribute definitions to. Common values: 'organization' or 'project'. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Delete User Attributes

**Slug:** `SANITY_DELETE_USER_ATTRIBUTES`

Delete 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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `attributes` | array | Yes | List of attribute keys to delete from the user |
| `sanity_user_id` | string | Yes | Unique identifier of the Sanity user |
| `organization_id` | string | Yes | Unique identifier of the organization |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Invite By Token

**Slug:** `SANITY_GET_INVITE_BY_TOKEN`

Retrieve 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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resourceId` | string | Yes | The resource ID to scope the access request to. Must be a valid ID for the resource type. |
| `inviteToken` | string | Yes | The public token for the invite. This token is shared with the invitee. |
| `resourceType` | string ("organization" | "project" | "media-library" | "canvas" | "dashboard" | "view") | Yes | The resource type to scope the access requests to. Must be one of: organization, project, media-library, canvas, dashboard, view. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Organization Role

**Slug:** `SANITY_GET_ORG_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `roleId` | string | Yes | The unique identifier of the role to retrieve |
| `organizationId` | string | Yes | The unique identifier of the organization |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Permission

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `resource_id` | string | Yes | The resource ID to scope the access request to. Must be a valid ID for the resource type. |
| `resource_type` | string | Yes | The resource to scope access requests to. Must be one of: 'organization' or 'project'. |
| `permission_name` | string | Yes | The name of the permission. This is a unique identifier for the permission. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Robots

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | The number of items to return per page. Defaults to 100. |
| `next_cursor` | string | No | The cursor for pagination. Use the nextCursor from the previous response to get the next page. |
| `resource_id` | string | Yes | The resource ID to scope the access request to. Must be a valid ID for the resource type. |
| `resource_type` | string ("organization" | "project" | "media-library" | "canvas" | "dashboard" | "view") | Yes | The resource type to scope the access requests to. One of: organization, project, media-library, canvas, dashboard, view. |
| `include_children` | boolean | No | Whether to include children resources in the response. Only applies to organization resources. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Role

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `roleName` | string | Yes | The name of the role to retrieve. |
| `resourceId` | string | Yes | The resource ID to scope the access request to. Must be a valid ID for the resource type. |
| `resourceType` | string ("organization" | "project" | "media-library" | "canvas" | "dashboard" | "view") | Yes | The resource type to scope the access requests to. Must be one of: organization, project, media-library, canvas, dashboard, view. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Resource Users

**Slug:** `SANITY_GET_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Number of items to return per page. Defaults to 100. Maximum value is 100. |
| `next_cursor` | string | No | Cursor for pagination. Use the nextCursor from the previous response to get the next page of results. |
| `resource_id` | string | Yes | 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). |
| `resource_type` | string ("organization" | "project") | Yes | The resource to scope access requests to. Use 'organization' for organization-level access or 'project' for project-level access. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List Organization Roles

**Slug:** `SANITY_LIST_ORG_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `organization_id` | string | Yes | The unique identifier of the organization |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### List User Attributes

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `limit` | integer | No | Maximum number of attributes to return |
| `cursor` | string | No | The last attribute key from the previous page (used for pagination) |
| `sanity_user_id` | string | Yes | Unique identifier of the Sanity user |
| `organization_id` | string | Yes | Unique identifier of the organization |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Query All Screening

**Slug:** `SANITY_QUERY_ALL_SCREENING`

Execute 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

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `query` | string | No | GROQ query string to execute. Defaults to querying all documents of type 'screening'. |
| `params` | object | No | Optional parameters to pass to the GROQ query. Use $variableName syntax in query. |
| `dataset` | string | No | The Sanity dataset to query. Defaults to 'production'. |
| `explain` | boolean | No | If true, returns query execution plan details. |
| `resultSourceMap` | boolean | No | If true, includes source map information in the response. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update Organization ACL

**Slug:** `SANITY_UPDATE_ORG_ACL`

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

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `role_name` | string | Yes | The role name to assign (e.g., 'administrator', 'member') |
| `sanity_user_id` | string | Yes | The Sanity user ID to assign the role to |
| `organization_id` | string | Yes | The ID of the organization |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Update User Attributes Values

**Slug:** `SANITY_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.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `userId` | string | Yes | The unique identifier of the user whose attributes to update. |
| `attributes` | object | Yes | 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. |
| `resourceId` | string | Yes | The unique identifier of the resource. For organizations, this is the organization ID. |
| `resourceType` | string ("organization" | "project") | Yes | The type of resource that scopes the user attributes (e.g., 'organization' or 'project'). |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
