Connecting PostHog
The Greppilot PostHog integration enables interaction with your PostHog project directly from the dashboard. It provides capabilities to query product analytics data, browse events, search users, inspect feature flags, and review saved insights.
Configuration
A PostHog Personal API Key is required for connection.
- In the Greppilot dashboard, navigate to Integrations.
- Select the PostHog integration.
- Provide your Personal API Key, Project ID, and optionally a custom host.
Generate a Personal API Key within your PostHog settings under Settings > Personal API Keys. Ensure the key possesses adequate permissions for desired operations.
PostHog Personal API Keys start with phx_. Keys are validated upon connection.
| Parameter | Type | Description | Required |
|---|---|---|---|
apiKey | string | Personal API Key from PostHog settings (starts with phx_). | Yes |
projectId | string | Project ID found in PostHog Project Settings. | Yes |
host | string | Custom PostHog host. Defaults to https://us.posthog.com. | No |
Available Tools
Upon successful connection, the following PostHog tools become available:
query
Run HogQL queries against PostHog data. HogQL is a SQL-like syntax supporting events, persons, sessions, and groups tables.
| Parameter | Type | Description | Required |
|---|---|---|---|
query | string | HogQL query string. | Yes |
limit | number | Max rows to return. Default: 100, max: 500. | No |
list_events
List recent events with optional filtering.
| Parameter | Type | Description | Required |
|---|---|---|---|
event | string | Filter by event name. | No |
distinct_id | string | Filter by user distinct ID. | No |
limit | number | Max events. Default: 50, max: 100. | No |
after | string | ISO timestamp, return events after this time. | No |
before | string | ISO timestamp, return events before this time. | No |
list_event_definitions
List all event types tracked in PostHog with their volume.
| Parameter | Type | Description | Required |
|---|---|---|---|
limit | number | Max results. Default: 100. | No |
list_persons
List users tracked in PostHog.
| Parameter | Type | Description | Required |
|---|---|---|---|
search | string | Search by name or email. | No |
limit | number | Max results. Default: 50, max: 100. | No |
list_feature_flags
List all feature flags configured in the project.
Parameters: None
list_insights
List saved insights (trends, funnels, retention).
| Parameter | Type | Description | Required |
|---|---|---|---|
limit | number | Max results. Default: 50. | No |