Skip to main content
Webhooks let you subscribe to LimitGuard events and receive real-time HTTP POST notifications to your server the moment something changes — a trust score update, a new compliance alert, or a certificate issuance. Instead of polling the API, your system reacts instantly.
Webhooks require an API key with the starter tier or above. Sandbox webhooks fire with simulated payloads and do not count against your quota.

How It Works

Every time an event occurs in the LimitGuard platform, we send an HTTP POST request to each registered endpoint with a JSON payload describing what happened. Your server responds with HTTP 200 to acknowledge receipt. If delivery fails, we retry with exponential backoff. Each request includes an X-LimitGuard-Signature header containing an HMAC-SHA256 signature computed from the raw request body using the webhook secret returned at registration. Always verify this signature before processing the payload.

Setup

1

Register your endpoint

Send a POST /v1/webhooks request with your HTTPS URL and the event types you want to receive.
Response (201 Created)
The secret is returned once only at creation and is never shown again. Store it immediately in a secure secret manager (e.g., AWS Secrets Manager, HashiCorp Vault, or a .env file that is never committed to source control).
2

Verify the signature

Before processing any webhook payload, verify that it genuinely came from LimitGuard by computing the expected HMAC-SHA256 signature and comparing it to the value in the X-LimitGuard-Signature header.
Always verify signatures using a constant-time comparison (hmac.compare_digest in Python, crypto.timingSafeEqual in Node.js). Standard string equality (===) is vulnerable to timing attacks.
3

Handle the event

Each webhook payload follows a consistent envelope structure. Dispatch on event.type:
Payload Envelope
Use the event id field (evt_...) as an idempotency key. Store processed event IDs in your database to safely deduplicate retried deliveries.

Event Types

Subscribe to All Events

Pass "events": ["*"] to receive every event type, including future additions.
New event types may be added as LimitGuard adds data sources. Subscribing to ["*"] is the easiest way to stay current, but ensure your handler ignores unknown types gracefully.

Signature Verification

Every webhook request includes two headers:

Computing the Signature

The X-LimitGuard-Signature header value is formatted as sha256=<hex_digest>.

Replay Attack Prevention

Compare the X-LimitGuard-Timestamp header against your server’s current time. Reject deliveries older than 5 minutes to prevent replay attacks:
Python

Retry Logic

If your endpoint returns anything other than a 2xx status code, or if the connection times out, LimitGuard retries delivery with exponential backoff: After 4 failed attempts, the event is marked as undelivered and no further retries occur. You can replay undelivered events from the dashboard or by sending a test event. Timeout: LimitGuard waits up to 10 seconds for your server to respond. Respond with 200 immediately and process the payload asynchronously.
If your endpoint consistently fails (>10 consecutive failures), the webhook is automatically deactivated to protect system stability. You’ll receive an email notification. Re-enable it from the dashboard or by POSTing to POST /v1/webhooks/{webhook_id}/enable.

Managing Webhooks

List Active Webhooks

Remove a Webhook

curl
Returns 204 No Content on success. The endpoint immediately stops receiving deliveries.

Testing

Use the test endpoint to fire a simulated event to your webhook without triggering a real check:
Response
Test events include a realistic synthetic payload using the Acme Corp BV sandbox entity. The signature is computed using your real webhook secret, so your full verification stack is exercised.
Run the test endpoint from your CI/CD pipeline after deployment to verify your webhook handler is reachable and returning 200 before going live.

Best Practices

Respond Immediately, Process Asynchronously

Acknowledge the delivery within 10 seconds by returning 200 OK before doing any meaningful work. Offload processing to a background queue (Celery, BullMQ, SQS, etc.):
Python

Implement Idempotency

LimitGuard may deliver the same event more than once on retry. Use the id field as an idempotency key:
Python

Forward-Compatible Event Handling

New event types will be introduced as LimitGuard adds capabilities. Always handle unknown types gracefully rather than raising an exception:
Python

Validate Event Data

Even after signature verification, validate required fields before using them:
Python

Use HTTPS with a Valid Certificate

LimitGuard only delivers to https:// endpoints with a valid TLS certificate. Self-signed certificates and http:// URLs are rejected at registration time.
Error (400 Bad Request)

Webhook Payload Reference

All event payloads share the same outer envelope:

Next Steps

API Reference: Webhooks

Interactive playground for all four webhook endpoints

Rate Limits

Understand quota limits and how they apply to webhook-triggering calls

Error Handling

Complete error catalog — including webhook delivery failures

Sandbox

Test your webhook handler with deterministic sandbox payloads