PostHog webhooks

PostHog webhooks are HTTP requests that PostHog's HTTP Webhook destination sends to your URL for each captured event that matches its filters.

These pages cover events PostHog sends out to your endpoint. To send webhooks from other tools into PostHog, see its incoming webhooks source.

How PostHog webhooks work

Webhooks push your analytics events to your own services as the data arrives, so you don't have to poll PostHog for them. You create a destination with a URL and filters, and for each matching event PostHog renders the destination's JSON body and sends it, as a POST by default. There's no payload version.

PostHog doesn't define a list of webhook events, because the destination forwards whatever your project captures, such as $pageview, $identify or your own signed_up. The body is yours to template too. The default is {event, person}, which puts the event name at event.event, and editing the template can move it.

Key facts

Signature header
webhook-signature

Not every delivery is signed: check your setup.

Scheme
HMAC-SHA256, base64
Signed material
{webhook-id}.{webhook-timestamp}.{raw body}

The two header values and the body as sent, joined with literal dots. The key is the secret base64-decoded, not the secret string.

How events are identified
event.event in the default body; your template can move it
Body format
JSON

Content type: application/json.

Send timestamp
webhook-timestamp
Other headers
content-type, webhook-id, webhook-timestamp
Agent skill
npx skills add hookdeck/webhook-skills --skill posthog-webhooks

Verify PostHog webhooks →

Setting up PostHog webhooks

  • In PostHog, open Data pipelines and click + New > Destination, search for "Webhook" and click + Create. Enter the Webhook URL, set the events you want in the Filters section, then click Create & Enable.
  • Generate a signing secret with echo "whsec_$(openssl rand -base64 32)" and paste it into the Signing secret input. PostHog doesn't issue one.
  • Test from the destination's Testing section: Start testing > Test function sends an example event, and Log responses helps with debugging. npx hookdeck-cli listen 3000 posthog --path /webhooks/posthog prints a URL that forwards to your machine. PostHog documents no way to resend a past delivery.
  • If a firewall protects your endpoint, allow PostHog's IPs for your region. EU: 3.75.65.221, 18.197.246.42, 3.120.223.253. US: 44.205.89.55, 52.4.194.122, 44.208.188.173.

Delivery behaviour

  1. Duplicate deliveries

    PostHog retries failed calls, so your handler can see the same event twice. On a signed destination, deduplicate on webhook-id, which stays the same across retries. On an unsigned one, use event.uuid from the default template.

    Handle duplicates →
  2. Destination disabled after prolonged failures

    A destination with too many errors or slow responses over a prolonged period is quarantined and eventually disabled. PostHog tries re-enabling it automatically before stopping it, after which you have to change it and re-enable it yourself.

    Retries and disabled destinations →
  3. A template edit breaks your receiver

    The body, method and headers are all editable in PostHog, so a change there reaches your endpoint with no deploy on your side. Validate the shape on receipt, and log and acknowledge bodies you don't recognise.

    Choosing events and the body →
  4. A bad signing secret stops delivery

    PostHog refuses to send a signed request if the secret isn't valid base64 or decodes to fewer than 24 bytes, and it logs the reason. Check the destination's logs if deliveries stop after you set a secret.

    Other PostHog limits →

PostHog webhook best practices

  • Set a Signing secret. Without one, your endpoint can't tell PostHog's requests from anyone else's. Use the whsec_ form and paste the same string on both sides.
  • Return a 2xx quickly. Repeatedly slow responses count against the destination, so store the event and do the work outside the request.
  • Deduplicate on the delivery id. webhook-id stays the same across retries of one delivery, while the timestamp and signature change on each attempt.
  • Filter at the destination. Send only the events you act on. High-volume events such as $pageview otherwise reach your endpoint too.
  • Reconcile after an outage. PostHog documents no redelivery once its retries run out, so query the events you missed from PostHog itself.
  • Keep the method as POST. With GET, PostHog sends no body but still signs the templated one, so the signature can't verify.

In this hub

MCP events → How an agent subscribes to PostHog events as MCP events.
Verify signatures → Signature facts, verification code and common failures.
Production guide → Production problems, such as timeouts and retries, and how to handle them.
Agent skill → Install the webhook skill in your coding agent. npx skills add hookdeck/webhook-skills --skill posthog-webhooks

Keep a slow endpoint from getting your PostHog destination disabled.

Hookdeck Event Gateway accepts every PostHog delivery, verifies its signature when you set one, queues events and retries to your service on your schedule.

Not affiliated with PostHog. Facts are compiled from public sources and linked inline.