> ## 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 SonarQube Cloud with Personal Access Token (Bearer) – StackOne Hub

> Link a SonarQube Cloud account in the StackOne Hub using Personal Access Token (Bearer). End-user guide to authorize the integration and start using SonarQube Cloud actions.

<Warning><strong>Personal Access Tokens auto-expire 60 days from last use</strong> (or from creation if never used) — there is no permanent option. The token is renewed on every use, so an actively-used connector keeps a rolling 60-day window. For long-lived production team automation, SonarQube Cloud recommends <strong>Scoped Organization Tokens</strong> (created by org admins, not tied to a user account) — but those are an upgraded-plan feature. User tokens also inherit ALL permissions of the issuing user; create a dedicated service-account user for restricted scope.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Generate a Personal Access Token</h2>

  <p>Personal Access Tokens are managed from the <strong>Access Tokens</strong> page of your SonarQube Cloud account.</p>

  <Steps>
    <Step title="Sign in to SonarQube Cloud">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to <a href="https://sonarcloud.io" target="_blank" rel="noopener noreferrer">SonarQube Cloud</a> (or <a href="https://sonarqube.us" target="_blank" rel="noopener noreferrer">sonarqube.us</a> for the US region).</p>
      </div>
    </Step>

    <Step title="Open the Access Tokens page">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click your avatar (top-right) → <strong>My account</strong>, then choose <strong>Access Tokens</strong> from the left sidebar.</p>

        <ul>
          <li>Direct URL: [https://sonarcloud.io/account/access-tokens](https://sonarcloud.io/account/access-tokens)</li>
          <li>Make sure the <strong>Personal Tokens</strong> tab is selected (not <strong>Agent Apps</strong>).</li>
        </ul>
      </div>
    </Step>

    <Step title="Generate the token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Under <strong>Generate Tokens</strong>, enter a name and click <strong>Generate Token</strong>.</p>

        <ul>
          <li><strong>Name</strong> — human-readable identifier (e.g. `stackone-connector`)</li>
          <li>Click <strong>Generate Token</strong>.</li>
          <li>Copy the token value immediately — it is only displayed once. Tokens are 40-character hex strings with no prefix (e.g. `0eaecdfe61a6b19cbbdfee4f560e51ab476b01af`).</li>
          <li><strong>Scheduled expiry</strong> is automatic: 60 days from creation, then 60 days from last use. Use the token at least once every 60 days to keep it alive — or rotate.</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Find your Organization Key</h2>

  <p>Almost every Web API endpoint requires your organization key.</p>

  <Steps>
    <Step title="Locate the organization slug">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In SonarQube Cloud, the organization key is the slug in the URL when viewing your workspace.</p>

        <ul>
          <li>Look at the URL: `https://sonarcloud.io/organizations/<slug>` — the segment after `/organizations/` is your organization key.</li>
          <li>Or open <strong>My account → Organizations</strong> and copy the <strong>Key</strong> column for the organization you want to integrate.</li>
        </ul>
      </div>
    </Step>
  </Steps>
</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>Personal Access Token</strong></li>
        <li><strong>Organization Key</strong></li>
        <li><strong>Region</strong> (Optional)</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>
