How can we help?

PostHog Integration

Netanel Hugi
Netanel Hugi
  • Updated
Torii SMP
Torii Identity

Overview

Torii integrates with PostHog and syncs:

  • Organization members, including their role (Member, Admin or Owner).
  • Each member's last login date, so you can see who is actively using PostHog.
  • You can constantly stay updated with application information from our Integrations Page >> Integration Capabilities button >> Integration Capabilities table.

Requirements

Accounts & Permissions

  • A PostHog Cloud account (US or EU region). Every PostHog plan, including the free plan, includes API access.
  • The key must be created by a PostHog organization Admin or Owner. Keys created by regular members may return only a partial list of members.

Required keys

To connect this integration, we require the following:

  • Personal API Key - created in PostHog with the access listed below.
  • PostHog Region - US Cloud or EU Cloud.
  • Organization ID (Optional) - leave empty to use the key owner's current organization.

How to Generate the Required Values

Step 1: Create a personal API key

  1. Sign in to PostHog as an organization Admin or Owner.
  2. Go to the Personal API keys section in your account settings: US Cloud or EU Cloud.
  3. Click + Create a personal API key.
  4. Enter a label, for example Torii.
  5. Choose which organizations the key can access: select All access, or select Organizations and pick the organization you're connecting to Torii. PostHog enables Create key only after you choose one.
  6. Choose the scopes for the key. Select only these:
    • organization:read (Organization: Read in PostHog) - lets Torii read your organization details.
    • organization_member:read (Organization member: Read) - lets Torii read the list of organization members.
    • organization_member:write (Organization member: Write, which includes Read) - only if you want to use the Torii actions (invite a user, remove a user, change a user role).
  7. Copy the new key from the top of the list.

Important
PostHog shows the key only once. Copy it immediately, as you will not be able to see it again after refreshing the page.

Alternatively, you can create a key with full access to your account. This works, but grants Torii more access than it needs.

Step 2: Identify your PostHog region

Your PostHog web address Region to select in Torii
us.posthog.com US Cloud (us.posthog.com)
eu.posthog.com EU Cloud (eu.posthog.com)

Step 3: Find your Organization ID (optional)

In PostHog, go to Settings > Organization > General and copy the organization ID. If you leave the field empty, Torii uses the organization that the key owner is currently working in. If the key owner belongs to several organizations, enter the Organization ID to make sure the right one is synced.

How to Connect the Integration

  1. Go to the Integrations page in Torii.
  2. Search for PostHog and click Connect.
  3. Enter the Personal API Key, select your PostHog Region, and optionally enter the Organization ID.
  4. Click Connect.

Actions

The following actions can be used in Torii workflows. They require the organization_member:write scope.

  • Invite user to PostHog - sends an invitation to join your PostHog organization with the Member or Admin role. The user appears in Torii after they accept the invitation and the next sync runs. PostHog doesn't accept email addresses that contain a + sign, so invites to those addresses fail.
  • Remove user from PostHog - removes the user from your PostHog organization.
  • Change user role in PostHog - changes the user's role to Member or Admin.


For any further questions, please contact Torii Support.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request