Skip to content
PostHog logo

Connectors / Data and analytics · HTTP Connector

PostHog integration and API

Create a feature flag, update a person and create an insight in PostHog. Connect PostHog to the rest of your data and analytics stack with Tray.ai.

What can you do with PostHog on Tray.ai?

PostHog is a product analytics platform that records how people use an app, with feature flags, experiments, session replays, and dashboards in one place. Tray.ai connects to PostHog through the HTTP Connector, so your workflows can call the PostHog API alongside the rest of your stack.

  • Capture an event for each closed deal in your CRM to tie revenue to product usage.
  • Create an annotation when your team deploys a release from your CI pipeline.
  • Update a person with the plan name from your billing system.
Connects through
HTTP Connector
Authentication
A bearer token or OAuth 2.0
Base URL
https://us.posthog.com

Set it up

Connect PostHog to Tray.ai

Each step uses PostHog's own API details, from its documentation.

Save PostHog's API token

Save the token PostHog issues as a Tray.ai authentication. The HTTP Client sends it as a bearer token on every call. The token stays out of the workflow and out of the logs.

Point the HTTP Client at the API

Add an HTTP Client step and use https://us.posthog.com as the base URL. Or paste a cURL example from PostHog's API docs, and Tray.ai fills in the method, URL, and headers.

Start with “List feature flags”

It's one of 24 documented actions, under Feature flags. The response comes back as data the next step can map into your other apps.

Hand it to an AI agent

Wrap “Create a feature flag” and “Get a feature flag” in workflows, and Tray.ai's Agent Gateway for MCP publishes them as governed tools Claude and other AI agents can call.

Workflows to build with PostHog

Connect PostHog with Salesforce, GitHub, Slack and Stripe

Each one uses actions and events from PostHog's own API documentation.

Sync Salesforce plan changes to PostHog persons

When

An account's plan changes in Salesforce

Then

  1. Update a person with the new plan
  2. Update a cohort for that plan

With Salesforce

Annotate PostHog charts when a GitHub release ships

When

A release is published in GitHub

Then

  1. Create an annotation with the release name and date
  2. Post the release note to the product channel in Slack

With GitHub and Slack

Send Stripe payments to PostHog as events

When

A payment succeeds in Stripe

Then

  1. Capture an event for the paying customer
  2. Update a person with the plan and amount

With Stripe

Apps you can build on PostHog data

Internal tools your team can build with an AI assistant, each one using PostHog calls from its API documentation.

Feature flag control panel

Lists feature flags with their settings and lets an engineer turn a flag on or off or change its rollout.

Release annotation log

Shows insights alongside release annotations and lets the team add a note when something ships.

Customer cohort lookup

Lets a support agent look up a person, see the cohorts available and update the person's properties.

Give your AI agents PostHog tools

Build an MCP server on PostHog in Agent Gateway and choose which actions your agents can call. Every call runs with access control and an audit trail. How Agent Gateway works

  • List feature flags
  • List persons
  • List insights
  • List cohorts
  • List annotations
  • Capture an event
  • Create a feature flag
  • Get a feature flag

What the PostHog API covers

6 resources and 24 documented actions, each one a call the HTTP Connector can make from a Tray.ai workflow. Connecting it takes a few clicks: here's how.

Feature flags

  • List feature flags
  • Create a feature flag
  • Get a feature flag
  • Update a feature flag
  • Delete a feature flag

Persons

  • List persons
  • Get a person
  • Update a person

Insights

  • List insights
  • Create an insight
  • Get an insight
  • Update an insight
  • Delete an insight

Cohorts

  • List cohorts
  • Create a cohort
  • Get a cohort
  • Update a cohort
  • Delete a cohort

Annotations

  • List annotations
  • Create an annotation
  • Update an annotation
  • Delete an annotation

Events

  • Capture an event
  • Capture a batch of events

Checked against PostHog's own documentation on 2026-10-22

posthog.com/docs/api

Frequently asked questions

What can a Tray.ai workflow do in PostHog?

The PostHog API documents 24 actions across 6 resources (Feature flags, Persons, Insights, Cohorts, Annotations, Events). For example: List feature flags; List persons; List insights. A workflow can make any documented call through the HTTP Connector.

How does Tray.ai authenticate with PostHog?

The PostHog API uses a bearer token and OAuth 2.0. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

See PostHog working against your stack.

We'll walk through a tailored demo with your systems plugged in.

Great, a couple more details

This helps us connect you with the right person. Optional, and you can skip it.