Skip to main content
Sanity says that “to create an organization token, you must have developer or equivalent role in the organization.” A token with an expiry stops working on that date, and Sanity does not let you remove an expiry once it is set, so leave the expiry unset unless your policy requires one.

Find your Organization ID

Sanity’s CLI lists the organizations you belong to, with their IDs.

  • Run npx sanity@latest organizations list.
  • Find your organization in the output.
  • Copy the Organization ID across.

Create the organization token

An organization token belongs to the organization, not to a single project, so one connection covers every project the organization owns. The token must be able to read the organization’s members, invitations and roles.

1

Create the token

Sign in as a member with the Developer role or an equivalent role, then use one of these two routes. StackOne only reads, so add no other grant.

  • Sanity CLI (8.19.0 or later): Run npx sanity@latest tokens create StackOne --organization <Organization ID> --grant access=viewer with your Organization ID in place of <Organization ID>. The token never expires unless you add --expires-at.
  • Sanity Manage: In Sanity Manage, open your organization, select API > Tokens > Add new token, name the token StackOne, grant only the access-management permission at its Viewer level (access=viewer in the CLI), and leave the expiry unset.
2

Copy the token

Sanity shows the token once, right after you create it.

  • Copy the Organization API Token across.

What this connection reads

The connection covers everyone who holds a role in the organization or in a project the organization owns, and pending invitations.

  • Projects owned by a person and never moved into the organization are not included. Move them into the organization in sanity.io/manage to include their members.
  • Robot tokens are not listed as users. Review them in sanity.io/manage under API > Tokens.

Revoke access

To stop StackOne from reading your organization, delete the token.

  • In Sanity Manage, open your organization and select API > Tokens.
  • Delete the StackOne token. Sanity rejects it from then on.
1

Connect

  • Click Connect.
  • If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider’s authorization flow.
  • Once authorization is successful, you will see a confirmation popup.
2

Use Actions

Connect an AI platform to the linked account’s actions. See AI Platforms.Other ways to call actions are listed in Protocols & SDKs.

Next Steps

Webhooks setup

Configure receiving Events for Sanity into StackOne.