Why use webhooks
Webhooks let you act on fraud signals without building polling loops or accepting latency in your response flows. Key use cases include:- Async KYC completion — receive
identity.verification_completedthe moment a document review finishes, instead of pollingGET /v1/identity/verifyrepeatedly - Account risk alerts — react to
account.risk_detectedevents to suspend sessions or notify users before damage occurs - Dispute automation — update case queues automatically when
case.updatedevents arrive - Fraud monitoring — route
transaction.flaggedandtransaction.blockedevents into your SIEM or alerting pipeline
Setup guide
1
Create a webhook endpoint in your application
Add a route to your application that accepts HTTP POST requests and returns a Your endpoint must be reachable from the public internet. During local development, use a tunneling tool such as ngrok to expose your localhost.
200 OK response. Keep the handler lightweight — acknowledge the event immediately and process it asynchronously to avoid timeouts.Node.js (Express)
2
Register your endpoint via POST /v1/webhooks
Call the webhook registration endpoint with your URL and the list of event types you want to receive. You can register multiple endpoints and subscribe each to a different set of events.The response includes a
cURL
webhook_id and a secret — store the secret securely in your environment variables. You will use it to verify incoming payloads.3
Verify webhook signatures
FraudEG signs every webhook payload with HMAC-SHA256 using the secret returned at registration. The signature is included in the Use a timing-safe comparison (
X-FraudEG-Signature request header. Always verify this signature before processing the event.timingSafeEqual in Node.js, hmac.compare_digest in Python) to prevent timing attacks that could allow an attacker to forge valid signatures.4
Respond with HTTP 200 within 5 seconds
FraudEG considers a delivery successful when your endpoint returns any
2xx status code within 5 seconds of sending the request. If your response takes longer than 5 seconds, FraudEG marks the delivery as failed and schedules a retry — even if your application eventually processes the event correctly. Return 200 as the first thing your handler does, then process the payload out of band.5
Process events asynchronously
After acknowledging receipt, route the event payload to your processing logic. Parse the
event_type field and dispatch to the appropriate handler.Node.js
Webhook event types
FraudEG emits the following event types. Subscribe only to the events relevant to your integration.Webhook payload structure
Every webhook payload follows a consistent envelope structure. Event-specific data is nested inside thedata field.
Retry policy
If your endpoint returns a non-2xx response or does not respond within 5 seconds, FraudEG retries the delivery with exponential backoff:
After five failed retries, FraudEG marks the delivery as permanently failed and stops retrying. You can view and manually replay failed deliveries from the Webhooks section of the FraudEG dashboard.
Viewing delivery logs
Every webhook delivery attempt — successful or failed — is logged in your FraudEG dashboard under Developers → Webhooks → Delivery Logs. Each log entry shows the event type, delivery timestamp, HTTP response code your endpoint returned, and response body. Use delivery logs to debug endpoint issues, confirm receipt of specific events, and manually replay failed deliveries during incident recovery.Use the
event_id field to deduplicate events in your processing logic. Because FraudEG retries failed deliveries, your handler may receive the same event more than once. Store processed event_id values and check for duplicates before applying any state changes, especially for actions like unlocking accounts, approving verifications, or crediting funds.