API reference
Every endpoint of the Risk API, with the scope it needs, the fields it takes and a real request and response. Base URL https://risk.ausbab-secops.com; send Authorization: Bearer rk_... and Content-Type: application/json on every call. Errors are listed in the overview.
| Method and path | Scope | Purpose |
|---|---|---|
POST /v1/risk/assess | risk:assess | Score a login, signup, password reset, value-out or payment |
GET /v1/risk/assessments/{assessment_id} | risk:assess | Read a stored decision back |
POST /v1/risk/events | risk:events | Report the outcome of an assessed attempt |
POST /v1/risk/labels | risk:labels | Report ground truth: fraud or legitimate |
POST /v1/risk/wallet-events | risk:wallet | Record ledger events |
POST /v1/risk/settlements | risk:wallet | Record the payment provider's settlement lines |
POST /v1/risk/merchants | risk:wallet | Set a merchant's tier and onboarding date |
GET /v1/risk/merchants/{merchant_id} | risk:assess | Is this merchant's value-out on hold? |
POST /v1/risk/payment-events | risk:payments | Report what happened to a payment |
POST /v1/risk/assess
Scores one attempt. The event_type picks the kind of decision.
Login, signup and password reset
| Field | Type | Notes |
|---|---|---|
event_type | string, required | login, signup or password_reset |
ip | string, required | The end user's IPv4 or IPv6 address |
account | string | Username, email or your user ID, up to 256 characters. Required for login and password_reset |
email | string | Signup only. A signup needs account or email |
device_id | string | A stable device cookie, up to 128 characters |
user_agent | string | Up to 512 characters |
headers | object | Selected browser headers: accept, accept-language, accept-encoding, sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, sec-fetch-site, sec-fetch-mode, sec-fetch-dest, origin, referer. Others are ignored |
Optional header: Idempotency-Key, up to 128 characters.
{
"event_type": "login",
"account": "[email protected]",
"ip": "203.0.113.10",
"device_id": "9f3c2a7e-device-cookie",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/131.0 Safari/537.36",
"headers": {"accept-language": "en-CA,en;q=0.9"}
}{
"assessment_id": "ra_01a2347758834f0557d137b39927",
"score": 3,
"decision": "allow",
"reasons": [],
"policy": {"ruleset_version": 0, "model": "points-v1", "mode": "shadow"},
"case_id": null,
"shadow_decision": "allow"
}In enforce mode, a device trying many accounts from one IP is denied and a case is opened:
{
"assessment_id": "ra_01a2347758a00e1dbda70118d8cf",
"score": 98,
"decision": "deny",
"reasons": [
{
"code": "DEVICE_MANY_ACCOUNTS",
"contribution": 51.4,
"detail": "This device was used with 12 different accounts in 24 hours",
"evidence": {"distinct_accounts": 12}
},
{
"code": "IP_MANY_USERNAMES",
"contribution": 43.6,
"detail": "This IP tried 12 different accounts in 10 minutes",
"evidence": {"distinct_accounts": 12, "scope": "IP", "window_s": 600}
}
],
"policy": {"ruleset_version": 1, "model": "points-v1", "mode": "enforce"},
"case_id": "case_01a2347758a120a0bbf4ec2464c0"
}| Response field | Meaning |
|---|---|
assessment_id | ra_.... Name it when you report the outcome |
score | 0 to 100. null only when degraded |
decision | allow, challenge (step up: MFA or an email code), review (allow but look, or step up) or deny. Always allow in shadow mode |
shadow_decision | Shadow mode only: what SecOps would have decided |
reasons | Each with a code, the points it added (contribution, negative lowers the score), a plain detail and evidence |
policy | ruleset_version, model and mode (shadow or enforce) |
case_id | Set when a review or deny opened a case (enforce mode) |
degraded | true when the engine failed and answered allow |
idempotent_replay | true when this is the stored answer to a repeated Idempotency-Key |
Value-out (wallets)
Ask before airtime, data, a bill payment, a transfer or a withdrawal leaves. Amounts are decimal strings in the currency's major unit, never floats.
| Field | Type | Notes |
|---|---|---|
event_type | string, required | value_out |
merchant_id | string, required | Your opaque merchant or wallet ID, up to 128 characters. Never an email address or card number |
amount | string, required | For example "4500.00" |
currency | string, required | ISO 4217, for example NGN |
product | string, required | airtime, data, bill, transfer, withdrawal or other |
counterparty | string | Recipient phone number or account, up to 64 characters. Pseudonymised on arrival |
reference | string | Up to 128 characters |
{
"event_type": "value_out",
"merchant_id": "mch_10293",
"amount": "4500.00",
"currency": "NGN",
"product": "airtime",
"counterparty": "+2348031234567"
}{
"assessment_id": "wa_01a2347a086a870c9e45a0965d07",
"event_type": "value_out",
"decision": "allow",
"step_up": false,
"score": 22,
"reasons": [
{
"code": "CREDIT_THEN_CASHOUT",
"contribution": 19.3,
"detail": "Most of a new credit is being spent on value-out within minutes",
"evidence": {"credits_in_window": "5000.00", "value_out_in_window": "4500.00", "window_minutes": 30}
}
],
"policy": {"ruleset_version": 0, "model": "points-v1", "mode": "shadow"},
"shadow_decision": "allow"
}decision is allow (ask for a second factor first when step_up is true), hold (don't send; the merchant's value-out is frozen until an analyst releases it) or deny.
Payments
Ask before you send a payment to your processor, then act on recommended_action. Identify the card only by your provider's fingerprint (Stripe card.fingerprint, Braintree unique_number_identifier, Adyen card alias), plus the BIN and issuing country if you have them. Fields not listed here are refused.
| Field | Type | Notes |
|---|---|---|
event_type | string, required | payment |
amount, currency | string, required | Decimal string and ISO 4217 code |
payment_method | object, required | type (card, wallet, bank_transfer, bnpl, other), fingerprint (required for cards), bin (first 6 or 8 digits), country, wallet |
order_id, customer_id | string | Up to 128 characters. Leave customer_id out for guest checkout |
email | string | Pseudonymised on arrival |
ip, device_id | string | The shopper's IP and device cookie |
billing_country | string | ISO 3166 two-letter code |
shipping | object | country and postal_code (pseudonymised) |
promo_code | string | Pseudonymised on arrival |
channel | string | web (default), app, phone, pos or other |
{
"event_type": "payment",
"order_id": "ord_88121",
"customer_id": "cus_4410",
"email": "[email protected]",
"ip": "203.0.113.10",
"device_id": "9f3c2a7e-device-cookie",
"amount": "129.00",
"currency": "CAD",
"payment_method": {"type": "card", "fingerprint": "Xt5EWLLDS7FJjR1c", "bin": "453201", "country": "CA"},
"billing_country": "CA",
"shipping": {"country": "CA", "postal_code": "M5V 2T6"}
}{
"assessment_id": "pa_EfPSS2LVbGMy6DVH",
"event_type": "payment",
"score": 3,
"decision": "allow",
"recommended_action": "approve",
"reasons": [],
"policy": {"ruleset_version": 0, "model": "points-v1", "mode": "shadow"},
"case_id": null,
"shadow_decision": "allow"
}recommended_action: approve (authorise as normal), require_3ds (authorise with 3-D Secure), review (hold the order for an analyst, don't capture) or decline (don't send it to the processor).
GET /v1/risk/assessments/{assessment_id}
Reads a stored login, signup or reset decision back. A decision can take up to a second to become readable.
{
"assessment_id": "ra_01a2347758834f0557d137b39927",
"event_type": "login",
"score": 2.9312230751356316,
"decision": "allow",
"effective_decision": "allow",
"mode": "shadow",
"reasons": [],
"policy_version": 0,
"model": "points-v1",
"created": 1795000000.0
}decision is what the policy decided; effective_decision is what was returned to you (allow in shadow mode). An unknown ID answers 404 not_found.
POST /v1/risk/events
Reports what happened after an assessment, within one hour. Each outcome is counted once per assessment: a repeat answers 200 with duplicate: true.
| Field | Type | Notes |
|---|---|---|
assessment_id | string, required | From the assess response |
outcome | string, required | login_succeeded, login_failed, unknown_user, mfa_passed, mfa_failed, account_created, signup_rejected, reset_requested or reset_completed |
{"assessment_id": "ra_01a2347758834f0557d137b39927", "outcome": "login_succeeded"}{"assessment_id": "ra_01a2347758834f0557d137b39927", "outcome": "login_succeeded"}When the outcome itself is risky, such as a correct password after a run of failures, the response also carries post_auth (score, pre_auth_score, action, reasons, and case_id in enforce mode), and an account.at_risk webhook is sent. An unknown or expired assessment answers 404 unknown_assessment.
POST /v1/risk/labels
Tells SecOps an attempt or identifier turned out to be fraud (a chargeback, a confirmed takeover) or legitimate (a cleared false positive). Labels never change past decisions. Give either assessment_id, or subject_kind and subject.
| Field | Type | Notes |
|---|---|---|
label | string, required | fraud or legitimate |
assessment_id | string | The assessment the label is about |
subject_kind | string | account, email, device or ip |
subject | string | Up to 320 characters. Pseudonymised on arrival |
source | string | Up to 40 characters, for example chargeback, support_review or customer_report |
{"assessment_id": "ra_01a2347758834f0557d137b39927", "label": "legitimate", "source": "support_review"}{
"label": "legitimate",
"subject_kind": "account",
"assessment_id": "ra_01a2347758834f0557d137b39927",
"recorded": true
}POST /v1/risk/wallet-events
Records ledger entries as they are written: one event, or {"events": [...]} with up to 50. Each event_id is recorded once, so retries are safe. Credits are matched against verified inflows (provider callbacks routed through SecOps, settlement lines); a credit still unmatched after an hour is flagged and, in enforce mode, holds the merchant.
| Field | Type | Notes |
|---|---|---|
event_id | string, required | Your ID for this ledger entry |
type | string, required | credit, transfer_in, debit, transfer_out, value_out, reversal, adjustment or inflow |
amount, currency | string, required | Positive decimal string; the type gives the direction |
merchant_id | string | Required except for inflow |
balance_after | string | The merchant's balance after this event, as your ledger has it |
sequence | integer | Per-merchant ledger sequence, so out-of-order delivery isn't mistaken for drift |
reference | string | The provider's reference (credits, reversals, inflows) or the transfer reference |
product | string | Required for value_out |
assessment_id | string | The value-out assessment (wa_...) this event carries out |
reversal_of, direction, approved_by, provider, counterparty, occurred_at | See the OpenAPI contract |
{
"event_id": "led_88231",
"merchant_id": "mch_10293",
"type": "credit",
"amount": "5000.00",
"currency": "NGN",
"reference": "PSK_T685312322670591",
"balance_after": "5250.00",
"sequence": 412
}{"event_id": "led_88231", "status": "recorded", "reconciliation": "open", "flags": []}A batch answers 200 with one result per event, in order. A bad event doesn't fail the others:
{
"results": [
{"event_id": "led_1", "status": "recorded", "reconciliation": "n/a", "flags": []},
{"event_id": "led_2", "status": "error",
"error": {"code": "invalid_request", "message": "type must be one of ['credit', 'transfer_in', 'debit', 'transfer_out', 'value_out', 'reversal', 'adjustment', 'inflow']"}}
]
}POST /v1/risk/settlements
Sends your payment provider's settlement lines, up to 100 a call (upload bigger files as CSV in the dashboard). Open credits with the same reference and amount are matched on arrival.
{
"provider": "paystack",
"lines": [{"reference": "PSK_T685312322670591", "amount": "5000.00", "currency": "NGN"}]
}{"provider": "paystack", "lines": 1, "recorded": 1, "matched_credits": 1, "rejected": 0, "errors": []}POST /v1/risk/merchants
Sets a merchant's tier and onboarding date, used by tier limits and the new-merchant checks. Merchants you never describe are aged from their first event.
{"merchant_id": "mch_10293", "tier": "2", "onboarded_at": 1790000000}{"merchant_id": "mch_10293", "tier": "2", "onboarded_at": 1790000000.0}GET /v1/risk/merchants/{merchant_id}
Says whether a merchant's value-out is on hold. The merchant.hold and merchant.released webhooks tell you when that changes; your admins release holds in the dashboard, with a note.
{"merchant_id": "mch_10293", "on_hold": false, "hold": null}POST /v1/risk/merchant-events
Reports a merchant's onboarding and activation steps: one event, or {"events": [...]} with up to 50. Needs risk:wallet. Each event has an event_id (resending the same one is safe), a merchant_id and a type: application_submitted, step_completed (with step), approved, activation_requested, activated, payout_account_changed (with payout_account), sale, refund or settlement_requested (the last three with amount and currency). approved, activation_requested and activated need actor, the staff member or system that did it. Optional fields: session_id and verified_by.
Activation and settlement requests are scored. SecOps flags a merchant activated without finishing the required steps, approved and activated by the same actor or session, or asking for a settlement with no sales behind it, and in enforce mode puts the merchant's value-out on hold.
{"event_id": "evt_881", "merchant_id": "mch_10293", "type": "settlement_requested", "amount": "250000.00", "currency": "NGN"}{"event_id": "evt_881", "status": "assessed", "assessment_id": "asm_...", "event_type": "settlement",
"decision": "hold", "score": 93, "reasons": [{"code": "SETTLEMENT_WITHOUT_SALES", "contribution": 3.1}]}Other event types answer {"event_id": "...", "status": "stored"}.
GET /v1/risk/merchants/{merchant_id}/lifecycle
Shows how far a merchant got through onboarding and what was flagged at activation. Needs risk:assess.
{"merchant_id": "mch_10293", "applied": true, "steps_completed": ["business_details", "identity", "bank_account"],
"steps_missing": [], "approved": true, "activated": true, "activation_flags": [],
"payout_account_set": true}POST /v1/risk/payment-events
Reports what happened to a payment: one event, or {"events": [...]} with up to 50. Name the payment by its assessment_id within 35 days. Disputes usually come later: send them with card_fingerprint and customer_id (or email) instead. A fraud dispute is a chargeback: the card, customer, device and email are flagged for 180 days and the assessment is labelled fraud.
| Field | Type | Notes |
|---|---|---|
event_id | string, required | Your ID for this event; a charge or dispute ID works |
type | string, required | authorized, declined, three_ds, refunded or dispute |
assessment_id | string | The payment assessment (pa_...). Required within 35 days, except for disputes |
decline_category | string | Declined only: insufficient_funds, generic, incorrect_number, incorrect_cvc, invalid_expiry, lost_or_stolen, fraud_suspected, velocity_exceeded, authentication_required, processing_error or other |
three_ds_result | string | passed, failed or abandoned |
dispute_reason | string | fraud, not_received, not_as_described, duplicate, subscription or other |
amount, currency, card_fingerprint, customer_id, email, device_id | string | When they differ from the order, or for disputes |
{"event_id": "ch_3Pq", "assessment_id": "pa_EfPSS2LVbGMy6DVH", "type": "declined", "decline_category": "incorrect_cvc"}{"event_id": "ch_3Pq", "status": "recorded", "type": "declined", "assessment_id": "pa_EfPSS2LVbGMy6DVH"}