Response requirements
Your webhook endpoint must:
- Respond within 30 seconds or the request will timeout
- Return a
2xx status code (e.g., 200, 201, 204) to acknowledge successful receipt
- Not perform long-running operations before responding
If your endpoint doesn’t respond with a 2xx status within 30 seconds, Nomos
considers the delivery failed and will retry according to the exponential
backoff schedule below.
The recommended pattern is to:
- Verify the signature
- Store the event or queue it for processing
- Return a
2xx response immediately
- Process the event asynchronously
This ensures reliable delivery and prevents timeouts during processing.
Automatic retry strategy
If your endpoint returns a non-2xx status code or times out, Nomos automatically retries delivery with exponential backoff:
| Attempt | Delay |
|---|
| 1 | 1 minute |
| 2 | 2 minutes |
| 3 | 4 minutes |
| 4 | 8 minutes |
| 5 | 16 minutes |
| 6 | 32 minutes |
| 7 | 1 hour |
| 8 | 2 hours |
| 9 | 4 hours |
| 10 | 8 hours |
| 11 | 16 hours |
| 12 | 32 hours |
Maximum attempts: 12 retries over approximately 3 days.
Nomos stops retrying when your endpoint returns a successful 2xx response or after all retry attempts are exhausted.
Handling duplicate events
Due to retries and network conditions, your endpoint may occasionally receive the same event multiple times. Your implementation should be idempotent.
Recommended approaches:
- Store processed event IDs in a database and skip duplicates
- Use the event ID as an idempotency key in your system
- Design handlers that can safely process the same event multiple times
Event ordering
Nomos does not guarantee that events will be delivered in the order they
were generated.
Your application might receive events out of order. For example, when creating a subscription you might receive:
subscription.confirmed before subscription.created
invoice.finalized before subscription.confirmed
How to handle ordering:
- Design webhook handlers to process events independently
- Use the
timestamp field to determine event order if needed
- Query the API for the current state of resources
- Use event IDs to track which events you’ve processed