Skip to main content
The PostHog connector indexes your analytics configuration (dashboards, insights, feature flags, experiments, surveys) and enables direct querying of event data using HogQL.

What gets indexed

  • Dashboards - Names, descriptions, and dashboard tiles
  • Insights - Saved charts and queries with their filter configurations
  • Feature flags - Flag keys, names, rollout percentages, and targeting rules
  • Experiments - A/B tests with parameters and feature flag associations
  • Surveys - Survey configurations, questions, and targeting
  • Annotations - Date markers and notes on your analytics
The connector indexes your PostHog configuration and metadata, not raw event data. Event data is queried directly via the HogQL tool (see below).

HogQL query tool

In addition to indexing configuration, the PostHog connector enables direct querying of your event data using HogQL (PostHog’s SQL-like query language).

What you can query

  • Events - All tracked events with properties
  • Persons - User profiles and properties
  • Sessions - Session data and metrics

Example HogQL queries

-- Count pageviews in the last 7 days
SELECT count() FROM events
WHERE event = '$pageview'
AND timestamp > now() - INTERVAL 7 DAY

-- Daily unique users
SELECT toDate(timestamp) as day, count(DISTINCT distinct_id) as users
FROM events
GROUP BY day
ORDER BY day DESC

-- Top events by count
SELECT event, count() as total
FROM events
GROUP BY event
ORDER BY total DESC
LIMIT 10
The HogQL tool is read-only. You cannot modify data through Grapevine.

Setup

1

Generate a Personal API Key

  1. In PostHog, go to Settings > Personal API Keys
  2. Click Create Personal API Key
  3. Give it a descriptive name (e.g., “Grapevine Integration”)
  4. Copy the generated key
Personal API keys provide access based on your user permissions. Ensure you have access to the projects you want to index.
2

Connect to Grapevine

  1. In Grapevine, go to Integrations and click on PostHog
  2. Enter your Personal API Key
  3. Enter your PostHog Host:
    • US Cloud: https://us.posthog.com
    • EU Cloud: https://eu.posthog.com
    • Self-hosted: Your PostHog instance URL
  4. Click Connect
3

Select projects

  1. After connecting, Grapevine will fetch your accessible projects
  2. Select which projects you want to index
  3. Click Save to confirm your selection
4

Indexing begins

Grapevine will begin indexing your PostHog configuration from the selected projects. The initial sync may take time depending on the number of dashboards, insights, and feature flags.

Required permissions

Your Personal API Key needs read access to the following resources:
ResourcePurpose
AnnotationsIndex date markers
DashboardsIndex dashboard configurations
ExperimentsIndex A/B test configurations
Feature FlagsIndex flag configurations
InsightsIndex saved charts and queries
ProjectsList and access project data
Query APIExecute HogQL queries on event data
SurveysIndex survey configurations
Personal API keys inherit your user permissions. If you can access a resource in the PostHog UI, your API key can access it too.

Sync behavior

  • Initial sync - Indexes all dashboards, insights, feature flags, experiments, surveys, and annotations from selected projects
  • Ongoing syncs - Runs periodically to capture changes
  • Deletions - Deleted and archived items are removed from the index

Rate limits

PostHog enforces API rate limits on different endpoint categories:
Endpoint TypeRate Limit
Analytics endpoints240/min, 1,200/hour
Query endpoint (HogQL)2,400/hour
CRUD operations480/min, 4,800/hour
Feature flag evaluation600/min
For high-volume workspaces, rate limits may slow the initial sync. The connector implements automatic retry with exponential backoff.

Limitations

  • Raw event data is not indexed (query it via HogQL instead)
  • HogQL queries are read-only
  • Self-hosted instances must be accessible from Grapevine’s infrastructure
  • Personal API keys are scoped to user permissions