Overview
Torii integrates with Sanity and syncs the members of one Sanity organization, including the members of every project the organization owns:
| User Fields | License Types |
|---|---|
| Name, email, photo, role (per organization and per project), last visit and date added. | One license per Sanity project. A user holds a project's license when they have any role other than Viewer in that project. Viewers are free in Sanity and get no license. |
- You can constantly stay updated with application information from our Integrations Page >> Integration Capabilities button >> Integration Capabilities table.
Requirements
To connect this integration, we require the following:
Accounts & Permissions
- A Sanity organization, and permission to create organization API tokens in it (an organization Administrator can).
- API access is available on every Sanity plan, including Free.
- To sync users, the token needs permission to read organization members. To use the actions, the token also needs permission to invite, update and remove members and to read roles.
Required keys
- Organization ID - the ID of your Sanity organization.
- API Token - an organization-level API token.
How to Generate the Required Values
Step 1: Create an organization API token
- Go to sanity.io/manage and select Manage organization for your organization.
- Open the API tab.
- Select Tokens from the side navigation, or scroll down to the Tokens section.
- Select Add API token.
- In the popup, choose the token type and a permission that can read organization members (and manage them, if you plan to use the actions).
- Copy the token. Sanity shows the token value only when it is created.
Step 2: Find your organization ID
- If you use the Sanity CLI, run
npx sanity organizations list. It lists the organizations you are a member of with their IDs. - Copy the ID of the organization you created the token in.
How to Connect the Integration
- Go to the Integrations page in Torii.
- Search for Sanity and click Connect.
- Enter the Organization ID and the API Token.
- Click Connect.
Actions
These actions are in beta.
- Invite Sanity user - sends an invite to join your Sanity organization with the organization role you choose. The user appears in Torii after they accept the invite and the next sync runs.
- Update Sanity organization role - replaces the user's organization role. Project roles are not changed.
- Remove Sanity user - removes the user from the organization and from all of its projects.
Q&A
Q: Why are license names project IDs?
A: Sanity bills seats per project, so Torii creates one license per project. The Sanity members API returns project IDs, not project names.
Q: Can I connect more than one Sanity organization?
A: Yes. Connect the integration once per organization, each with its own Organization ID and token.
For any further questions, please contact Torii Support.