Product
Jentic OSThe workplace. An in-house AI platform for every employeeJentic OneSafe access. Agents reach your systems without holding keysJentic AIRThe foundation. Gets your existing platforms ready for AI
Pricing
Developers

GET STARTED

API DirectoryBrowse 10,000+ APIs Ready For AI Agent IntegrationDocumentationGuides and API reference

TOOLS

API ScoringCheck your AI Readiness using our scorecardArazzo UIVisualize Arazzo Workflows As Interactive DocumentationArazzo EditorBuild And Edit Multi-Step API Workflows Visually

COMMUNITY

GitHubOpen source projects and examplesOpen StandardsBuilt on open specs. Never locked in.
Resources
Company
About UsOur mission and teamCareersJoin our teamContactGet in touch
Try it now
Jentic OSJentic OneJentic AIR
Pricing
API DirectoryDocumentationAPI ScoringArazzo UIArazzo EditorGitHubOpen Standards
Resources
About UsCareersContact
Try it now
JenticJentic
Products
  • Jentic OS
  • Jentic One
  • Jentic AIR
For Developers
  • API Directory
  • Documentation
  • GitHub
Company
  • About Jentic
  • Careers
  • Contact Us
  • Trust Centre
ISO/IEC 27001:2022 certification badge issued by Prescient SecurityISO/IEC 27001:2022 certification badge issued by Prescient Security

Information Security Management System

Certified to ISO/IEC 27001:2022 by Prescient Security

Terms & Conditions•Privacy Policy•
© 2026 Jentic Technology Ltd. All rights reserved.
Switch to light modeSwitch to dark mode
APIs / Analytics / PostHog API
PostHog API logo

PostHog API

Agent-ready OpenAPI document · curated by JenticAnalyticsProduct Analyticsbearer22 EndpointsREST

Know of an official OpenAPI document? Contribute it →

For Agents

Capture product events, query behavioral insights and funnels, evaluate feature flags, and manage cohorts and dashboards for open-source product analytics.

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 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.

Jentic One on GithubView OpenAPI Document

Install Jentic One Beta

Connect the PostHog API to your agent

Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the PostHog API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.

Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.

1

Step 1: Jentic One Host machine

# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fposthog.com%2Fposthog" | sh
2

Step 2: Agent machine

# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fposthog.com%2Fposthog" | sh
jentic register       # connects your agent to your Jentic One instance

Jentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.

Capabilities

What an agent can do with PostHog 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

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

Use Cases

Patterns agents use PostHog 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

Key Endpoints

22 endpoints — jentic publishes the only available openapi specification for posthog api, keeping it validated and agent-ready.

METHOD

PATH

DESCRIPTION

POST

/capture

Capture a single event with properties

POST

/batch

Batch-ingest multiple events in one request

POST

/decide

Evaluate feature flags for a user

GET

/api/projects/{project_id}/insights

List saved insights (trends, funnels, retention)

POST

/api/projects/{project_id}/feature_flags

Create a new feature flag

GET

/api/projects/{project_id}/persons

List persons with properties and events

GET

/api/projects/{project_id}/dashboards

List project dashboards

POST

/api/projects/{project_id}/cohorts

Create a behavioral cohort

POST

/capture

Capture a single event with properties

POST

/batch

Batch-ingest multiple events in one request

POST

/decide

Evaluate feature flags for a user

GET

/api/projects/{project_id}/insights

List saved insights (trends, funnels, retention)

POST

/api/projects/{project_id}/feature_flags

Create a new feature flag

GET

/api/projects/{project_id}/persons

List persons with properties and events

GET

/api/projects/{project_id}/dashboards

List project dashboards

POST

/api/projects/{project_id}/cohorts

Create a behavioral cohort

Why Jentic?

What agents get from Jentic-routed access to this vendor.

Setup

Setup

Wiring the PostHog API by hand means learning its bearer token auth and choosing the right regional host ({region}.posthog.com) yourself. Through Jentic you install once, import the PostHog API from the API Directory, store the token once, and your agent calls it.

Permission scoping

Permission scoping

PostHog puts the project id in the URL path (/api/projects/{project_id}/...), so a rule can pin your agent to one project: you choose the operations it may call, so writes like creating feature flags or cohorts are not included unless you add them.

Credential management

Credential isolation

Your PostHog API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.

Intent-based discovery

Intent-based discovery

Agents search Jentic by intent such as 'evaluate a feature flag for a user' or 'list project insights', and Jentic returns the matching PostHog operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

Related APIs

Alternatives and complements available in the Jentic catalogue.

Alternative

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

Alternative

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

Complementary

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

Complementary

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

FAQs

Specific to using PostHog 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 with Jentic One, the self-hosted execution layer.

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.

Can I limit what my agent is allowed to do with the PostHog API?

Yes. Because you run Jentic One yourself, your own rules decide which PostHog operations and credentials the agent may use. Since PostHog puts the project id in the URL path (/api/projects/{project_id}/...), you can pin the agent to a single project and grant only read operations such as listing insights, persons, and dashboards. Write operations like creating a feature flag (POST /feature_flags) or a cohort (POST /cohorts) stay unavailable until you explicitly add them.

GET STARTED

Start building with PostHog API

Explore with Jentic One
View OpenAPI Document