Help Center/Webhooks & Events

Retry behavior and idempotency

4 min read Updated February 8, 2026

Retry Policy

If your endpoint returns a non-2xx status code or times out (30 seconds), ComplianceGrid retries the delivery with exponential backoff:

AttemptDelay After Failure
1st retry1 minute
2nd retry5 minutes
3rd retry30 minutes
4th retry2 hours
5th retry12 hours

After 5 failed retries, the event is marked as failed. You can manually retry failed events from the Developer Portal.

Idempotency

Because retries can cause duplicate deliveries, your webhook handler must be idempotent — processing the same event twice should produce the same result as processing it once.

Implementing Idempotency

Use the event id field to deduplicate:

javascript
const processedEvents = new Set(); // Use Redis or a database in production

app.post('/webhooks/compliancegrid', (req, res) => {
  const event = req.body;

  if (processedEvents.has(event.id)) {
    return res.status(200).json({ received: true, duplicate: true });
  }

  processedEvents.add(event.id);
  handleEvent(event);
  res.status(200).json({ received: true });
});

Best Practices

  • Return 200 quickly — Do heavy processing asynchronously after acknowledging receipt
  • Store event IDs in a database or Redis with a TTL of 7 days for deduplication
  • Log all events for debugging delivery issues
  • Monitor your endpoint — Set up alerts for elevated error rates
  • Handle unknown event types gracefully — return 200 even for events you don't process (new event types may be added)

Was this article helpful?