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

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

> [!WARNING]
>
> Admin access to your PostHog account is required to generate a personal API key.

Select Actions to adjust the guideSome actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.

Select all
Clear

ActionScope(s)

Loading actions...No actions match your search.

Dynamic Guide URL

Copy URL

Scopes Selected

<pre role="textbox" aria-readonly="true" tabIndex="0" />

Separator

Copy scopes

## Identify your data region

Your data region determines the base URL for API requests. You can identify your region from your browser's address bar when logged in to PostHog.

<ul>
  <li>US Region: `https://us.posthog.com/...`</li>
  <li>EU Region: `https://eu.posthog.com/...`</li>
</ul>

## Generate a personal API key

A personal API key authenticates requests to PostHog.

**1. Sign in to PostHog**

Sign in to your PostHog account:

<ul>
  <li>[US Region](https://us.posthog.com/)</li>
  <li>[EU Region](https://eu.posthog.com/)</li>
</ul>

**2. Navigate to Personal API keys**

In PostHog, click **Settings** at the bottom of the left sidebar. Alternatively, if you are directed to the onboarding page, click the **Default project** dropdown in the top-right corner, then click the **gear icon** next to the default project name. On the Settings page, scroll down the left panel and select **Personal API keys** under the **Account** section.

**3. Create a new API key**

On the Personal API keys page, create a new key.

<ul>
  <li>Click **Create personal API key**.</li>
  <li>Enter a descriptive label (e.g., `StackOne Integration`).</li>
</ul>

**4. Organization & project access**

Select either **All access** or **Organizations** to grant the required access level. Do not select **Projects** only, as this will cause the connection to fail.

<ul>
  <li>**All access** (recommended): All organizations and projects your account has access to.</li>
  <li>**Organizations**: Select specific organizations to give access to.</li>
  <li>**Projects**: Not supported — selecting this option alone will result in a connection failure.</li>
</ul>

**5. Select API scopes**

Enables actions: Cancel A Query, Change Organization, Create A Warehouse Saved Query, Create A Warehouse Table, Create A Warehouse View Link, Create Actions, Create An Insight Variable, Create Dashboards, Create Feature Flags, Create Groups Types Metrics, Create Insights, Create Organizations, Create Projects, Create Role, Create Role Membership, Delete A Session Recording, Delete A Warehouse Saved Query, Delete A Warehouse Table, Delete A Warehouse View Link, Delete An Action, Delete An Insight, Delete An Insight Variable, Delete Groups Types, Delete Groups Types Metrics, Delete Members, Delete Organizations, Delete Projects, Delete Role, Delete Role Membership, Delete Users, Get Unified Credentials, Get Unified Organization, Get Unified Role, Get Unified User, List All Actions, List All Activity Log, List All Alerts, List All Dashboards, List All Feature Flags, List All Groups Types, List All Groups Types Metrics, List All Insights, List All Integrations, List All Members, List All Role Memberships, List All Roles, List All Session Recordings, List All Users, List Event Definitions, List Insight Variables, List Projects, List Property Definitions, List Unified Organizations, List Unified Resource Types, List Unified Resource Users, List Unified Roles, List Unified Users, List Warehouse Saved Queries, List Warehouse Tables, List Warehouse View Links, Retrieve A Dashboard, Retrieve A Feature Flag, Retrieve A Project, Retrieve A Property Definition, Retrieve A Query Status, Retrieve A Session Recording, Retrieve A Warehouse Saved Query, Retrieve A Warehouse Table, Retrieve A Warehouse View Link, Retrieve An Action, Retrieve An Event Definition, Retrieve An Insight, Retrieve An Insight Variable, Retrieve An Organization, Retrieve An Organization Project, Retrieve Groups Types Metrics, Retrieve List, Retrieve Organizations, Retrieve Role, Retrieve Role Membership, Retrieve Users, Run A Query, Update A Dashboard, Update A Feature Flag, Update A Session Recording, Update A Warehouse Saved Query, Update A Warehouse Table, Update An Action, Update An Insight, Update An Insight Variable, Update Complete Product Onboarding, Update Groups Types Metrics, Update Groups Types Update Metadata, Update Members, Update Partial Organization, Update Partial Organization Project, Update Role, Update Users

Use the **Select preset** dropdown to choose **All access**, or configure individual scopes based on your use case:

<ul>
  <li>
    organization:read
  </li>

  <li>
    organization:write
  </li>

  <li>
    organization\_member:read
  </li>

  <li>
    organization\_member:write
  </li>

  <li>
    organization\_integration:read
  </li>

  <li>
    project:read
  </li>

  <li>
    project:write
  </li>

  <li>
    action:read
  </li>

  <li>
    action:write
  </li>

  <li>
    alert:read
  </li>

  <li>
    alert:write
  </li>

  <li>
    group:read
  </li>

  <li>
    group:write
  </li>

  <li>
    user:read
  </li>

  <li>
    user:write
  </li>

  <li>
    insight:read
  </li>

  <li>
    insight:write
  </li>

  <li>
    insight\_variable:read
  </li>

  <li>
    insight\_variable:write
  </li>

  <li>
    dashboard:read
  </li>

  <li>
    dashboard:write
  </li>

  <li>
    feature\_flag:read
  </li>

  <li>
    feature\_flag:write
  </li>

  <li>
    session\_recording:read
  </li>

  <li>
    session\_recording:write
  </li>

  <li>
    activity\_log:read
  </li>

  <li>
    hog\_function:read
  </li>

  <li>
    hog\_function:write
  </li>

  <li>
    query:read
  </li>

  <li>
    warehouse\_table:read
  </li>

  <li>
    warehouse\_table:write
  </li>

  <li>
    warehouse\_view:read
  </li>

  <li>
    warehouse\_view:write
  </li>

  <li>
    event\_definition:read
  </li>

  <li>
    property\_definition:read
  </li>
</ul>

**6. Copy the API key**

After creation, copy your new API key and store it securely for use later.

<ul>
  <li>Format: `phx_xxxxxxxxxxxxxxxxxxxxxxxxxxxx`</li>
  <li>Note: The key is shown only once; keep it in a secure location.</li>
</ul>

## Find your project token

The project token is required for event capture actions. This field is optional if you do not need capture functionality.

**1. Locate Project Token**

Navigate to **Settings** > **Project** > **General**.

<ul>
  <li>Copy the **Project Token** value and store it securely for use later.</li>
  <li>Format: `phc_xxxxxxxxxxxxxxxxxxxxxxxxxxxx`</li>
</ul>

## 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/posthog/guides/webhook-setup.md)
>
> Configure receiving Events for PostHog into StackOne.


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