Payload
The webhook HTTP payload will include information both in its HTTP headers and its request body.Header
HMAC signature of the webhook payload.
Event which triggered this webhook request.
Onset workspace Id.
Body
Event which triggered this webhook request.
The actor who triggered the action. Could be a User, Visitor, or API.
Workspace ID
Webhook ID
UNIX timestamp when the webhook was sent.
Payload of the entity
Securing Webhooks
You should ensure that webhooks you received were sent by Onset. You can do this by verifying the webhook request signature and timestamp. Onset sends aOnset-Signature HTTP header with every webhook request. This header contains a hex-encoded HMAC-SHA256 signature of the raw body contents, signed using the webhook’s signing secret. You can find the signing secret on the webhook’s detail page.
The parsed JSON body has a webhookTimestamp field with a UNIX timestamp, in milliseconds, indicating the time when the webhook was sent. We recommend that you verify it’s within a minute of the time your system sees it to guard against replay attacks.
To verify the webhook, you need to compute the signature of the request body using the webhook’s signing secret and compare it against the Onset-Signature header. It’s strongly recommended to use raw request body rather than restringifying a parsed JSON body, otherwise the signature may differ. Once the signature has been validated, check to ensure that the webhook timestamp is reasonably current before processing the request:

