Integrations / Analytics

PostHog

Run HogQL queries, look up persons, insights and feature flags, switch flags on or off, and add annotations in PostHog.

9 tools

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.

query*name

posthog.search_persons

Find persons by email, name, person ID or distinct ID. Person IDs are UUIDs.

searchemaildistinct_idlimit

posthog.get_insight

Get a saved insight and its cached results by numeric ID or 8-character short ID, e.g. AaVQ8Ijw.

id*refresh

posthog.list_feature_flags

List feature flags, optionally searching by key or name. Flag IDs are integers.

searchactivelimit

posthog.get_feature_flag

Get a feature flag with its release conditions by its integer ID.

id*

posthog.set_feature_flag_active writes

Switch a feature flag on or off by its integer ID.

id*active*

posthog.create_annotation writes

Add an annotation that marks a moment on the project's charts, such as a deploy or incident.

content*date_marker*scope

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.

path*params

posthog.api_request writes

Send a POST, PUT, PATCH or DELETE request to any PostHog API path under https://{host}/api/projects/{project_id}.

method*path*paramsbody

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

  1. 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.
  2. Paste the key (phx_…) as the connection's personal API key.
  3. Pick the cloud region your PostHog account lives in, and enter the project ID shown in Project settings.

Credentials

Personal API key

PostHog API docs

Your next automation is one sentence away.

14-day free trial with $5 of built-in AI included. Cancel anytime.