> ## 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.

# Connect Sanity with API Token – StackOne Hub

> Link a Sanity account in the StackOne Hub using API Token. End-user guide to authorize the integration and start using Sanity actions.

<Warning>Keep your token secret — anyone with it has API access at the permission you grant. A token is shown only once at creation; if lost, create a new one. Use a token dedicated to this integration.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Find your Project ID</h2>

  <p>Every call is scoped to your project. After you sign in you land on the organization dashboard, which lists all of your projects.</p>

  <Steps>
    <Step title="Copy your Project ID">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in at <a href="https://www.sanity.io/manage" target="_blank" rel="noopener noreferrer">sanity.io/manage</a>. From the organization dashboard (which lists all your projects), click your project to open it.</p>

        <ul>
          <li>From the organization dashboard at <a href="https://www.sanity.io/manage" target="_blank" rel="noopener noreferrer">sanity.io/manage</a>, click your project to open it</li>
          <li>No projects yet? Click <strong>+ New project</strong> in the project selector dropdown at the top of the page to create one first</li>
          <li>Copy the <strong>Project ID</strong> shown on the project's overview / settings page (e.g. `abc12xyz`)</li>
          <li>Alternatively, read it straight from the browser address bar while inside the project: `sanity.io/organizations/<org>/project/<projectId>/...` — the value after `/project/` is your Project ID</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Create a project API token</h2>

  <p>Tokens are created per project under the API tab.</p>

  <Steps>
    <Step title="Open the project's API > Tokens">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Tokens are created per project.</p>

        <ul>
          <li>In <a href="https://www.sanity.io/manage" target="_blank" rel="noopener noreferrer">sanity.io/manage</a>, select your <strong>project</strong> from the organization dashboard to open it</li>
          <li>Go to the <strong>API</strong> tab, then <strong>Tokens</strong></li>
          <li>Click <strong>Add API token</strong></li>
        </ul>
      </div>
    </Step>

    <Step title="Name the token, set expiration and pick a permission">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>The permission is single-select. To use ALL actions in this connector, choose Developer.</p>

        <ul>
          <li>Enter a <strong>Name</strong> (e.g. `StackOne Integration`) and set <strong>Expiration</strong> (No expiration for a long-lived integration)</li>
          <li><strong>Developer</strong> ← recommended — grants access to <strong>every action</strong> in this connector (read+write all datasets, manage datasets/tags/projects, and access-control reads + invites)</li>
          <li><strong>Editor</strong> — content + assets only (cannot create datasets) — least-privilege for content authoring</li>
          <li><strong>Viewer</strong> — read-only actions only</li>
          <li>Click <strong>Save</strong></li>
        </ul>
      </div>
    </Step>

    <Step title="Copy the token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>The token is shown only once.</p>

        <ul>
          <li>Copy the token (starts with `sk`) from the dialog</li>
          <li><strong>Important:</strong> this is your only chance to copy it — store it securely</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Which permission to select (by resource / operation)</h2>

  <p><strong>Developer</strong> is sufficient for every action in this connector. Pick a lower<br />permission only if you want to restrict the connection to fewer actions:</p>

  <ul>
    <li><strong>Developer</strong> — ALL actions: documents (read + mutate), assets, datasets (incl. create/delete), tags, projects, invites, and access-control reads (users/roles/permissions/requests)</li>
    <li><strong>Editor</strong> — content + assets read/write, but cannot create datasets or manage tags/projects</li>
    <li><strong>Viewer</strong> — read-only: query/get documents, export, list datasets/projects/tags/roles/users, etc.</li>
    <li>Note: a few actions are marked `preview` and additionally require a Business/Enterprise plan (tag writes, dataset copy) or a Media Library (link asset) — but no token permission higher than Developer.</li>
  </ul>
</section>

<div data-whitelabel-hide>
  <h2>Linking the Account from the Hub</h2>

  <Steps>
    <Step title="Navigate to the Hub">
      Use one of the three <a href="/guides/accounts-section#linking-accounts">Linking Account Methods</a> to access the Hub.
    </Step>

    <Step title="Fill out the fields">
      Fill out the following fields using details from your provider:

      <ul>
        <li><strong>API Token</strong></li>
        <li><strong>Project ID</strong></li>
      </ul>
    </Step>

    <Step title="Connect">
      <ul>
        <li>Click <strong>Connect</strong></li>
        <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
        <li>Once authorization is successful, you will see a confirmation popup</li>
      </ul>
    </Step>
  </Steps>

  <p>If the account linking is successful, you will see the newly linked account in your <a href="/guides/accounts-section">Accounts</a> page.</p>
</div>
