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

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

> [!WARNING]
>
> Sign in as an Admin of your Twingate network. Admin is the only Twingate role that can make changes under **Settings** > **API**, where tokens are generated. The token belongs to that one network.

## Find your Network name

The **Network** is the host name of your Twingate Admin Console. It is your network name, then the region when your address has one, then `twingate.com`.

<ul>
  <li>Sign in to the Admin Console and copy the address from the browser address bar. Delete `https://` and everything after `twingate.com`.</li>
  <li>Format: `{network}.{region}.twingate.com` or `{network}.twingate.com`</li>
  <li>Example: `acme.us1.twingate.com`</li>
  <li>Example without a region: `acme.twingate.com`</li>
  <li>Keep the region, such as `us1`, when your address shows one. Twingate recommends the regional host to avoid redirects.</li>
  <li>If your address has no region, you can also enter the name on its own, such as `acme`.</li>
  <li>Paste it into the **Network** field in StackOne Hub.</li>
</ul>

## Create the API token

A Twingate API token belongs to one network and can do only what its permission level allows.

**1. Sign in to Twingate**

Sign in to your Twingate Admin Console at `https://{network}.twingate.com` as an Admin.

<ul>
  <li>Navigate to **Settings** > **API**.</li>
</ul>

**2. Generate the token**

Click **Generate Token**.

<ul>
  <li>**Label**: `StackOne Integration`</li>
  <li>**Permission Level**: **Read only**</li>
  <li>**Read only** gives read access to everything the API exposes, which covers every action in this connector. **Read & Write** adds creating, updating and deleting, and **Read, Write & Provision** adds generating Connector tokens and creating Service Keys. StackOne does not need either.</li>
  <li>**Allowed Ranges** is optional and defaults to `0.0.0.0/0, ::/0`, which allows any address. To limit the token to StackOne, replace the default with [StackOne's IP addresses](https://docs.stackone.com/gateway/concepts/connector-profiles.md#connection-issues-behind-a-firewall), separated by commas. A token takes up to 10 entries, and a request from any other address fails authentication. StackOne may change these addresses, so check that list if the connection starts failing.</li>
  <li>Click **Generate**.</li>
</ul>

**3. Copy the token**

Copy the token from the window that opens and store it securely for use later.

<ul>
  <li>The token is shown once. Twingate says you will not be able to retrieve it from the Twingate interface once you close the window.</li>
  <li>Paste it into the **API Key** field in StackOne Hub.</li>
</ul>

## Keep the connection working

**Read only** is Twingate's lowest permission level, so there is no smaller grant to choose.

<ul>
  <li>If StackOne is refused with an access error, check that the token is enabled and that its **Allowed Ranges** include [StackOne's IP addresses](https://docs.stackone.com/gateway/concepts/connector-profiles.md#connection-issues-behind-a-firewall).</li>
  <li>Twingate documents no expiry for API tokens, so the connection keeps working until you disable the token or change its allowed ranges.</li>
</ul>

## Disable or replace the token

To stop StackOne from reading your network, disable the token. You can enable it again later.

<ul>
  <li>Navigate to **Settings** > **API**.</li>
  <li>Open the menu at the end of the token's row and disable it.</li>
  <li>To replace the token, generate a new one with the same settings, paste it into the **API Key** field in StackOne Hub, then disable the old one.</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>**Network**</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.