RhinoAgents + PostHog

RhinoAgents × PostHog

Connect AI Employees to PostHog Product Analytics, HogQL Queries, Feature Flags, Cohorts, and Session Insights via PostHog Personal API Keys and Action Webhooks.

Scoped Personal API Key HogQL Query API Feature Flags & Cohorts US & EU Cloud
HogQL
Product & Funnel Queries
20+
Typed PostHog Tools
US / EU
Regional Cloud Routing
100%
Scoped & Audit Logged
01 / INTEGRATION ARCHITECTURE

How RhinoAgents Connects Safely to PostHog

RhinoAgents connects to PostHog Cloud (US or EU) or self-hosted PostHog via a scoped Personal API Key, running HogQL analytics queries, inspecting user event timelines, and reacting to PostHog Action webhooks.

// PostHog Enterprise Execution Flow
POSTHOG
Events • HogQL • Flags
Funnels, Cohorts, Persons
REST / HogQL / Hooks
RHINOAGENTS RUNTIME
AI Employee + Guardrails
RBAC, Tool Registry, Audit Log
HITL Gate
SIGN-OFF
Slack / Teams
1-Click Approval

Pattern A — Support & Churn Context

When a customer opens a ticket, the AI Employee checks their recent PostHog events and errors before replying.

Ticket → PostHog Events → Context

Pattern B — Product-Qualified Lead (PQL)

PostHog Action webhooks (e.g. invited 5 teammates or hit API quota) notify sales reps and update CRM.

PH Action Hook → Agent → CRM PQL

Pattern C — HITL Feature Flag Rollout

Before toggling enterprise beta feature flags for an org, agents request 1-click Slack/Teams approval.

Flag Draft → HITL → Toggle
02 / HOW TO CONFIGURE

Step-by-Step PostHog Setup

Create a scoped Personal API Key in PostHog Settings → User → Personal API Keys.

STEP 01 • POSTHOG SETTINGS

Create Scoped Personal API Key

  1. Open PostHog → Settings → Personal API Keys → Create personal API key.
  2. Grant read scopes for Query, Insight, Person, and Feature Flag (write only if toggling flags).
STEP 02 • PROJECT & REGION

Copy Project ID & Cloud Host

  1. Note your Project ID and host (us.posthog.com or eu.posthog.com).
STEP 03 • ACTION WEBHOOKS (OPTIONAL)

Forward High-Intent Product Actions

  1. In PostHog Data Management → Actions (or Destinations), configure a webhook to RhinoAgents for key PQL or error events.
STEP 04 • RHINOAGENTS

Verify Connection

  1. Open RhinoAgents → Integrations → PostHog → Connect and verify GET /api/projects/{id}/.
Required Connector Fields in RhinoAgents AES-256 Encrypted Vault
Parameter Example Format Purpose
host https://us.posthog.com | eu.posthog.com PostHog Cloud region or self-hosted URL
project_id 49102 Target PostHog Project ID
personal_api_key phx_•••••••• (Vault Encrypted) Scoped PostHog Personal API Key
03 / COMPLETE API ACTIONS REGISTRY

Supported PostHog Tools & Triggers

Typed PostHog tools for HogQL queries, saved Insights, Person event lookup, Cohorts, and Feature Flags.

HogQL & Insights
execute_hogql_query(hogql, limit)
list_saved_insights(search)
get_insight_result(insight_id)
Persons & Event Timelines
search_persons(email_or_distinct_id)
get_person_recent_events(distinct_id)
list_error_events(timeframe)
Cohorts & Funnels
list_cohorts()
get_cohort_members(cohort_id)
Feature Flags (Guarded)
list_feature_flags()
check_flag_for_group(flag_key, group)
update_feature_flag_filters(id, filters)
Annotations
create_annotation(date, content)
Webhook Triggers
posthog.action_triggered
posthog.pql_threshold_reached
posthog.error_spike_detected
EXAMPLE TOOL EXECUTION • posthog.execute_hogql_query() RBAC + HITL Enforced
{
  "tool": "posthog.execute_hogql_query",
  "input": { "hogql": "SELECT properties.$browser, count() FROM events WHERE timestamp > now() - interval 7 day GROUP BY 1" },
  "result": { "rows": [["Chrome", 18420], ["Safari", 6110], ["Firefox", 1940]] }
}
05 / TECHNICAL FAQ

PostHog Integration FAQ

Are both PostHog US and EU Clouds supported?

Yes. Select us.posthog.com, eu.posthog.com, or your self-hosted domain.

Can AI Employees run HogQL queries safely?

Yes. HogQL queries are read-only and automatically capped with row limits.

Can we use PostHog Actions to trigger outreach?

Yes. Forward PostHog Action webhooks to RhinoAgents to enrich signups and alert sales.

Can Feature Flag changes require human approval?

Yes. Keep flag mutations behind 1-click Slack/Teams HITL sign-off.

Ready to Connect PostHog?

Build & Test Your PostHog AI Employee Today.

Start on the RhinoAgents platform with credits, or have our engineering team build, integrate, and manage your PostHog AI workflows end-to-end.