Skip to main content
WebhookReceiver is for customers using push mode: when your product is configured with a forward_url, the connector POSTs events to your endpoint as JSON. WebhookReceiver handles signature verification, JSON parsing, and dispatching to typed callbacks — giving you the same ActionsPayload / SummaryPayload interface that SSE users get from AsyncConnectorClient. Use it when you want the connector to push events to your server rather than your server pulling from the SSE stream.

How push mode works

Every POST includes an X-Connector-Signature header for verification:

Setup (FastAPI)


Setup (Flask / sync)


Constructor

secret
string
default:"\"\""
HMAC-SHA256 signing secret configured on the connector (integration_config.secret). Pass an empty string to skip verification — useful in development but not recommended in production.
on_actions
Callable[[ActionsPayload], None]
default:"None"
Sync or async callback called for every actions event. Can also be registered via .on_actions(fn) after construction.
on_summary
Callable[[SummaryPayload], None]
default:"None"
Sync or async callback called for every summary event. Can also be registered via .on_summary(fn) after construction.

Builder interface

Both callback registration methods return self for chaining:

Core methods

await .handle(body, signature_header) — async

Verify, parse, and dispatch. Use with FastAPI, Starlette, aiohttp, or any async framework.
Raises ValueError if the signature is invalid. Returns the parsed ActionsPayload or SummaryPayload, or None if the event type is unrecognised.

.handle_sync(body, signature_header) — sync

Same behaviour but synchronous. Use with Flask, Django, or any sync framework. Callbacks must be synchronous.

.verify(body, signature_header)bool

Check the HMAC-SHA256 signature without parsing or dispatching.

.parse(body)ActionsPayload | SummaryPayload | None

Parse raw bytes into a typed payload without verifying the signature or dispatching callbacks.

API reference

MethodReturnsDescription
.on_actions(fn)selfRegister actions callback (sync or async)
.on_summary(fn)selfRegister summary callback (sync or async)
await .handle(body, sig)AnyPayload | NoneVerify + parse + dispatch (async)
.handle_sync(body, sig)AnyPayload | NoneVerify + parse + dispatch (sync)
.verify(body, sig)boolHMAC signature check only
.parse(body)AnyPayload | NoneParse bytes to typed payload, no verification