This page is also inEN
iTeam
API guide · Data, BI and databases With your company’s credentials

PostHog API: What You Can Do and How to Use It with AI Agents

PostHog is a product analytics platform with events, funnels, session recordings, feature flags and experiments. It has a public API for sending events and a private API for querying data and managing project resources. Product and engineering teams use it, in the cloud or self-hosted.

Nina
API guide

What the PostHog API offers

Event capture

Send events and user properties from systems and apps.

Queries

Ask questions of the data with HogQL, PostHog's query language.

Insights and dashboards

Read and create saved reports.

Feature flags

Create and evaluate flags to roll out features.

People and cohorts

User profiles and groups by behavior.

Session recordings

Access to browsing recordings.

How to access the PostHog API

  • With your company’s credentialsSending events uses the project's public key. Queries and management use a personal API key with the scopes you choose.
  • Session recordings can contain personal data: use masking and restrict access.
  • Heavy queries count against usage limits.
  • Changes to feature flags affect real users.

Official documentation: posthog.com/docs/api

What an iTeam agent does with the PostHog API

Why the visit did not convert

The agent queries the funnel and the recordings of sessions that dropped off and summarizes the friction points for the team.

Question in natural language

The manager asks how many signups came from a campaign and the agent builds the query and answers.

Flag with approval

The team asks to release a feature to a group, and the agent prepares the flag change, applied after approval.

Tracking error alert

The agent notices when an important event has stopped arriving and alerts engineering.

From the credential to the agent at work, with approval

01

Create the personal API key

In PostHog, generate a personal key with read scopes and, if needed, write scopes for flags.

02

Register it in the iTeam vault

The key stays in the vault. Queries are open, and changes to flags and experiments require approval.

03

Compare the numbers

In the first weeks, check the agent's answers against the PostHog insights.

Questions

Questions about the PostHog API

Is the PostHog API free?

PostHog has a monthly free tier and charges for usage above it. The API follows the plan and limits of the project.

Do I need to write code to use the PostHog API with iTeam?

Not necessarily. iTeam uses the documentation and the PostHog MCP server, and the deployment team sets up access.

Does it work with a self-hosted PostHog?

Generally yes, as long as the API is reachable from the integration's network.

Next step

Put an AI team to work this week.

Start free with a pre-built team, or talk to us and our squad puts AI in production with your people.

300+integrations
4languages
Agents working right now