> ## 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 Terraform with API Token (Multiple Companies) – StackOne Hub

> Link a Terraform account in the StackOne Hub using API Token (Multiple Companies). End-user guide to authorize the integration and start using Terraform actions.

> [!WARNING]
>
> Admin or Owner privileges are required in your Terraform account to generate API tokens.

## Find your Terraform Host

Your **Terraform Host** depends on whether you use Terraform Cloud or Terraform Enterprise.

<ul>
  <li>**Terraform Cloud**: use `https://app.terraform.io`</li>
  <li>**Terraform Enterprise**: use your self-hosted instance URL</li>
  <li>Format: `https://{your-instance}.example.com`</li>
  <li>Example: `https://terraform.yourcompany.com`</li>
  <li>Copy the **Terraform Host** across.</li>
</ul>

## Generate an API Token

Create a user API token to authenticate with the Terraform API.

**1. Create the token**

Sign in to your [HCP Terraform account](https://app.terraform.io) or your Terraform Enterprise instance, click your user icon in the top-right corner, then open **Account settings** > **Tokens**.

<ul>
  <li>Click **Create an API token**.</li>
  <li>**Description**: `StackOne Integration`</li>
  <li>**Expiration**: choose when the token expires (the default is 30 days)</li>
  <li>Click **Generate token**.</li>
</ul>

![The Creating a user token dialog with the Description and Expiration fields and the Generate token button highlighted](https://mintcdn.com/stackone-60/uIHx_QC2fViT21bw/connectors/terraform/images/custom-config-generate-token.png?fit=max\&auto=format\&n=uIHx_QC2fViT21bw\&q=85\&s=5e8822abeeb0f6905cfebb37f843d27b)

**2. Copy the token**

The new token is displayed inline on the **Tokens** page. Copy the **API Token** across.

<ul>
  <li>Click the copy button next to the token.</li>
  <li>HCP Terraform shows the token only once.</li>
</ul>

![The newly created token shown inline on the Tokens page with the copy button and the store-securely warning](https://mintcdn.com/stackone-60/uIHx_QC2fViT21bw/connectors/terraform/images/custom-config-copy-token.png?fit=max\&auto=format\&n=uIHx_QC2fViT21bw\&q=85\&s=745bd8864aa2d30d0de5d04a845235f0)

## Link the Account

**1. 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>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).

## Next Steps

> [card] [Webhooks setup](https://docs.stackone.com/connectors/terraform/guides/webhook-setup.md)
>
> Configure receiving Events for Terraform into StackOne.


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