Skip to main content
OnTime posts to an HTTPS endpoint you control when certain things happen. It is the only push mechanism — there is no email, SMS or notification fan-out to external systems.

Registering

In the admin console: API & webhooks → Register webhook. Requires api:manage. Give the endpoint URL and choose which of the nine events to subscribe to.
The signing secret is shown exactly once. Store it before you close the dialog. Losing it means deleting the webhook and registering a new one.
Webhook registration is an admin-console action. There is no public endpoint for a third party to self-register a webhook.

What a delivery looks like

Headers

string
The event type, e.g. leave.approved.
uuid
The delivery ID. Stable across every retry of the same delivery — this is your deduplication key.
string
sha256= followed by the hex HMAC-SHA256 of the raw request body, keyed with your signing secret.

Payload

The payload is a notification, not the domain object. It tells you that something happened and gives you a reference to it — it does not embed the leave request, the payslip or the message.Treat a webhook as a trigger: receive it, then fetch what you need. The ref.id is the affected record’s ID and data.recipientId is the employee it concerns.

Verifying the signature

Compute HMAC-SHA256 over the raw request body — the exact bytes, before any JSON parsing — and compare in constant time.
Sign the raw bytes. Parsing JSON and re-serialising it changes key order and whitespace, and the signature will never match. Most frameworks need explicit configuration to hand you the raw body.

Deduplicate

Deliveries are at least once. Record the X-Ontime-Delivery value and ignore a repeat.

Retries, failure and replay

Return 2xx before doing any work. A slow handler risks the 30-second timeout, which OnTime reads as a failure — so slow processing manufactures the duplicates you are trying to avoid.

Operating a consumer

1

Monitor it yourself

The webhook’s status flips to Failing on the first failed attempt, but the OnTime alert only fires after all eight retries — about 22 hours later. Do not rely on it to tell you your endpoint is down.
2

Handle unknown event types gracefully

Return 2xx for an event you do not recognise rather than erroring. An unrecognised event that you reject will be retried eight times.
3

Rotate the secret by re-registering

There is no rotate action. Register a second webhook, cut over, then delete the first.
See The outbox and delivery for how the guarantee is implemented.