Skip to main content

Events

POST /v1/events scores one event. Required: event_id and event_type. Everything else is optional, but rules can only use what you send.

Example​

Request:

{
"event_id": "3f2b8c1e-5d47-4a9e-9c6b-0e1f2a3b4c5d",
"event_type": "payment",
"external_account_id": "user-1001",
"context": { "ip": "203.0.113.7", "user_agent": "Mozilla/5.0", "platform": "ios" },
"user": { "email": "jane@example.com" },
"payment": { "amount_cents": 4999, "currency": "EUR", "bin": "411111", "last4": "1234" }
}

Response, 200, for a project on the iGaming Standard preset (review at 30, block at 60). breakdown lists the evaluated rules; two are shown here, and enrichment_status is shortened:

{
"status": 1,
"data": {
"event_id": "3f2b8c1e-5d47-4a9e-9c6b-0e1f2a3b4c5d",
"decision": "allow",
"risk_score": 0,
"max_possible": 850,
"breakdown": [
{ "rule_id": "R-HB-WEB-NO-FP", "rule_name": "Web action without a device fingerprint", "score_delta": 0, "band": "hard_block", "matched": false, "reason": "R-HB-WEB-NO-FP" },
{ "rule_id": "R-MED-REP-SUSPICIOUS-PAYMENT-REF", "rule_name": "Suspicious wallet or IBAN", "rule_version": 1, "score_delta": 0, "band": "medium", "matched": false, "reason": "R-MED-REP-SUSPICIOUS-PAYMENT-REF" }
],
"flags": ["R-MON-FP-MISSING"],
"trust_override": false,
"hard_block_hit": false,
"enrichment_status": { "mx-check": "ok", "disposable-email": "ok", "maxmind": "ok" },
"account_public_id": "acc_01k3f7wz9re2xa8m4n0dpq5vjt",
"latency_ms": 12,
"environment": "sandbox"
},
"errors": []
}

Act on decision. The rest explains it.

Fields​

FieldNotes
event_idUUID you generate. The idempotency key.
event_typepayment, payout, login, registration, deposit, withdrawal, or custom for an action of your own.
event_nameRequired with custom, refused with any other type. See Custom events.
asynctrue to ingest and score in the background. Default false.
external_decisionallow, review or block: the verdict your current antifraud provider gave for the same action, while you run Defraudo alongside it. Stored next to our decision for comparison and never used in scoring. See Running alongside your current provider.
external_account_idYour id for the user (string, up to 64 chars; a number is accepted). Links events into one account. To use it in /v1/accounts/{id} URLs it may contain only letters, digits and . _ : @ -; otherwise use the acc_... id.
brand_idYour brand tag, up to 64 chars.
contextip, user_agent, fp_id, session_id, country, affiliate_id, session_anon, platform. Set platform to web for browser sessions, ios or android for native apps and their webviews, telegram for Telegram bots and Mini Apps, or other. Use web even for server-side calls made for browser sessions. Leave platform out when you do not know it.
telegramTelegram user ID, optional profile and referral fields, and optional Mini App verification data. See Telegram bot and Mini App.
useremail, phone (E.164 or national with user.country; an unparseable number is accepted and reported in enrichment_status.phone), name, country, registered_at, plus email_hash / phone_hash for callers that cannot send raw values, the declared marks trusted, vip, is_known_fraud, chargeback_flag, name_blocked, sanctions_match, and email_bounced (hard or full) once your own mail system reports a bounce for the address.
paymentamount_cents (integer), currency, method, bin, last4, billing_country, card_token (used for velocity counts only; card links and reputation use bin + last4), account_ref + account_ref_type (crypto_wallet, iban or other): the deposit or payout method itself. The same method on several accounts links them and feeds the shared-payment-method rules. It is stored only as a hash and a masked form such as IBAN ··3000; spaces, dashes and letter case in an IBAN do not matter, and EVM and Bech32 wallet addresses are matched case-insensitively. account_ref_type is a display label only: the same method sent with different types, or with none, is one method.
extrasFree-form object for project-specific signals.

Unknown top-level properties are rejected with 400; the context, user and payment objects accept extra fields. The full schema, with limits, is in the API reference.

caution

user.trusted, user.vip and the declared marks (is_known_fraud, chargeback_flag, name_blocked, sanctions_match) act through the rules of the project's preset: in the shipped presets trusted and vip allow with score 0 and the others hard-block, but an archived or shadow rule stops that. Set them only from data you trust.

Custom events​

For an action that is none of the built-in types (a bonus claim, a password change, a promo code), send event_type: "custom" and name it in event_name:

{
"event_id": "8d1e6f0a-2b3c-4d5e-8f90-a1b2c3d4e5f6",
"event_type": "custom",
"event_name": "bonus_claim",
"external_account_id": "user-1001",
"context": { "ip": "203.0.113.7" }
}
  • event_name: 1 to 64 characters, lowercase letters, digits and _, starting with a letter (bonus_claim, password_change).
  • A new name is registered with the first event accepted under it. A project can have up to 100 active names; a new name beyond that is refused with 400 EVENT_NAME_LIMIT, while names already in use keep working.
  • A custom event is scored like any other and comes back with the same result. The name is in the sync response (event_name), in GET /v1/scores/{event_id} and in decision webhooks.
  • Rules can count events of one name over a window (for example, 3 bonus_claim events for one account within 24 hours) and check the name of the current event. A count is checked on every event of the account, so add the condition event_name = bonus_claim when the rule must fire only on that event.
  • Two more refusals exist for projects whose names are managed: EVENT_NAME_ARCHIVED for an archived name and EVENT_NAME_UNLISTED for a name that is not on the project's list. Both refuse a new event with 400, and nothing is scored or stored; an exact retry of an event that was already scored still returns its verdict.
  • Resending an event_id with a different event_name is a different body: 409 EVENT_ID_CONFLICT.

