Integrations / Analytics
PostHog
Run HogQL queries, look up persons, insights and feature flags, switch flags on or off, and add annotations in PostHog.
Tools
posthog.run_hogql_query
Run a HogQL (SQL) query against the project's events, persons and other tables, e.g. SELECT event, count() FROM events GROUP BY event. Returns 100 rows unless the query sets a LIMIT.
posthog.search_persons
Find persons by email, name, person ID or distinct ID. Person IDs are UUIDs.
posthog.get_insight
Get a saved insight and its cached results by numeric ID or 8-character short ID, e.g. AaVQ8Ijw.
posthog.list_feature_flags
List feature flags, optionally searching by key or name. Flag IDs are integers.
posthog.get_feature_flag
Get a feature flag with its release conditions by its integer ID.
posthog.set_feature_flag_active writes
Switch a feature flag on or off by its integer ID.
posthog.create_annotation writes
Add an annotation that marks a moment on the project's charts, such as a deploy or incident.
posthog.api_get
Send a GET request to any PostHog API path under https://{host}/api/projects/{project_id} and return the response. For endpoints the named tools don't cover.
posthog.api_request writes
Send a POST, PUT, PATCH or DELETE request to any PostHog API path under https://{host}/api/projects/{project_id}.
Tick Allow raw writes on the connection to add api_request, which can send POST, PUT, PATCH and DELETE requests to any PostHog API path.
Connect
- In PostHog, open your account settings → Personal API keys and create a key scoped to the project, with read access to Query, Person, Insight and Feature flag, plus Feature flag write and Annotation write if your workflows change flags or add annotations.
- Paste the key (phx_…) as the connection's personal API key.
- Pick the cloud region your PostHog account lives in, and enter the project ID shown in Project settings.
Credentials
Your next automation is one sentence away.
14-day free trial with $5 of built-in AI included. Cancel anytime.