API reference
Integrations
Inbound webhooks from other tools.
Receive PostHog events#
post/webhooks/posthog
Target for a PostHog webhook destination. Server to server: no CORS or Allowed origin. Field limits match POST /events, but long values are cut rather than refused so a delivery is never rejected for length. Events for erased end users are dropped and counted under suppressed.
Parameters
?publicKeystringrequiredThe project's public key (part of the webhook URL Tug shows you).
Body
eventobjectrequired
uuidstringPostHog's event id. Stored as the idempotency key (
ph:<uuid>), so retries are stored once. Send it.eventstringrequiredEvent name. Longer than 200 characters is cut.
distinct_idstringrequiredPostHog distinct id. Longer than 256 characters is cut.
timestampstringWhen it happened, ISO 8601. Defaults to when Tug receives it.
propertiesobject | stringProperties, or a JSON string of them.
$-prefixed keys are dropped except $current_url, which becomes url (cut to 2048 characters). Nested objects and arrays are dropped. Tug adds source: "posthog".
curl -X POST "https://tughq.com/api/v1/webhooks/posthog?publicKey=phk_live_3kV9xQmR2pT8wYc1Ld5NbA" \
-H "X-Tug-Webhook-Secret: fwh_q8Zr3mN6vB1xK4cT7yW0pL2s" \
-H "Content-Type: application/json" \
-d '{
"event": {
"uuid": "01936f0e-5a7b-7c3d-9e1f-2a3b4c5d6e7f",
"event": "signup_completed",
"distinct_id": "user_abc",
"timestamp": "2026-11-22T12:00:00.000Z",
"properties": {
"plan": "pro"
}
}
}'200 response · JSON
{
"ok": true,
"accepted": 1,
"suppressed": 0
}