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

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

> [!WARNING]
>
> The key must belong to an instance owner or admin. The Admin role is available on n8n Cloud Pro and Enterprise and on self-hosted Enterprise; on other plans the owner creates the key. n8n says "The n8n API isn't available during the free trial."

## Find your Instance URL

The **Instance URL** is the web address of your n8n: the host name, plus the port and base path if your address has them.

<ul>
  <li>Open n8n in your browser and copy the address from the address bar.</li>
  <li>Delete everything after the host name, port and base path, such as `/home/workflows` or `/projects/abc123/workflows`.</li>
  <li>Format on n8n Cloud: `https://{subdomain}.app.n8n.cloud`</li>
  <li>Format when self-hosted: `https://{host}`, with `:{port}` and `/{base path}` if your address has them</li>
  <li>Example: `https://acme.app.n8n.cloud`</li>
  <li>Example with a base path: `https://example.com/n8n`</li>
  <li>Your n8n must answer over HTTPS and be reachable from the internet, with no sign-in page in front of it. A self-hosted n8n that only answers over plain HTTP cannot connect.</li>
  <li>Paste it into the **Instance URL** field in StackOne Hub.</li>
</ul>

## Create the API key

An n8n API key can only use the scopes you give it, and only those the creating user's role allows.

**1. Sign in to n8n**

Sign in to your n8n instance as an owner or, where your plan has the role, an admin.

<ul>
  <li>Navigate to **Settings** > **n8n API**, or open your Instance URL with `/settings/api` added, for example `https://acme.app.n8n.cloud/settings/api`.</li>
</ul>

**2. Create the key**

Select **Create API key**.

<ul>
  <li>**Label**: `StackOne Integration`</li>
  <li>Choose an **Expiration**: **7 days**, **30 days** (the default), **60 days**, **90 days**, **Custom** or **Never**. When the key expires, the connection stops working until you paste a new key into StackOne Hub.</li>
</ul>

**3. Choose the scopes**

Under **Scopes**, select **Custom**, then tick only the scopes below. n8n preselects **All**, and **Read only** also grants read access to workflows, credentials and executions.

<ul>
  <li>`user:list` and `user:read` read the users, their global roles and the members of each team project.</li>
  <li>`project:list` reads team projects. Without it, project roles and groups cannot be read and calls that expand them fail.</li>
  <li>`role:list` and `role:read` read the role definitions. They appear on n8n 2.36.0 or later, where the connection test calls the role list and refuses a key without `role:list`.</li>
  <li>On n8n releases before 2.14.0, only Enterprise plans show **Scopes**, and keys on other plans have full access.</li>
</ul>

**4. Copy the key**

Select **Save**, then copy the key n8n shows and store it securely for use later.

<ul>
  <li>The key is only shown once and cannot be retrieved later. n8n says "Make sure to copy your API key now as you will not be able to see this again."</li>
  <li>Paste it into the **API Key** field in StackOne Hub.</li>
</ul>

## Know what a smaller role breaks

On n8n 2.36.0 or later, a key from a user with the Member role is refused at connection, because n8n only lets owners and admins read roles and projects. The error names the owner or admin requirement. On earlier releases the key connects, but reading a single user and any project read fail.

<ul>
  <li>On a license without projects, users still load with their global roles, but their project roles and groups are empty, and listing groups is refused with n8n's license message.</li>
  <li>On a license with a user cap, n8n refuses the users list with its own message.</li>
</ul>

## Revoke the key

To stop StackOne from reading your n8n, revoke the key.

<ul>
  <li>Navigate to **Settings** > **n8n API**.</li>
  <li>Open the actions menu on the key's row and select **Revoke**.</li>
  <li>Confirm with **Revoke**.</li>
  <li>On n8n releases before 2.26.0, select **Delete** next to the key and confirm with **Delete Forever**.</li>
</ul>

## Linking the Account from the Hub

**1. Navigate to the Hub**

Use one of the three [Linking Account Methods](https://docs.stackone.com/connect/managing-connectors/linking-accounts.md) to access the Hub.

**2. Fill out the fields**

Fill out the following fields using details from your provider:

<ul>
  <li>**Instance URL**</li>
  <li>**API Key**</li>
</ul>

**3. Connect**

<ul>
  <li>Click **Connect**</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>

If the account linking is successful, you will see the newly linked account on your [Accounts](https://app.stackone.com/accounts) page.


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