PostHog
Read PostHog events, insights, feature flags, cohorts and persons, update person properties, and write chart annotations. Connect with a PostHog personal API key.
- rest
https://api.superagnt.com/v1/connections/posthogplus the vendor's own path, with your superagnt_ API key asAuthorization: Bearer.- mcp
- Tools named
connection_posthog_*onhttps://mcp.superagnt.com/mcp, served once the account is connected. - billing
- PostHog bills your own account. Calls cost no superagnt_ data credits.
- rate limit
- 8 requests a second, 480 a minute: the vendor's ceiling as the registry records it, for sizing bursts. Your plan's own limit is on Connections.
- vendor docs
- https://posthog.com/docs/api
The PostHog connection lets an agent read your product analytics on PostHog. It lists projects, reads recent events, saved insights with their results, feature flags and cohorts, finds persons by distinct id, email or free-text search and updates their properties, and writes annotations, the dated notes shown on PostHog charts.
01
Setup
- Create a personal API key. In your PostHog account settings, create a personal API key. Give it read access to what your agents read, and write access to persons and annotations if they change them.
- Connect PostHog. In the superagnt app open Integrations, pick PostHog, paste the key into Personal API key and press Connect.
The connection calls PostHog US Cloud (https://us.posthog.com). It has no setting for PostHog EU Cloud or a self-hosted instance.
02
Things to know
- Start with
connection_posthog_projects_read, where anorganization_idof@currentmeans the key's default organization. Most tools take the numericproject_idit returns. Persons and insights takeenvironment_idinstead, which for most projects is the same number. list-eventsreturns only the last 24 hours unless you setafter. The range betweenbeforeandafteris at most a year, andoffsetstops at 50,000. PostHog has deprecated this endpoint in favour of its query API, which the connection does not cover.- Lists page with
limit(up to 100) andoffset. - Every PostHog path ends with a slash, as in the operations table below. Keep it.
- To remove one property from a person, send
delete-person-propertythe body{"$unset": "<property name>"}. To hide an annotation, set itsdeletedtotrue. - Removing a person property always asks a person first by default. Every other operation runs without asking (Permissions).
- The connection does not cover event capture. Send events with a PostHog SDK.
03
Examples
List projects
curl "https://api.superagnt.com/v1/connections/posthog/api/organizations/@current/projects/" \
-H "Authorization: Bearer $AGNTDATA_API_KEY"Find a person by email
curl "https://api.superagnt.com/v1/connections/posthog/api/environments/12345/persons/?email=jenny.rosen@example.com" \
-H "Authorization: Bearer $AGNTDATA_API_KEY"Annotate a launch
curl -X POST "https://api.superagnt.com/v1/connections/posthog/api/projects/12345/annotations/" \
-H "Authorization: Bearer $AGNTDATA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "Pricing page v2 launched", "date_marker": "2026-10-19T09:00:00Z"}'10 tools, one per resource and risk
MCP servers and agents on the grouped surface list PostHog as these tools. Each takes an action, and the ones that work across record types an object. Every operation also keeps its own per-operation name, in the next table, which works on every server. How grouping works: Grouped tools.
| Tool | Risk | Actions |
|---|---|---|
connection_posthog_projects_readList PostHog projects List the projects of an organization (organization_id "@current" is the connected one). Most PostHog tools take the numeric project_id found here; insights and persons take environment_id, usually the same number. | read | list |
connection_posthog_events_readRead PostHog events List recent events (only the last 24 hours unless after is set), or get one. Takes project_id. | read | listget |
connection_posthog_insights_readRead PostHog insights List or get saved insights (charts and their results). Takes environment_id, usually the project_id. | read | listget |
connection_posthog_feature_flags_readRead PostHog feature flags List or get feature flags. Takes project_id. | read | listget |
connection_posthog_cohorts_readRead PostHog cohorts List or get cohorts. Takes project_id. | read | listget |
connection_posthog_annotations_readRead PostHog annotations List or get annotations (dated notes shown on PostHog charts). Takes project_id. | read | listget |
connection_posthog_annotations_writeWrite PostHog annotations Create an annotation (a dated note shown on PostHog charts) or update its text, date or scope; setting deleted to true hides it. | write | createupdate |
connection_posthog_persons_readFind PostHog persons List the persons in a PostHog environment, filtered by distinct_id, email or free-text search, or get one person with their properties. Persons are keyed by environment_id, not project_id. | read | listget |
connection_posthog_persons_writeUpdate PostHog persons Update a person's top-level fields (name, distinct ids), or set a single person property. | write | updateset_property |
connection_posthog_persons_deleteDelete a PostHog person property Remove one property from a person: send body {"$unset": "<property name>"}. | destructive | delete_property |
All 18 operations
Each operation is a REST path under https://api.superagnt.com/v1/connections/posthog and an MCP tool. The per-operation tool name is the one permissions, approvals and usage records use.
| Operation | MCP tool |
|---|---|
GET /api/organizations/{organization_id}/projects/List projects in an organization | connection_posthog_list_projectsgrouped: connection_posthog_projects_read, action list |
GET /api/projects/{project_id}/events/List events (deprecated) | connection_posthog_list_eventsgrouped: connection_posthog_events_read, action list |
GET /api/projects/{project_id}/events/{id}/Get a single event | connection_posthog_get_eventgrouped: connection_posthog_events_read, action get |
GET /api/environments/{environment_id}/persons/List persons | connection_posthog_list_personsgrouped: connection_posthog_persons_read, action list |
GET /api/environments/{environment_id}/persons/{id}/Get a person | connection_posthog_get_persongrouped: connection_posthog_persons_read, action get |
PATCH /api/environments/{environment_id}/persons/{id}/Update a person | connection_posthog_update_persongrouped: connection_posthog_persons_write, action update |
POST /api/environments/{environment_id}/persons/{id}/update_property/Set a single person property | connection_posthog_update_person_propertygrouped: connection_posthog_persons_write, action set_property |
POST /api/environments/{environment_id}/persons/{id}/delete_property/Delete a single person property | connection_posthog_delete_person_propertygrouped: connection_posthog_persons_delete, action delete_property |
GET /api/environments/{environment_id}/insights/List insights | connection_posthog_list_insightsgrouped: connection_posthog_insights_read, action list |
GET /api/environments/{environment_id}/insights/{id}/Get an insight | connection_posthog_get_insightgrouped: connection_posthog_insights_read, action get |
GET /api/projects/{project_id}/feature_flags/List feature flags | connection_posthog_list_feature_flagsgrouped: connection_posthog_feature_flags_read, action list |
GET /api/projects/{project_id}/feature_flags/{id}/Get a feature flag | connection_posthog_get_feature_flaggrouped: connection_posthog_feature_flags_read, action get |
GET /api/projects/{project_id}/cohorts/List cohorts | connection_posthog_list_cohortsgrouped: connection_posthog_cohorts_read, action list |
GET /api/projects/{project_id}/cohorts/{id}/Get a cohort | connection_posthog_get_cohortgrouped: connection_posthog_cohorts_read, action get |
GET /api/projects/{project_id}/annotations/List annotations | connection_posthog_list_annotationsgrouped: connection_posthog_annotations_read, action list |
POST /api/projects/{project_id}/annotations/Create an annotation | connection_posthog_create_annotationgrouped: connection_posthog_annotations_write, action create |
GET /api/projects/{project_id}/annotations/{id}/Get an annotation | connection_posthog_get_annotationgrouped: connection_posthog_annotations_read, action get |
PATCH /api/projects/{project_id}/annotations/{id}/Update an annotation | connection_posthog_update_annotationgrouped: connection_posthog_annotations_write, action update |