Docs / Workflows / Integrations / PostHog
PostHog
Query product data and manage saved insights, people, groups and feature flags in PostHog.
What you can do
Each PostHog integration’s page in OAIZ shows these uses, with its events and its read and write actions, under What you can do with PostHog.
- Weekly report
- Report weekly sign-ups and active users.
- Feature flags
- Turn a feature flag on or off from a workflow.
- Workflow events
- Send events from your workflows, such as completed orders.
Connection scope
The connection targets a PostHog project. A person’s distinctId identifies their tracked activity. Group types use groupTypeIndex and each group has a groupKey. These identifiers are different from PostHog’s internal person IDs.
Connecting
Create a Personal API Key in PostHog and enter it in OAIZ’s Personal API Key field. Set Region and Project ID to us:PROJECT_ID or eu:PROJECT_ID, matching the project’s cloud region.
For the complete connection, give the key the following permissions. hog_function:write is used to create the event destination that sends changes to OAIZ.
- Read permissions
- cohort:read, dashboard:read, event_definition:read, feature_flag:read, group:read, insight:read, person:read, project:read, property_definition:read and query:read.
- Write permissions
- action:write, annotation:write, cohort:write, feature_flag:write, group:write, hog_function:write, insight:write and person:write.
A project-scoped key limits the connection to project resources. Use an unscoped Personal API Key if the connection should also include organization members and their access information.
Read actions
- Query Events
- Read events filtered by name, person and properties.
- List Insights
- List saved insights with names, descriptions and timestamps.
- Get Insight
- Read an insight’s saved query and results.
- List Dashboards
- List dashboards with names, descriptions and tile counts.
- Get Dashboard
- Read a dashboard’s tiles and their data.
- List People
- Find people by email address, name or distinct ID.
- Get Person
- Read a person’s profile using one of their distinct IDs.
- List Group Types
- List configured PostHog group types and their groupTypeIndex values.
- List Groups
- List one cursor-paginated page of groups for a groupTypeIndex.
- Get Group
- Read a group by groupTypeIndex and groupKey.
- List Person Groups
- Read groups associated with a person through recent shared events.
- Query Funnel
- Measure conversion through a sequence of events.
- Query HogQL
- Run a read-only HogQL query with a global limit of up to 100 rows.
- List Cohorts
- List user cohorts.
- List Feature Flags
- List feature flags and their states.
- List Event Definitions
- List the project’s captured event types.
- List Property Definitions
- List definitions for event, person or group properties.
Write actions
- Create Action
- Define a PostHog action that groups matching events.
- Create Cohort
- Create a user cohort.
- Create Insight
- Save an insight with a query defining its events, interval and date range.
- Update Insight
- Change an insight’s name, description or query.
- Update Person Properties
- Update properties for a person.
- Toggle Feature Flag
- Enable or disable a feature flag.
- Create Group
- Create a group profile with optional properties.
- Update Group Property
- Create or update one property on a group.
- Delete Group Property
- Delete one property from a group.
- Create Annotation
- Add an annotation to mark events on charts.
- Send Event
- Send an event with a person identifier, properties and optional group context.
- Delete Person
- Remove a person’s profile.
Events
Supported captured events arrive as OAIZ events. Their event name, distinct ID and properties describe the activity. Group context is carried in the event properties when supplied.