Sazabi
Log sourcesConnect your account

PostHog

Connect your PostHog account so Sazabi can install and manage a webhook destination for the projects you select.

About

PostHog's Data Pipeline forwards each matching event to Sazabi as a JSON payload, and Sazabi stores it as a log. Connecting your PostHog account lets Sazabi install and maintain an HTTP Webhook destination (a PostHog "hog function") for each project you select.

PostHog also has a Send to an endpoint path where you configure the webhook destination yourself. See PostHog endpoint page for that setup.

PostHog CDP / Data Pipeline destinations are a paid feature. Confirm your PostHog plan includes Data Pipeline access before connecting.

Prerequisites

  • A PostHog organization with Data Pipeline access.
  • A PostHog personal API key with these scopes:
    • project:read — list your projects
    • organization:read — show your organization
    • hog_function:write — install the webhook destination
  • Your PostHog region: US (us.posthog.com) or EU (eu.posthog.com).

Set up in the dashboard

Create a personal API key

In PostHog, go to Settings > Personal API keys (US or EU) and create a key with the three scopes listed above (project:read, organization:read, hog_function:write). The key starts with phx_.

Connect in Sazabi

Go to Settings > Log streams, click Add source, and select PostHog. Enter your personal API key and click Connect. Sazabi validates the key and identifies your PostHog region and organization automatically.

Add log streams

After the connection is confirmed, click Add log stream to open the project picker. Select the PostHog projects you want to forward. For each project, Sazabi installs an HTTP Webhook destination that posts events to the Sazabi intake URL.

Set up with the CLI

You can also connect the PostHog log source with the Sazabi CLI (installed and authenticated — see CLI reference).

Create a managed connection by passing your personal API key and PostHog region as metadata:

sazabi log-sources create posthog --mode managed \
  --metadata '{"posthogPersonalApiKey":"'"$POSTHOG_PERSONAL_API_KEY"'","posthogApiRegion":"us"}'

Set posthogApiRegion to us or eu to match your PostHog Cloud region. Use a key with the same scopes as the dashboard flow (project:read, organization:read, hog_function:write). Sazabi validates it against the PostHog API and creates the log source; note the log source ID it prints.

Add a log stream — one per PostHog project — with sazabi log-streams create, passing the PostHog project ID and name in --config:

sazabi log-streams create --log-source-id <log-source-id> \
  --config '{"posthogProjectId":"<your PostHog project ID>","posthogProjectName":"<project name>"}'

Run sazabi log-sources list to confirm the source and its streams.

Verify

In a connected PostHog project, send a test event — capture an event from a client SDK, run a backend event capture, or use PostHog's built-in test event feature in the Data Pipeline destination settings.

Open the Intake page in the Sazabi dashboard and confirm that records attributed to the PostHog source appear. Events typically arrive within one to two minutes.

Troubleshooting

Token validation fails — Confirm the key starts with phx_ and has all three required scopes: project:read, organization:read, and hog_function:write. A key missing hog_function:write will pass the project listing step but fail when Sazabi tries to install the destination.

No projects appear in the picker — Verify the key has project:read scope. If the organization has no projects, create one in PostHog first.

Events stop arriving — The hog function (webhook destination) may have been disabled or deleted in PostHog, or the personal API key may have been revoked. Remove and re-add the log stream from Settings > Log streams in Sazabi to reinstall the destination.

Data Pipeline access error — Confirm your PostHog plan includes Data Pipeline / CDP destination support. Free plans may not have access to this feature.

Further reading