PostHog Integration
Receive PostHog events through PostHog's HTTP Webhook destination (Data pipelines → Destinations), then route, transform, filter and replay them with Hookbase. That covers pageviews, identifies, survey responses, feature flag calls and your own custom events.
PostHog signs a request only when the destination has a Signing secret, in one of two Signature formats. Hookbase has a provider for each:
| PostHog "Signature format" | Hookbase provider | What arrives |
|---|---|---|
| Standard Webhooks (PostHog's default, recommended) | posthog ("PostHog") | An HMAC-SHA256 signature in webhook-signature, with a signed timestamp |
| HMAC-SHA256 of the body | posthog-hmac ("PostHog (HMAC-SHA256)") | X-Hub-Signature-256: sha256=<hex>, with no timestamp |
PostHog never generates the signing secret: you type it into the destination. Hookbase generates one when you create the source, and you copy it into PostHog.
Setup
1. Create a Source in Hookbase
In the dashboard, create a source from the PostHog template. Hookbase fills in a generated
signing secret (whsec_...) with a copy button.
With the API, leave signingSecret out and Hookbase generates one and returns it in the response:
curl -X POST https://api.hookbase.app/api/sources \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "PostHog Production",
"slug": "posthog",
"provider": "posthog"
}'For a posthog source the secret is whsec_ followed by 44 base64 characters. You can reveal it again
later from the source page, or with GET /api/sources/{id}/reveal-secret.
To keep a secret you already set in PostHog, pass it as signingSecret instead. Hookbase applies the
same limits PostHog does:
posthog: base64 that decodes to at least 24 bytes, with or without thewhsec_prefix. The dashboard field expects the prefix, so addwhsec_if your key lacks it. PostHog accepts the key either way.posthog-hmac: at least 24 characters.
A shorter or non-base64 secret is rejected with a 400, because PostHog would refuse to sign with it
and send nothing.
Save your webhook URL:
https://api.hookbase.app/ingest/{orgSlug}/posthog2. Create the PostHog Destination
- In PostHog, open Data pipelines → Destinations, click New destination and choose HTTP Webhook
- Set Webhook URL to your Hookbase ingest URL and leave the method on
POST - Leave JSON Body on the default,
{ "event": "{event}", "person": "{person}" }. Hookbase reads the event name fromevent.event. If you write your own body, keep a top-level"event"key that holds either the whole{event}object or just its name ("event": "{event.event}") - Paste the Hookbase source's secret into Signing secret, then set Signature format:
- Standard Webhooks for a
posthogsource (the default) - HMAC-SHA256 of the body for a
posthog-hmacsource
- Standard Webhooks for a
- Set the filters for which events to send. Each matching event becomes one request
- Send a test event from the destination's test panel and confirm it arrives in Hookbase verified, then save and enable the destination
See PostHog's webhook destination docs for the template's other options.
3. Create Destinations and Routes
# Create a destination
curl -X POST https://api.hookbase.app/api/destinations \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "Analytics Warehouse", "slug": "warehouse", "url": "https://api.myapp.com/webhooks/posthog"}'
# Create a route
curl -X POST https://api.hookbase.app/api/routes \
-H "Authorization: Bearer whr_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "PostHog to Warehouse", "sourceId": "src_...", "destinationId": "dst_..."}'A route carries one destination. Fanning one source out to several endpoints is one route each.
Signature Verification
Standard Webhooks (posthog)
PostHog's default format follows the Standard Webhooks specification. Each request carries three headers:
webhook-id: 0193d1a2-6b7c-7e8f-9a0b-1c2d3e4f5a6b
webhook-timestamp: 1767225600
webhook-signature: v1,<base64 HMAC-SHA256>PostHog signs {webhook-id}.{webhook-timestamp}.{body} with HMAC-SHA256. The key is the
base64-decoded secret, after any whsec_ prefix is stripped. The header is v1, plus the base64
digest.
Requests whose webhook-timestamp is more than 5 minutes away from Hookbase's clock fail
verification, which is the replay protection this format adds. When PostHog retries a request it
re-signs it with a fresh timestamp and keeps the same webhook-id.
Use posthog rather than the generic standard-webhooks provider. The signature check is the same,
but only the PostHog provider also reads the event name as the event type. It also lets Hookbase
generate the secret, while standard-webhooks expects a secret the sender issued.
HMAC-SHA256 of the Body (posthog-hmac)
X-Hub-Signature-256: sha256=<hex HMAC-SHA256 of the raw body>
webhook-id: 0193d1a2-6b7c-7e8f-9a0b-1c2d3e4f5a6bThe key is the secret's own characters, with no decoding, so a whsec_ prefix is part of the key in
this format. Nothing but the body is signed, so there is no timestamp and no replay window. Hookbase's
24-hour payload-hash replay check is the replay protection here. Prefer Standard Webhooks unless you
already use this format.
Rejecting Unverified Requests
Once events arrive with signature_valid: true, set rejectInvalidSignatures: true on the source.
Requests with a missing or wrong signature are then refused with 401 instead of being stored. The
setting defaults to false, so a wrong secret first shows up as an unverified badge rather than as
lost traffic.
A destination with no signing secret sends no signature header. Its events arrive unverified, and a source that rejects invalid signatures refuses them.
Events
The event type is PostHog's event name, read from event.event in the default body:
| Event type | Description |
|---|---|
$pageview | A page was viewed (captured by the web SDK) |
$pageleave | A user left a page |
$autocapture | A click, form submission or input change was autocaptured |
$identify | An anonymous user was identified (posthog.identify()) |
$exception | An exception was captured by error tracking |
$feature_flag_called | A feature flag was evaluated for a user |
survey sent | A survey response was submitted |
Custom events arrive under their own names, for example signed_up or checkout completed.
Payload
With the default JSON body, a request looks like this. The properties depend on the SDK and your instrumentation:
{
"event": {
"uuid": "0193d1a2-6b7c-7e8f-9a0b-1c2d3e4f5a6b",
"event": "$pageview",
"distinct_id": "user_8f2c1d",
"properties": {
"$current_url": "https://example.com/pricing",
"$pathname": "/pricing",
"$browser": "Chrome",
"$lib": "web"
},
"timestamp": "2026-12-01T17:04:05.123Z",
"url": "https://us.posthog.com/project/12345/events/0193d1a2-6b7c-7e8f-9a0b-1c2d3e4f5a6b/2026-12-01T17:04:05.123Z"
},
"person": {
"id": "0193d1a0-1111-7a2b-8c3d-4e5f6a7b8c9d",
"name": "jane@example.com",
"url": "https://us.posthog.com/project/12345/person/user_8f2c1d",
"properties": { "email": "jane@example.com", "name": "Jane Doe" }
}
}event.uuid is PostHog's id for the event, so use it to deduplicate downstream across destinations.
Transform Example
A javascript transform receives the parsed payload and returns the body Hookbase delivers.
function transform(payload) {
const event = payload.event || {};
const props = event.properties || {};
const person = payload.person || {};
return {
name: event.event || null,
id: event.uuid || null,
distinct_id: event.distinct_id || null,
url: props.$current_url || null,
email: (person.properties || {}).email || null,
occurred_at: event.timestamp || null
};
}Filter Examples
Filter conditions read dotted paths out of the payload. logic must be AND or OR.
Survey Responses Only
{
"name": "Survey Responses",
"logic": "AND",
"conditions": [
{
"field": "event.event",
"operator": "equals",
"value": "survey sent"
}
]
}Sign-ups or Identifies
{
"name": "Sign-ups or Identifies",
"logic": "OR",
"conditions": [
{ "field": "event.event", "operator": "equals", "value": "signed_up" },
{ "field": "event.event", "operator": "equals", "value": "$identify" }
]
}For broad cuts, filter in the PostHog destination instead: an event PostHog never sends never reaches your Hookbase usage. Use Hookbase filters to split one PostHog source across several routes.
Headers
| Header | Format | Description |
|---|---|---|
webhook-signature | Standard Webhooks | v1, plus the base64 HMAC-SHA256 signature |
webhook-timestamp | Standard Webhooks | Unix timestamp (seconds), signed |
webhook-id | Both | Delivery id, the same on every retry of a delivery. Signed in Standard Webhooks only |
X-Hub-Signature-256 | HMAC-SHA256 of the body | sha256= plus the hex HMAC-SHA256 of the body |
PostHog sends Content-Type: application/json plus any headers you add to the destination. None of
these is replayed to your destination. A delivery to an HTTP destination carries Hookbase's own
X-Event-ID, X-Delivery-ID and
webhook-* signature headers, plus whatever
the destination is configured to add. Anything your handler needs should come out of the payload.
IP Addresses
PostHog Cloud sends destination requests from these addresses:
- US:
44.205.89.55,52.4.194.122,44.208.188.173,3.41.215.48/28 - EU:
3.75.65.221,18.197.246.42,3.120.223.253,3.40.9.80/28
You can add the ones for your region to the source's IP allowlist. Hookbase does not fill them in for you, because a self-hosted PostHog sends from its own addresses. The signature is what authenticates the request either way.
Troubleshooting
No Events Arriving
- Check that the destination is enabled and that its filters match the events you expect
- Open the destination's logs in PostHog. If the signing secret is not base64 of at least 24 bytes (Standard Webhooks), PostHog logs "Standard Webhooks signing failed" and sends nothing. The HMAC format needs at least 24 characters. Paste the secret Hookbase generated
- Check that the Webhook URL matches your ingest URL exactly, org and source slugs included
Signature Verification Failed
- Confirm the provider matches PostHog's Signature format:
posthogfor Standard Webhooks,posthog-hmacfor HMAC-SHA256 of the body. Acustomsource reads header names PostHog never sends in Standard Webhooks mode - Confirm the secret is identical on both sides. Rotate Secret in Hookbase makes a new value, so paste it into PostHog straight away
- Check that no custom header on the destination overwrites
webhook-signature,webhook-timestamporX-Hub-Signature-256
Duplicate Events
PostHog makes up to 3 attempts at a request when it times out, gets a 408, 429 or 5xx, or
fails at the network level. Every attempt carries the same webhook-id. On a source with
dedupEnabled: true, the default auto strategy uses it as the event id. A destination with no
signing secret sends no webhook-id, so deduplication falls back to hashing the payload.
Event Type Is Empty
The body has no event key Hookbase can read: a custom JSON body that renamed or dropped it. Add
"event": "{event}" or "event": "{event.event}" back to the body.