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

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

<Warning>Creating an API key requires administrator access to your Discourse instance. API keys grant access to your Discourse data — store them securely and never share them publicly.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Find your Discourse domain</h2>

  <p>Your Discourse domain is the address of your forum, without the protocol or any path.</p>

  <ul>
    <li>Sign in to your forum and copy the domain from your browser address bar.</li>
    <li>Format: `{your-forum}.discourse.group` for Discourse-hosted sites, or your own domain for a self-hosted instance</li>
    <li>Example: if your address bar shows `https://community.example.com/latest`, your domain is `community.example.com`</li>
    <li>Do not include the protocol prefix or a trailing slash.</li>
    <li>On Discourse-hosted sites you can also confirm it under <strong>Admin</strong> > <strong>Manage account</strong>, in the <strong>Site Domain</strong> panel.</li>
    <li>Enter this value in the <strong>Domain</strong> field in StackOne Hub.</li>
  </ul>

  <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-site-domain.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=e7b7336c3af066da188dc78c642d19f9" alt="The Manage account page with the Site Domain panel highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-site-domain.png" />
</section>

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

  <p>API keys are created from the admin area of your Discourse instance and are shown only once.</p>

  <Steps>
    <Step title="Sign in to Discourse">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to your Discourse instance in a browser as a user with administrator access.</p>

        <ul>
          <li>Discourse-hosted sites: `https://{your-forum}.discourse.group/login`</li>
          <li>Self-hosted sites: `https://{your-domain}/login` — for example `https://community.example.com/login`</li>
          <li>Enter your <strong>Email / Username</strong> and <strong>Password</strong>, then click <strong>Log In</strong>.</li>
        </ul>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-sign-in.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=919a8400e9f607366e423bc125e20d3a" alt="The Discourse login page with the Email / Username field, Password field, and Log In button highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-sign-in.png" />
      </div>
    </Step>

    <Step title="Open the admin area">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the sidebar, click <strong>Admin</strong>.</p>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-open-admin.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=0f434c733088769d9bf99765c6fc3041" alt="The Discourse forum sidebar with the Admin link highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-open-admin.png" />
      </div>
    </Step>

    <Step title="Open the API keys page">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the admin sidebar, expand <strong>Advanced</strong> and select <strong>API keys</strong>.</p>

        <ul>
          <li>You can also go directly to `/admin/api/keys` on your instance.</li>
        </ul>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-api-keys-nav.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=35c4152aa2afcbad053d14ce7bf4e6ae" alt="The admin sidebar with the Advanced section expanded and API keys highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-api-keys-nav.png" />
      </div>
    </Step>

    <Step title="Add a new key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>On the <strong>API keys</strong> page, click <strong>Add API key</strong>.</p>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-add-api-key.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=ce216149d493077f04867ac065e6bbd5" alt="The API keys page with the Add API key button highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-add-api-key.png" />
      </div>
    </Step>

    <Step title="Configure and save the key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Enter a <strong>Description</strong> that identifies the integration, then click <strong>Save</strong>.</p>

        <ul>
          <li>Description: `StackOne Integration`</li>
          <li>Leave <strong>User level</strong> set to <strong>All users</strong> and <strong>Scope</strong> set to <strong>Global</strong> — these are the defaults and no change is needed.</li>
        </ul>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-key-form.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=0ef5034015be4482ec6eb27536ed4c8f" alt="The new API key form with the Description field, User level and Scope menus, and the Save button highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-key-form.png" />
      </div>
    </Step>

    <Step title="Copy the key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>Copy</strong> to copy the generated key, then click <strong>Continue</strong>.</p>

        <ul>
          <li>The key is only displayed once and cannot be retrieved later.</li>
          <li>Paste it into the <strong>API Key</strong> field in StackOne Hub, and store it securely for use later.</li>
        </ul>

        <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-copy-key.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=7c46cfc8a971b14b495fd3ee51371aa1" alt="The generated API key screen with the key value hidden and the Copy button highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-copy-key.png" />
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Find your API username</h2>

  <p>The API username is the Discourse user that requests are made on behalf of. The user must have permission for the actions you intend to perform, so an administrator account is recommended.</p>

  <ul>
    <li>Your username is shown in the welcome message on your forum home page, for example `Welcome back, jane_admin!`</li>
    <li>You can also use `system` for system-level administrator access.</li>
    <li>Enter this value in the <strong>API Username</strong> field in StackOne Hub.</li>
  </ul>

  <img src="https://mintcdn.com/stackone-60/i78NTJWe1bNnAdVA/connectors/discourse/images/custom-config-api-username.png?fit=max&auto=format&n=i78NTJWe1bNnAdVA&q=85&s=7866a767a1d266c554fa1c50157178b3" alt="The Discourse forum home page with the welcome message showing the signed-in username highlighted" width="1470" height="721" data-path="connectors/discourse/images/custom-config-api-username.png" />
</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="/connect/managing-connectors/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>Domain</strong></li>
        <li><strong>API Key</strong></li>
        <li><strong>API Username</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="/gateway/concepts/linked-accounts">Accounts</a> page.</p>
</div>

## Next Steps

<Columns cols={2}>
  <Card title="Webhooks setup" href="/connectors/discourse/guides/webhook-setup">
    <p className="connector-page-auth-description connector-page-card-text">
      Configure receiving Events for Discourse into StackOne.
    </p>
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.