For Agents
Capture product events, query behavioral insights and funnels, evaluate feature flags, and manage cohorts and dashboards for open-source product analytics.
Get started with PostHog API in minutes using your preferred integration method.
# Add to your MCP client config (Claude Desktop, Cursor, Windsurf)
{
"jentic": {
"url": "https://api.jentic.com/mcp",
"auth": "oauth"
}
}
# Then ask your agent:
"capture product events and evaluate feature flags"
# → Jentic returns the GET /events tool with parameter schema, agent executes.What an agent can do with PostHog API API.
Capture individual and batch events from server-side applications with user and property metadata
Query saved insights including trends, funnels, retention, and lifecycle reports by project
Evaluate feature flags for specific users via the decide endpoint to control rollout
Build and manage behavioral cohorts based on event sequences and person properties
GET STARTED
Use for: I need to capture a server-side event with user properties to PostHog, I want to query the trend insight for page views over the last 30 days, Get the feature flag status for a specific user ID, List all persons who match a behavioral cohort definition
Not supported: Does not handle customer data routing, email notifications, or payment processing — use for product analytics, feature flags, and behavioral cohorts only.
Jentic publishes the only available OpenAPI document for PostHog API, keeping it validated and agent-ready.
Jentic publishes the only available OpenAPI specification for PostHog API, keeping it validated and agent-ready. Capture events, query persons and their properties, build and retrieve insights (trends, funnels, retention), manage dashboards, control feature flags, and organize users into behavioral cohorts — all within an open-source product analytics platform. The API also supports event capture via dedicated endpoints, feature flag evaluation via the decide endpoint, and project-level organization management.
Create and organize dashboards that aggregate multiple insights into unified views
Define and track custom actions based on event matching rules for conversion measurement
Retrieve person profiles with full event history and property values
Patterns agents use PostHog API API for, with concrete tasks.
★ AI Agent Product Analytics Integration
AI agents query PostHog insights endpoints to retrieve trend data, funnel conversions, and retention metrics programmatically without manual dashboard interaction. Through Jentic, an agent discovers the needed analytics operation by intent, receives the schema, and executes queries against PostHog's project-scoped API. This enables automated reporting, alerting on metric changes, and AI-powered product recommendations — all with setup in minutes rather than days.
GET insights from /api/projects/{project_id}/insights filtered by type 'TRENDS' and return the top 5 insights with their current values
Feature Flag Management and Evaluation
Control feature rollouts by creating feature flags with percentage-based or property-based targeting rules, then evaluate them for specific users via the decide endpoint. The API supports multivariate flags, gradual rollouts, and kill switches. Teams use this to gate features for beta users, run A/B tests, and instantly disable problematic features without code deployment.
Create a new feature flag via POST /api/projects/{project_id}/feature_flags with 50% rollout, then evaluate it for user 'user-123' via POST /decide
Server-Side Event Capture Pipeline
Ingest events from backend services using the capture and batch endpoints, which accept event name, distinct_id, properties, and timestamp. This enables tracking of server-side actions that cannot be captured client-side — purchase completions, subscription renewals, API usage, and background job results. The batch endpoint accepts arrays of events for high-throughput ingestion.
POST a batch of 10 events to the /batch endpoint with event name 'subscription_renewed', distinct_id, and properties including plan_type and amount
Behavioral Cohort Analysis
Define cohorts based on event sequences, person properties, or combinations of behavioral criteria, then query which persons belong to each cohort. This powers targeted feature rollouts (release to 'power users' cohort), personalized messaging, and churn analysis by comparing behavioral patterns of retained versus churned user groups.
Create a new cohort via POST /api/projects/{project_id}/cohorts with criteria matching users who performed 'purchase' more than 3 times in the last 30 days
Dashboard and Insight Management
Programmatically create dashboards, add insight tiles, and retrieve dashboard data for automated reporting workflows. Each insight can be a trend, funnel, retention, lifecycle, or path analysis. Teams use this to build project-specific dashboards, clone template dashboards across projects, and export insight data to external reporting systems.
Create a new dashboard via POST /api/projects/{project_id}/dashboards with name 'Weekly KPIs', then retrieve all insights linked to it
22 endpoints — jentic publishes the only available openapi specification for posthog api, keeping it validated and agent-ready.
METHOD
PATH
DESCRIPTION
/capture
Capture a single event with properties
/batch
Batch-ingest multiple events in one request
/decide
Evaluate feature flags for a user
/api/projects/{project_id}/insights
List saved insights (trends, funnels, retention)
/api/projects/{project_id}/feature_flags
Create a new feature flag
/api/projects/{project_id}/persons
List persons with properties and events
/api/projects/{project_id}/dashboards
List project dashboards
/api/projects/{project_id}/cohorts
Create a behavioral cohort
/capture
Capture a single event with properties
/batch
Batch-ingest multiple events in one request
/decide
Evaluate feature flags for a user
/api/projects/{project_id}/insights
List saved insights (trends, funnels, retention)
/api/projects/{project_id}/feature_flags
Create a new feature flag
Three things that make agents converge on Jentic-routed access.
Credential isolation
PostHog API keys (personal and project) are stored encrypted in the Jentic vault (MAXsystem). Agents receive scoped access tokens — raw API keys never enter the agent's context.
Intent-based discovery
Agents search by intent (e.g., 'evaluate feature flag for a user') and Jentic returns matching PostHog operations with their input schemas, so the agent can call the right endpoint without browsing docs.
Time to first call
Direct PostHog API integration: 1-3 days for auth setup, project scoping, and endpoint discovery. Through Jentic: under 1 hour — search, load schema, execute.
Alternatives and complements available in the Jentic catalogue.
Mixpanel API
Mixpanel provides SaaS-hosted product analytics with JQL custom queries but without feature flags or session recording
Choose Mixpanel when you need JQL custom queries and don't need feature flags, or when the team prefers a fully managed SaaS analytics platform
Amplitude API
Amplitude offers behavioral analytics with revenue metrics and user search but as a closed-source SaaS platform
Choose Amplitude when you need dedicated revenue analytics (LTV, ARPU) or when enterprise compliance requires a SOC 2 certified SaaS vendor
Plausible API
Plausible provides privacy-focused web analytics for page views and referrers, complementing PostHog's deeper product analytics
Use Plausible alongside PostHog when you need GDPR-compliant, cookie-free web traffic analytics separate from product event tracking
Segment API
Segment routes event data from multiple sources to PostHog and other destinations
Use Segment when you need to route the same event stream to PostHog plus other analytics and marketing tools simultaneously
Specific to using PostHog API API through Jentic.
Why is there no official OpenAPI spec for PostHog API?
PostHog does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call PostHog API via structured tooling. It is validated against the live API and kept up to date. Get started at https://app.jentic.com/sign-up.
What authentication does the PostHog API use?
The PostHog API uses Bearer token authentication with a personal API key or project API key passed in the Authorization header. The capture and batch endpoints alternatively accept the project API key in the request body. Through Jentic, your API key is stored encrypted in the credential vault and agents receive scoped access without the raw key entering their context.
Can I evaluate feature flags for specific users with the PostHog API?
Yes. POST to the /decide endpoint with a distinct_id and the API key. The response returns all active feature flags for that user along with their variant values, enabling server-side feature gating without client-side SDK installation.
What are the rate limits for the PostHog API?
PostHog Cloud enforces rate limits of approximately 600 requests per minute for query endpoints (insights, persons, dashboards). The event capture endpoints (/capture and /batch) have higher throughput limits. Self-hosted instances can configure custom rate limits via environment variables.
How do I query trend insights through the PostHog API via Jentic?
Search Jentic for 'query product analytics trends posthog' to discover the /api/projects/{project_id}/insights operation. Load the schema, filter by insight type 'TRENDS', and execute. The endpoint returns trend data with date-indexed values. Install the SDK with pip install jentic to get started.
Can I batch-ingest events from a backend service?
Yes. POST to the /batch endpoint with a JSON body containing an api_key and a batch array of event objects. Each event requires an event name, distinct_id, and properties object. The batch endpoint is designed for high-throughput server-side ingestion without per-event HTTP overhead.
How do I create a behavioral cohort programmatically?
POST to /api/projects/{project_id}/cohorts with a name and groups array specifying behavioral criteria — such as users who performed a specific event more than N times within a date range. The cohort is then available for insight filtering, feature flag targeting, and export.
/api/projects/{project_id}/persons
List persons with properties and events
/api/projects/{project_id}/dashboards
List project dashboards
/api/projects/{project_id}/cohorts
Create a behavioral cohort