Webhooks: Delivery, Security, and Best Practices
Webhooks
SendPromptly can fan out one event to multiple webhook endpoints so downstream systems stay in sync with customer-facing notifications.
Delivery model
- One delivery run per configured endpoint
- Success is any HTTP 2xx response
- Non-2xx responses are retried with exponential backoff
- Delivery attempts are visible in logs for debugging and replay workflows
Webhook delivery is at-least-once, so consumers should be idempotent.
Signature headers
Validate these headers before processing payloads:
X-SP-TimestampX-SP-Signature
Use HMAC-SHA256 over the raw request body and compare signatures in constant time.
Security checklist
- Verify signature before parsing or mutating payload data.
- Enforce a replay window using
X-SP-Timestamp. - Reject stale or missing signature headers.
- Return fast
2xxresponses and move heavy work to async jobs.
Consumer reliability checklist
- Use idempotency keyed by event id or delivery id.
- Implement dead-letter handling for repeated failures.
- Track endpoint latency and failure rate by event key.
- Alert on sustained retry spikes.
Minimal handler pattern
- Receive request and capture raw body.
- Verify signature and timestamp tolerance.
- Persist event metadata for traceability.
- Enqueue asynchronous processing.
- Return
200quickly.