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

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

<Warning>Admin or Owner access to your Mailgun account is required to manage API keys.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Generate a New API Key</h2>

  <p>Create a new Mailgun API Key from the Mailgun Control Panel to authenticate API requests.</p>

  <Steps>
    <Step title="Log in to Mailgun">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to your <a href="https://app.mailgun.com" target="_blank" rel="noopener noreferrer">Mailgun Control Panel</a>.</p>
      </div>
    </Step>

    <Step title="Navigate to API Security">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click your account name in the top-right corner, then select <strong>API Security</strong> from the dropdown menu.</p>
      </div>
    </Step>

    <Step title="Create a New API Key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the <strong>Mailgun API keys</strong> section, click the <strong>Create key</strong> button on the right side to open the key creation dialog.</p>

        <ul>
          <li>Enter a description to identify the key's purpose (e.g., StackOne Integration).</li>
          <li>Click <strong>Create key</strong> to generate the new API key.</li>
        </ul>
      </div>
    </Step>

    <Step title="Copy Your API Key">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Once generated, copy the new API key immediately and store it securely.</p>

        <ul>
          <li>Private API Key format: `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx`</li>
          <li>Click <strong>Copy to clipboard</strong> to copy the key.</li>
          <li><strong>Important:</strong> This API key is displayed only once. If you lose it, you'll need to delete the key and generate a new one.</li>
          <li>Keep your Private API Key secure — it grants full access to your Mailgun account.</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>Private API Key</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>
