Skip to main content

Creating your API key

1

Navigate to PostHog API settings

Go to eu.posthog.com/settings/user-api-keys.
If your project is in the US, change the URL prefix to us.posthog.com.
2

Click Create key

Open the Personal API keys section and select Create personal API key.
PostHog API Keys settings page showing the Create personal API key button

PostHog API Keys settings with Create personal API key button

3

Fill in the form

  • Select Projects
  • Choose the project you want to integrate
Create personal API key form showing project selection and access tabs

Create personal API key form with project selection

4

Set access permissions

Ensure the key has the following permissions:
  • READ access: Person, Query, Session recording
  • WRITE access: Action, Sharing configuration
  • READ • Person: Link session replays to users to analyze user journeys over time.
  • READ • Query: Compute aggregates (affected users, first/last seen, paths) to prioritize tickets.
  • READ • Session recording: Retrieve replays and their metadata.
  • WRITE • Action: Create actions to automatically detect flows (e.g., onboarding). We use these to analyze issues at each step of a flow.
  • WRITE • Sharing configuration: Generate shareable links to tickets and replay snippets for your team.
PostHog access settings showing read access for error tracking, person, query, session recording and write access for action and sharing configuration

Required access permissions for the API key

5

Create and copy your API key

Click Create key and paste it into the form in your project settings.
6

Copy Project ID from URL

Find your project ID in the URL. For example:
https://[eu/us].posthog.com/project/48510/settings/user-api-keys
In this example, 48510 is the project ID. Copy your project ID into the form in your project settings.
7

Test Connection

Click Test Connection to verify everything works. Replays will begin streaming immediately.
A successful test connection message
You’re all set