Webhooks
Milo tells your server when one of your bookings changes, so you never have to poll. Milo registers your endpoint on request and shows its signing secret (whsec_...) once.
Events
type |
Sent when |
|---|---|
booking.cancelled |
Any cancel of one of your bookings: by the club, for the weather, because Milo suspended or closed the club, and your own DELETE too. cancel_reason says which. |
booking.updated |
The club moved the booking to another court or time, or your PATCH changed the customer or external_customer_id. |
Each change is sent once per endpoint, with its own webhook-id. A PATCH that changes nothing sends nothing. Milo sends no event when you create a booking: the create's answer is the booking.
Bookings at your sandbox club go to your sandbox endpoints only; every other booking to your live endpoints only. A club that disconnected your app keeps sending you the events of the bookings you made there.
Your endpoint
httpson port 443, a DNS name (no IP address), no user and password in the URL, no query string or fragment.- Every address the name resolves to must be public. Milo resolves the name again before every attempt and connects to an address it checked.
- Milo follows no redirect: a 3xx counts as a failed attempt.
- Accept the connection within 5 seconds and answer with any 2xx within 10 seconds (5 seconds without a byte is a timeout). Do the work after you answered.
The request
POST with content-type: application/json and these headers (Standard Webhooks):
| Header | Value |
|---|---|
webhook-id |
The delivery id. The same on every retry of this delivery: deduplicate on it. |
webhook-timestamp |
Unix seconds when this attempt was sent. New on every attempt. |
webhook-signature |
v1,<base64>; two space-separated signatures for 24 hours after a secret rotation. |
POST /milo/webhooks HTTP/1.1
host: example.com
content-type: application/json
webhook-id: 0193a1c2-4d5e-7f60-8a9b-0c1d2e3f4a5b
webhook-timestamp: 1796401200
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
The body:
{
"id": "0193a1c2-4d5e-7f60-8a9b-0c1d2e3f4a5b",
"type": "booking.updated",
"created_at": "2026-12-04T16:20:00+00:00",
"data": {
"booking": {
"id": "01938a7f-0a1b-7c2d-8e3f-4a5b6c7d8e9f",
"status": "confirmed",
"court_id": "01938a7e-6c2d-7e3f-9a4b-5c6d7e8f9a01",
"start": "2026-12-05T18:00:00+00:00",
"end": "2026-12-05T19:30:00+00:00",
"customer": { "name": "J. Smith", "email": "j.smith@example.com", "phone": null },
"external_ref": "order-8812",
"external_customer_id": "user-4711",
"cancel_reason": null
}
}
}
id is the webhook-id. data.booking has the shape of GET /bookings/{id} (shortened above), rendered when the attempt is sent: it is the booking as it is then, not a diff. Compare it with what you stored to see what moved. A customer whose details Milo erased (90 days after the booking ended, or on request) reads "name": "erased".
cancel_reason on booking.cancelled: partner (you), admin (the club), weather (the club, for the weather), suspended (Milo suspended the club), wind_down (the club closed).
Verify the signature
The signed content is {webhook-id}.{webhook-timestamp}.{body} (the raw body, byte for byte), HMAC-SHA256 with the base64-decoded secret after the whsec_ prefix, base64-encoded, prefixed v1,. Accept the request when any signature in the header matches, and refuse a timestamp more than 5 minutes from your clock.
PHP:
function verify(string $secret, string $id, string $timestamp, string $body, string $header): bool
{
if (abs(time() - (int) $timestamp) > 300) {
return false;
}
$key = base64_decode(substr($secret, 6), true);
$expected = 'v1,'.base64_encode(hash_hmac('sha256', "$id.$timestamp.$body", $key, true));
foreach (explode(' ', $header) as $candidate) {
if (hash_equals($expected, $candidate)) {
return true;
}
}
return false;
}
Node:
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verify(secret, id, timestamp, body, header) {
if (!(Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300)) return false; // a non-numeric timestamp (NaN) fails too
const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
const expected = Buffer.from('v1,' + createHmac('sha256', key).update(`${id}.${timestamp}.${body}`).digest('base64'));
return header.split(' ').some((candidate) => {
const given = Buffer.from(candidate);
return given.length === expected.length && timingSafeEqual(given, expected);
});
}
Retries
Anything but a 2xx (including a timeout, a refused connection, a redirect, or a name that now resolves to a private address) is retried after about 30 s, 90 s, 4.5 min, 13.5 min, 40 min, 1 h, 1 h and 1 h: nine attempts over about four hours. After that Milo's operators see the delivery as failed and can send it again.
Delivery is at least once: Milo records the outcome after your answer, so a worker that stops between your 2xx and that record sends the delivery again, and an operator's retry can too. Deduplicate on webhook-id: a second request with an id you already processed gets a 2xx and nothing else. Events can arrive out of order; the booking in the body is always the latest. If you missed one, GET /bookings/{id} answers the booking as it is now; after an outage, GET /bookings?updated_since= lists every booking that changed (Bookings).
Rotate the secret
Ask Milo to rotate. You receive the new secret once; for 24 hours every delivery carries two signatures (the new and the previous secret), so you can switch without losing an event.