Idempotency​

event_id is the idempotency key. Resending the same sync request does not score twice and returns the stored result (without degraded, latency_ms and account_public_id when it is rebuilt from storage). Sending the same event_id with a different body returns 409 EVENT_ID_CONFLICT; the async flag is not part of the compared body. A repeated async request returns a new 202 receipt. After a 500 or 503, retry the same event_id and body.

Sync and async​

Sync is the default and returns 200 with the decision. With "async": true you get 202 and an accepted_at receipt; read the result with GET /v1/scores/{event_id} (pending until scored) or through the decision webhook. See How it works.

Reading the result​

FieldMeaning
decisionallow, review or block.
risk_scoreThe score, never below 0. A hard block sets decision to block without changing it.
max_possibleThe sum of all positive deltas of active scoring rules. A scale for display, not always an attainable score.
breakdownOne entry per evaluated rule, matched or not: rule_id, rule_name (the rule's readable name, when it has one), rule_version (the version of that rule, optional), score_delta (0 when not matched), band, matched and reason. A matched rule that requests an action also has action. Shadow rules are left out. On a trust verdict only the winning rule is listed; on a hard block the scoring rules are listed too; a matched scoring rule with stop_on_match skips the remaining scoring rules (hard-block rules are still checked), so those are not listed.
flagsrule_ids of matched monitoring rules.
actionsPresent only when non-empty: actions requested by matched active rules. The only supported form is require_kyc:<phone|document|liveness|sanctions|pep>.
trust_override, hard_block_hitEvaluation ended early on a trust or hard-block rule.
degradedPresent when an active rule could not read a signal as written. See fail-closed behaviour.
enrichment_statusOne key per enrichment provider with its outcome (ok, unconfigured, error); phone reports the phone parse and can be unparseable. Usually present when the event carried something to enrich, such as an email or IP; absent if enrichment failed outright.
environmentlive or sandbox: the environment of the key.
account_public_idThe resolved account id (acc_...), usually present when you sent external_account_id. Not returned by GET /v1/scores.
latency_msRule evaluation time only. Not returned by GET /v1/scores.

Show rule names to your analysts​

breakdown[].reason is technical: it is the same string as rule_id, not text for people. To show a readable label, use breakdown[].rule_name. A rule with no name has no rule_name; show its rule_id then. GET /v1/rules returns the same name in name.

Reading an event back​

GET /v1/events/{event_id} returns an event you sent, by your event_id, together with its verdict. It needs the scores:read scope.

  • The event as stored: event_id, event_public_id, event_type, event_name, external_account_id, account_public_id, brand_id, external_decision, received_at, context (IP, user agent, session, platform, fp_id, affiliate, country, region, city), payment (with its latest reported status for a money event), telegram.
  • user.email and user.phone come back masked, when a mask was stored for them. Raw email and phone, names, hashes and extras are never returned.
  • score is the same object GET /v1/scores/{event_id} returns: the decision with its breakdown, or status: "pending" while the event has no score yet.
  • The lookup is scoped to the key's project, so a sandbox key never reads a live event or the reverse: an event of another project answers 404, exactly like an event_id that was never sent.
  • 400 for an event_id that is not a UUID or an unknown query parameter, 401 for a missing or invalid key, 403 for a key without scores:read, 429 when the rate limit is hit.

Final payment status​

We score a deposit, withdrawal, payment or payout before the money moves. Once you know how it ended, report it:

POST /v1/events/{event_id}/status
{ "status": "completed", "occurred_at": "2026-11-09T16:43:07Z", "reason": "optional, up to 200 chars" }
FieldNotes
event_id (path)The event_id you sent to POST /v1/events.
statuscompleted, failed, cancelled or rolled_back.
occurred_atWhen it happened on your side. Optional, defaults to now; at most 5 minutes in the future.
reasonOptional free text, up to 200 characters. No card numbers.

The response is 200 with event_id, status, occurred_at, recorded_at (when we received it) and updated.

  • Only money events (deposit, withdrawal, payment, payout); any other type returns 400 EVENT_NOT_PAYMENT.
  • The first status can be any of the four. After that only completed → rolled_back is allowed; anything else returns 409 PAYMENT_STATUS_FINAL.
  • Sending the same status again is safe: 200 with updated: false, nothing changes.
  • A new attempt of a payment is a new event with a new event_id. Partial refunds are not reported here.
  • 404 NOT_FOUND means we have no such event in the key's project and environment. A sync POST /v1/events still in progress is stored only when it answers, so retry the status after that response; an async event accepts a status as soon as you got its 202.
  • The status never changes the event's score, decision, case or webhooks.

Linked accounts and erasure​

  • GET /v1/accounts/{id}/links returns a flat links array of accounts sharing an email, phone, fp, ip_24h or card signal with this one; each entry has a signal_type. There is no time filter, so older IP links are included. {id} is the acc_... id or your own external_account_id. Signals are shown masked.
  • DELETE /v1/accounts/{id} erases an account (GDPR). It needs a live key and the accounts:erase scope.