PostHog
Product analytics: events, queries, insights and flags
Managed auth
Authentication
Methods your end users can connect with. Credentials are stored encrypted, and secret values are never shown again or returned by the API.
API key
Your users enter
- Personal API key (phx_…)SecretRequired
- RegionOptionalIdentifier2 choices
Where to find them
- In PostHog: your account menu → “Settings” → “User” → “Personal API keys” → “Create personal API key”.
- Give it a name, choose the scope (the whole organization or some projects) and the permissions: read access to “User” (used by the connection test) and “Query” (HogQL queries), plus whatever you will use (Insight, Dashboard, Feature flag, Person…), or “All access”.
- Copy the key (phx_…): it is shown only once. The “Project API key” (phc_…) does not work: it can only send events.
Tools (1)
PostHog API request
POSTHOG_SEND_REQUESTAuthenticated call to the PostHog API (https://{server}). Any endpoint of the API is allowed. {project_id} is the numeric project ID (or @current, the user's active one); paths end in /. Examples: GET /api/users/@me/ (organization and active project in team.id), POST /api/projects/{project_id}/query/ {"query": {"kind": "HogQLQuery", "query": "SELECT event, count() FROM events WHERE timestamp > now() - INTERVAL 7 DAY GROUP BY event ORDER BY count() DESC LIMIT 20"}}, GET /api/projects/{project_id}/insights/?limit=20, GET /api/projects/{project_id}/dashboards/, GET /api/projects/{project_id}/feature_flags/, GET /api/projects/{project_id}/persons/?search=…, GET /api/projects/{project_id}/session_recordings/?limit=10.
Required scopes
No scopes required
Input
PostHog API request input Name Type Description methodstringHTTP methodOne of: GET,POST,PUT,PATCH,DELETEDefault:"GET"pathrequiredstringPath relative to the API base URL, or a full URL on the same API (e.g. a next-page link) queryobjectQuery string parameters bodyunknownJSON body formobjectBody as application/x-www-form-urlencoded instead of JSON body_base64stringBinary body, base64 (at most 960000 characters) content_typestringContent-Type of body_base64 headersobjectExtra headers such as Accept. Authentication is added automatically.

