# RelayDesk Webhook Delivery Guide

> Classification: **SYNTHETIC DEMO**. RelayDesk is fictional and this guide makes no client or production claim.

## Delivery contract

RelayDesk sends JSON over HTTPS. Each event has an immutable UUID, an ISO-8601 timestamp, a type and a versioned data object. Receivers should acknowledge a persisted event with any `2xx` response within five seconds.

## Signature verification

1. Read the raw request bytes before JSON parsing.
2. Reject timestamps more than five minutes away from the local clock.
3. Compute `HMAC-SHA256(secret, timestamp + "." + rawBody)`.
4. Compare the encoded digest in constant time.
5. Persist the event ID under a unique constraint before side effects.

## Retry schedule

Network failures, `408`, `409`, `425`, `429` and `5xx` responses are retried with bounded exponential backoff. Other `4xx` responses are final because the receiver must change configuration or code. Delivery stops after 24 hours and moves to the dead-letter queue.

## Receiver states

`RECEIVED -> VERIFIED -> PERSISTED -> PROCESSED`. `REJECTED_SIGNATURE` and `REJECTED_SCHEMA` are final. `PROCESSING_FAILED` can be replayed by an authorized operator after the cause is recorded.

## Troubleshooting fields

Always log event ID, delivery ID, attempt, event type, schema version, response class, duration and correlation ID. Never log the signing secret or unredacted sensitive payload fields.
