Skip to main content
FraudEG webhooks are HTTP POST callbacks that deliver fraud event data to your application the moment something significant happens — a transaction is flagged, an identity check completes, an account risk signal fires, or a case status changes. Rather than polling the FraudEG API repeatedly to check for updates, you register an endpoint once and FraudEG pushes events to you in real time. This is especially important for asynchronous workflows like identity verification, where the result may not be available for several seconds after the initial API call.

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_completed the moment a document review finishes, instead of polling GET /v1/identity/verify repeatedly
  • Account risk alerts — react to account.risk_detected events to suspend sessions or notify users before damage occurs
  • Dispute automation — update case queues automatically when case.updated events arrive
  • Fraud monitoring — route transaction.flagged and transaction.blocked events 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 200 OK response. Keep the handler lightweight — acknowledge the event immediately and process it asynchronously to avoid timeouts.
Node.js (Express)
Your endpoint must be reachable from the public internet. During local development, use a tunneling tool such as ngrok to expose your localhost.
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.
cURL
The response includes a 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 X-FraudEG-Signature request header. Always verify this signature before processing the event.
Use a timing-safe comparison (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 the data 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.
Always verify the X-FraudEG-Signature header before processing any webhook payload. Without signature verification, your endpoint will accept forged requests from any party who discovers its URL — allowing an attacker to inject fraudulent event data into your application. Never skip signature verification, even during development or testing.
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.