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 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 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
What do we do with this access?
What do we do with this access?
- 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.

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: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.

You’re all set