> ## 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 Harness with API Key – StackOne Hub

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

<Warning>Admin access or an appropriate role is required to create API keys.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Generate a Harness API key</h2>

  <p>Create a personal or service account API key in the Harness platform to authenticate API requests.</p>

  <Steps>
    <Step title="Sign in to Harness">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to your <a href="https://app.harness.io" target="_blank" rel="noopener noreferrer">Harness account</a>.</p>

        <ul>
          <li>Click your profile icon in the bottom-left to go to your <strong>Profile Overview</strong></li>
        </ul>
      </div>
    </Step>

    <Step title="Create a new API key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Under My API Keys, click <strong>+ API Key</strong> to create a new key and give it a descriptive name.</p>
      </div>
    </Step>

    <Step title="Generate a token">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>+ Token</strong> under the API key you just created.</p>

        <ul>
          <li>Copy the token immediately and store it securely for use later.</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Find your account identifier</h2>

  <p>Your account identifier uniquely identifies your Harness account.</p>

  <ul>
    <li>Check your browser address bar when signed in to Harness.</li>
    <li>Format: `app.harness.io/ng/account/{ACCOUNT_ID}/...`</li>
    <li>Example: if your URL is `https://app.harness.io/ng/account/abc123DEF456/home/get-started`, your account identifier is `abc123DEF456`</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 Key</strong></li>
        <li><strong>Account Identifier</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>
