Skip to content

PostHog Integration

The PostHog node lets your agents capture custom events, query analytics with HogQL, and manage insights and cohorts.

PostHog requires two different keys for full functionality:

When connecting PostHog via Settings → Integrations, Pipedream authenticates using a Personal API key (phx_...).

  1. Go to PostHog → Settings → Personal API Keys
  2. Click Create personal API key
  3. Grant scopes: organization:read, project:read, event:read, event:write
  4. Use this key when connecting PostHog in Spawnbase

The Capture Event action requires a separate Project API key as an input field.

  1. Go to PostHog → Settings → Project API Key
  2. Copy the key (phc_...) and paste it into the projectApiKey field in the node configuration
ActionDescription
Capture EventCapture a custom event for a user/group
Create Project InsightCreate a new insight in a project
Create QueryRun a HogQL query and return results
Get CohortsRetrieve a list of cohorts
Get PersonsRetrieve a list of persons
Get Project InsightRetrieve a specific insight by ID
Get SurveysRetrieve a list of surveys
List Project InsightsList all insights for a project
Update Project InsightUpdate 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 organization and project_id fields — these load dynamically from your connected account.

See Node Configuration Troubleshooting for common issues like empty dropdowns and connection errors.