Decisions
POST /v1/decision is the one call your server makes at each moment that matters. It needs a secret key with the decide scope. Full schema: Get a decision.
Integration points
Section titled “Integration points”Send the event_type that matches the moment. Each one runs its own ruleset, or a shared one you chose.
event_type |
When to call |
|---|---|
signup |
Before you create an account |
login |
After the password or passkey checks out, before you start the session |
application |
Before you approve a loan, card, or other application |
checkout |
Before you take a payment or ship an order |
password_reset |
Before you send or accept a reset |
account_change |
Before you change email, phone, password, or payout details |
payout |
Before money leaves |
gift_card_redeem |
Before you redeem a gift card, voucher, or store credit code |
api_key_create |
Before an account creates an API key, token, or other credential |
other |
Anything else worth a decision |
You can add your own integration points in the console’s Rules page, such as loyalty_redeem or wire_out. Each gets its own ruleset (a copy to edit) or shares one. GET /v1/integration-points lists every event type your account knows and the ruleset each runs. Any other well-formed event type (2 to 40 lowercase letters, digits, and underscores) runs the other ruleset, and rule.ruleset in the response says which ruleset answered.
The request
Section titled “The request”{ "request_id": "req_01M8YGM5XB0RJ7S2N1Q4ZK6W3D", "event_type": "login", "account_id": "cust_1842", "email": "pat@example.com", "phone": "+14155550100", "ip": "198.51.100.7", "user_agent": "Mozilla/5.0 …", "amount": "249.99", "currency": "USD", "value_type": "order"}| Field | Required | Notes |
|---|---|---|
request_id |
strongly recommended | From the tag’s hidden field. Without it there is no device. |
event_type |
yes | One of the integration points above, or one of your own. |
account_id |
yes | Your own stable ID for the account. Any string. |
email, phone |
no | Link devices across accounts by keyed token. The email shows in your console; the phone is never stored raw. |
ip, user_agent |
recommended | What your server saw from the end user. |
amount |
no | What is at stake, in major units (dollars, not cents), as a number or a string such as "249.99". Any event type can send it; leave it out when there is no amount, as on most logins. Rules can use it, and it is kept for reporting the money we save you. |
currency |
no | The ISO 4217 code of amount, such as USD, EUR, or JPY. Defaults to USD. |
value_type |
no | What the amount is: order, payout, transfer, credit_line, balance, bonus, or other. |
agent_signature |
no | Signed agent headers. See AI agents. |
An amount with more decimal places than its currency allows (two for USD, none for JPY) is refused with invalid_amount, and an unknown currency with invalid_currency. We keep the amount exactly as sent, in its own currency.
Never send card numbers; a request that contains one is refused with card_number_refused, and an account_id written as a Social Security number is refused with ssn_refused. SSN, date of birth, names, and addresses are not accepted yet.
The response
Section titled “The response”{ "decision_id": "dec_01M8YGM5XD01PSSGP94Y3E33EZ", "request_id": "req_01M8YGM5XC3QF7W1JZ8T0D2K9A", "event_type": "login", "recommendation": "step_up", "risk_score": 120, "trust_score": 0, "reputation": "new", "reasons": ["BOT_AI_AGENT", "BOT_AGENT_DECLARED"], "bot": { "verdict": "ai_agent", "agent_type": "consumer_assistant", "operator": "anthropic", "acting_for": "user", "evidence": "declared", "step_up": "verify_agent", "confidence": 0.8, "reasons": ["BOT_AGENT_DECLARED", "BOT_AI_AGENT"] }, "device": { "id": "dev_01M8YGA1E4M2R7C9V3T5X8N0QP", "confidence": 0.97, "new": false, "first_seen": "2026-09-21T12:00:00Z", "last_seen": "2026-11-21T11:00:00Z", "visit_count": 9, "match_path": "token+fingerprint" }, "network": { "ip": "203.0.113.24", "country": "US", "hosting": true }, "this_customer": { "device": { "accounts_24h": 1, "accounts_7d": 1, "accounts_30d": 1, "accounts_90d": 1 }, "account": { "devices_24h": 1, "devices_7d": 1, "devices_30d": 1, "devices_90d": 1, "new_device": false } }, "rule": { "ruleset": "login", "version": 1, "action": "step_up", "code": "B004", "path": ["next", "next", "next", "yes"] }, "versions": { "api": "2026-11-21", "scorecard": "sc0" }}What each part tells you
Section titled “What each part tells you”recommendation: what to do:allow,review,step_up, ordeny. Your ruleset for the event type decides it.risk_score(0 to 1000): higher is riskier.trust_score(0 to 1000): good history between this device and this account. Old good history never cancels fresh bad signals.reputation:new,known,trusted,suspect, orbad, a plain summary of the two scores.reasons: stable reason codes, strongest first. Look them up in the catalog.bot: a person, an AI agent, a good bot, or a bad bot, with the agent named. See AI agents.device: the device ID, recognized again on return visits, and how sure the match is.visit_countcounts every page that loaded the tag on this device, so it is usually higher than the number of decisions; the console’s transactions are decisions.nullwhen the tag did not run.same_machinelists other devices that look like the same computer, such as another browser on it, with a confidence and whether that device was blocked (see When a block follows the account).network: location and network from local data, and what IP reputation lists say about the address.hostingmeans a cloud or data center network.tor,vpn,proxy, andhijacked_rangeappear when the IP is a Tor exit, a commercial VPN, an open proxy, or a hijacked or criminal netblock, each with its own reason code.private_relaymarks iCloud Private Relay, which we never score as hosting or VPN because ordinary Safari users sit behind it. Lists refresh in the background from published sources, so the lookup adds no outside call to your decision.this_customer: how this device, account, email, and phone link to each other at your site over 24 hours and 7, 30, and 90 days.account.new_deviceis true the first time an account uses a device.rule: which ruleset and version answered, the rule’s reason code, and the branches it took. Version 0 is the built-in starter rules.list: the allow, hold, or block list entry that matched, when one did. It setsrecommendationahead of your rules. See lists.warnings: things that weakened the decision without failing it, such asno_request_id. A decision with warnings is still a valid decision.
Acting on it
Section titled “Acting on it”| Recommendation | A good default |
|---|---|
allow |
Let it through. |
step_up |
Ask for more proof: a one-time code, a passkey, or for an agent, a signed identity or a confirmation from the person it acts for. Report step_up_passed when they pass. |
review |
Let it through with limits, or hold it, and queue it. Your team or the fraud manager works the queue in the console. |
deny |
Refuse it with a neutral message. Do not say why. |
Store decision_id with the account, session, or order. It is how you report outcomes later.
Timeouts and failures
Section titled “Timeouts and failures”The target is p99 at or under 100 ms. Set a client timeout around 1.5 seconds and decide in advance what to do if it fires: most teams allow logins and hold payouts. Retrying a decision is safe, but each call is a new decision with its own ID. Sandbox keys get a Server-Timing header with per-stage timings.
See Errors for every error code.