PostHog Integration
The PostHog node lets your agents capture custom events, query analytics with HogQL, and manage insights and cohorts.
Connection Setup
Section titled “Connection Setup”PostHog requires two different keys for full functionality:
Personal API Key (for connection)
Section titled “Personal API Key (for connection)”When connecting PostHog via Settings → Integrations, Pipedream authenticates using a Personal API key (phx_...).
- Go to PostHog → Settings → Personal API Keys
- Click Create personal API key
- Grant scopes:
organization:read,project:read,event:read,event:write - Use this key when connecting PostHog in Spawnbase
Project API Key (for event capture)
Section titled “Project API Key (for event capture)”The Capture Event action requires a separate Project API key as an input field.
- Go to PostHog → Settings → Project API Key
- Copy the key (
phc_...) and paste it into theprojectApiKeyfield in the node configuration
Available Actions
Section titled “Available Actions”| Action | Description |
|---|---|
| Capture Event | Capture a custom event for a user/group |
| Create Project Insight | Create a new insight in a project |
| Create Query | Run a HogQL query and return results |
| Get Cohorts | Retrieve a list of cohorts |
| Get Persons | Retrieve a list of persons |
| Get Project Insight | Retrieve a specific insight by ID |
| Get Surveys | Retrieve a list of surveys |
| List Project Insights | List all insights for a project |
| Update Project Insight | Update an existing insight |
- Capture Event uses the Project API key (
phc_...), not the Personal API key — this trips up most users. - Create Query accepts HogQL — useful for flexible analytics queries your agent can construct dynamically.
- Most read actions require
organizationandproject_idfields — these load dynamically from your connected account.
Troubleshooting
Section titled “Troubleshooting”See Node Configuration Troubleshooting for common issues like empty dropdowns and connection errors.