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
| Field | Notes |
|---|---|
event_id | UUID you generate. The idempotency key. |
event_type | payment, payout, login, registration, deposit, withdrawal, or custom for an action of your own. |
event_name | Required with custom, refused with any other type. See Custom events. |
async | true to ingest and score in the background. Default false. |
external_decision | allow, 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_id | Your 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_id | Your brand tag, up to 64 chars. |
context | ip, 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. |
telegram | Telegram user ID, optional profile and referral fields, and optional Mini App verification data. See Telegram bot and Mini App. |
user | email, 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. |
payment | amount_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. |
extras | Free-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.
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
400EVENT_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), inGET /v1/scores/{event_id}and in decision webhooks. - Rules can count events of one name over a window (for example, 3
bonus_claimevents 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 conditionevent_name=bonus_claimwhen the rule must fire only on that event. - Two more refusals exist for projects whose names are managed:
EVENT_NAME_ARCHIVEDfor an archived name andEVENT_NAME_UNLISTEDfor a name that is not on the project's list. Both refuse a new event with400, and nothing is scored or stored; an exact retry of an event that was already scored still returns its verdict. - Resending an
event_idwith a differentevent_nameis a different body:409EVENT_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
| Field | Meaning |
|---|---|
decision | allow, review or block. |
risk_score | The score, never below 0. A hard block sets decision to block without changing it. |
max_possible | The sum of all positive deltas of active scoring rules. A scale for display, not always an attainable score. |
breakdown | One 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. |
flags | rule_ids of matched monitoring rules. |
actions | Present 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_hit | Evaluation ended early on a trust or hard-block rule. |
degraded | Present when an active rule could not read a signal as written. See fail-closed behaviour. |
enrichment_status | One 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. |
environment | live or sandbox: the environment of the key. |
account_public_id | The resolved account id (acc_...), usually present when you sent external_account_id. Not returned by GET /v1/scores. |
latency_ms | Rule 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 reportedstatusfor a money event),telegram. user.emailanduser.phonecome back masked, when a mask was stored for them. Raw email and phone, names, hashes andextrasare never returned.scoreis the same objectGET /v1/scores/{event_id}returns: the decision with itsbreakdown, orstatus: "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 anevent_idthat was never sent. 400for anevent_idthat is not a UUID or an unknown query parameter,401for a missing or invalid key,403for a key withoutscores:read,429when 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" }
| Field | Notes |
|---|---|
event_id (path) | The event_id you sent to POST /v1/events. |
status | completed, failed, cancelled or rolled_back. |
occurred_at | When it happened on your side. Optional, defaults to now; at most 5 minutes in the future. |
reason | Optional 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 returns400 EVENT_NOT_PAYMENT. - The first status can be any of the four. After that only
completed→rolled_backis allowed; anything else returns409 PAYMENT_STATUS_FINAL. - Sending the same status again is safe:
200withupdated: 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_FOUNDmeans we have no such event in the key's project and environment. A syncPOST /v1/eventsstill 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 its202.- The status never changes the event's score, decision, case or webhooks.
Linked accounts and erasure
GET /v1/accounts/{id}/linksreturns a flatlinksarray of accounts sharing anemail,phone,fp,ip_24horcardsignal with this one; each entry has asignal_type. There is no time filter, so older IP links are included.{id}is theacc_...id or your ownexternal_account_id. Signals are shown masked.DELETE /v1/accounts/{id}erases an account (GDPR). It needs a live key and theaccounts:erasescope.