Skip to main content
Webhooks notify your backend when a booking changes, so you do not need to poll for every status transition. You can configure the same webhook features in the Unifystays portal or through the API.

Before You Start

  • Use a sandbox API key while developing and a production API key for live bookings.
  • Create endpoints separately in each environment. Sandbox events are never delivered to production endpoints, or vice versa.
  • Your destination must be a public HTTPS URL. URLs containing credentials, fragments, or private/internal hosts are rejected.
  • Return a 2xx response within 10 seconds. Process longer-running work asynchronously after acknowledging the request.

1. Create an Endpoint

The response includes a signing_secret. Store it in your secret manager when it is returned; it cannot be retrieved later.
Never log the signing secret or expose it in browser or mobile code. Webhook verification belongs in your backend.

2. Verify Every Request

Unifystays signs the exact request body with HMAC-SHA256. Verify the signature before parsing or processing the event, and reject stale timestamps to reduce replay risk. Implement signature verification

3. Send a Test Event

The endpoint must be ACTIVE. The API returns 202 Accepted with an event_id and delivery_id. Use the delivery ID to inspect the receiver’s HTTP response.

Event Types

Subscribe to individual event names or use booking.* for every booking event. Test deliveries use webhook.test and are sent only when you explicitly request a test.

Event Payload

For booking.cancellation_failed, data.cancellation_error contains the failure message. Treat payloads as forward-compatible: ignore fields you do not recognize and use schema_version when introducing version-specific handling.

Delivery Guarantees

Webhook delivery is at least once. A successful request may be delivered again, and events can arrive out of order.
  • Deduplicate using the top-level event id.
  • For booking state, apply only a payload whose data.object.version is newer than the version you have already processed.
  • Return any 2xx status after safely persisting or enqueueing the event.
  • Do not depend on delivery order.

Retries and Automatic Disabling

Failed deliveries are attempted up to eight times. Default delays after each failure are 1 minute, 5 minutes, 30 minutes, 2 hours, 8 hours, 24 hours, and 48 hours. A valid Retry-After response header is honored, capped at 48 hours. Re-activate a disabled endpoint by updating its status to ACTIVE, then replay any delivery you still need.

Logs and Retention

Delivery attempts record status, duration, safe response headers, an error, and up to 16 KiB of response body. Response headers and bodies are cleared after 30 days. Completed events and deliveries are retained for 90 days. Use List Webhook Deliveries for filtering and Get Webhook Delivery for the complete attempt history.