Get a decision
const url = 'https://api.localhost/v1/decision';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"request_id":"req_01M8YGM5XB0RJ7S2N1Q4ZK6W3D","event_type":"signup","account_id":"cust_1842","email":"pat@example.com","phone":"+14155550100","ip":"198.51.100.7","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.localhost/v1/decision \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "request_id": "req_01M8YGM5XB0RJ7S2N1Q4ZK6W3D", "event_type": "signup", "account_id": "cust_1842", "email": "pat@example.com", "phone": "+14155550100", "ip": "198.51.100.7", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36" }'Call from your server at each integration point (sign-up, login, application, checkout,
password reset, account change, payout). Pass the request_id the browser tag put in your
form, your own account ID, and the end user’s IP and user agent as your server saw them.
Each request_id is good for one decision within 30 minutes of collection. An older or
unknown one adds DEV_REQUEST_INVALID and its signals are not used; one already used for
another account adds DEV_REQUEST_REUSED (a retry for the same account within 10 minutes is
fine); and a collection from a different network or user agent than the IP and user agent you
send adds DEV_COLLECTION_MISMATCH.
The event_type picks the ruleset that answers, and the response says which rule and
version it was. Email is matched by a keyed token and kept as sent for your console;
phone becomes a token on arrival. Neither is echoed in the response. Never send card numbers: a request that contains one is refused.
Needs a secret key with the decide scope. Target latency: p99 at or under 100 ms.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The tag’s request ID, from the hidden form field (request_id by default). Without it there is no device.
The integration point. A built-in one (signup, login, application, checkout,
password_reset, account_change, payout, gift_card_redeem, api_key_create, other)
or one you added in the console. Each point runs its own ruleset, or a shared one you chose.
Any other well-formed event type runs the other ruleset; rule.ruleset in the response
says which ruleset answered. GET /v1/integration-points lists yours.
Your own stable ID for the account (any string, but never a card number or Social Security number; an SSN written as 123-45-6789 is refused with ssn_refused). An email address works and is treated like email, matched by a keyed token and shown in your console.
The account’s email. Matched by a keyed token and shown in your console; never echoed in responses.
The account’s phone
Identity elements in the general form. email and phone above are shorthand for these.
One identity element. Email and phone are matched by keyed tokens; the email is also kept for your console.
object
SSN, date of birth, name, and addresses are refused until the secure vault ships.
The end user’s IP
The end user’s User-Agent header
Optional, on any event type: the amount at stake, in major units of currency (dollars,
not cents), as a number or a string. A string such as “249.99” avoids float rounding.
Zero or more, with no more decimal places than the currency allows (2 for USD, 0 for JPY).
Events with no amount, such as most logins, simply leave it out.
The ISO 4217 code of amount. Defaults to USD. Unknown codes are refused with invalid_currency.
Optional. What the amount is, so savings reports can weigh a credit line differently from an order.
Your SDK or integration version
The Web Bot Auth headers of the end user’s request, as your server received them. Agents sign the requests they make; we verify the signature against the operator’s published keys and keep only the result.
object
The Signature header.
The Signature-Input header.
The Signature-Agent header
The Host the end user’s request named.
Examples
A sign-up with the tag's request ID
{ "request_id": "req_01M8YGM5XB0RJ7S2N1Q4ZK6W3D", "event_type": "signup", "account_id": "cust_1842", "email": "pat@example.com", "phone": "+14155550100", "ip": "198.51.100.7", "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36"}A checkout with an amount
{ "request_id": "req_01M8YGQ3J2C4V8F0T6H9PB1N5X", "event_type": "checkout", "account_id": "cust_1842", "amount": "249.99", "currency": "USD", "value_type": "order", "ip": "198.51.100.7"}Responses
Section titled “Responses”The decision.
object
Our ID for this decision. Report outcomes against it.
The tag’s request ID you sent.
The integration point. A built-in one (signup, login, application, checkout,
password_reset, account_change, payout, gift_card_redeem, api_key_create, other)
or one you added in the console. Each point runs its own ruleset, or a shared one you chose.
Any other well-formed event type runs the other ruleset; rule.ruleset in the response
says which ruleset answered. GET /v1/integration-points lists yours.
What to do. Your rules decide it; without rules, the score does.
Higher is riskier.
Same as risk_score.
Good history between this device and account.
Reason codes, strongest first (see GET /v1/reason-codes).
Is a person or software behind this session, which agent or bot it is, who it acts for, and how we know. Values are lower-case words; new values are added over time.
object
The kind of agent or bot, for example consumer_assistant or search_crawler.
The agent or bot family
How sure the family name is
Set when the site should confirm an unproven agent before it acts. verify_agent: ask for a signed agent identity or a confirmation from the person it acts for.
The family a spoofed session pretended to be.
Who runs the agent
Who the agent acts for: user (a person), operator, or unknown.
Where it runs, for example local_browser or hosted_browser.
How we know. Verified is a checked signature or published network; declared is the agent naming itself; inferred is how it behaves, including a device identified as an agent or bot in the last 24 hours (BOT_DEVICE_RECENT_AGENT).
Reason codes behind the verdict (see GET /v1/reason-codes).
The device, or null when the tag did not run.
The device, recognized again on every return visit to your site. It describes a device, not a person.
object
Stable device ID for your account.
How sure the match is.
First time we have seen this device at your site.
How many times the tag has seen this device at your site, counting every page that loads the tag (so usually more than its decisions).
How the device was recognized.
The device’s stored token disagrees with its other signals.
Other devices at your site that look like the same computer, such as another browser
or browser profile on it, strongest first (at most 5). Each browser keeps its own device
ID; this is a scored link, not a merge. A confidence of 0.75 or more is a likely match
(the hardware agrees and the two were seen close in time or on the same account); below
that it is possible, since identical computers set up the same way can look alike.
When a linked device was reported, denied, or is on your block list, the decision adds
DEV_OTHER_BROWSER_BLOCKED.
object
The linked device was reported as a bad actor, denied in the last 72 hours, or is on your block list.
The end user’s network, from local geo data and IP reputation lists. Present fields only.
object
ISO 3166-1 country code.
ISO 3166-2 subdivision code.
The IP belongs to a cloud or hosting provider: by its network (ASN) or a published cloud or data center range. Never true for iCloud Private Relay.
A private or reserved address.
The IP is a current Tor exit relay (NET_TOR_EXIT).
The IP belongs to a commercial VPN network (NET_VPN).
The IP is an open public proxy (NET_PUBLIC_PROXY).
The IP is in a netblock listed as hijacked or run by criminals (NET_HIJACKED_RANGE).
The IP is iCloud Private Relay egress: ordinary people behind Apple’s relay, so it is not scored as hosting or VPN.
How this device, account, email, and phone link to each other at your site only.
object
The API and scorecard versions that answered.
object
Which of your business rules answered. Version 0 is the built-in starter rules.
object
The ruleset that answered: the event type’s own, a shared ruleset (rs_ key) the point runs, or other for an event type without a point.
The reason code of the rule that gave the action
Points rules added to (or took from) the risk score.
The branches taken through the ruleset.
What a ruleset version in shadow would have answered. It never changes the decision.
object
The entry on your allow, hold, or block lists that matched. Lists run before your rules: a block
sets recommendation to deny, a hold to review, and an allow to allow. When several entries match,
block wins over hold, and hold over allow. Absent when nothing matched.
object
What the entry matched on.
The list entry’s ID
Things that weakened the decision without failing it, for example no_request_id,
request_id_not_found, request_id_expired (collected more than 30 minutes earlier),
geo_unavailable, or links_unavailable.
Examples
A person on a returning device
{ "decision_id": "dec_01M8YGM5XC012R9ZCQKTSX9RR7", "request_id": "req_01M8YGM5XB0RJ7S2N1Q4ZK6W3D", "event_type": "signup", "recommendation": "allow", "risk_score": 0, "score": 0, "trust_score": 0, "reputation": "new", "reasons": [], "bot": { "verdict": "human", "environment": "local_browser", "confidence": 0.9, "reasons": [] }, "device": { "id": "dev_01M8YG8Q6TQ7D9P2X4K1W0N3SB", "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": "198.51.100.7", "country": "US", "region": "CA", "city": "San Francisco", "asn": 7922, "as_org": "Example Broadband", "hosting": false }, "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": true }, "email": { "devices_24h": 1, "devices_7d": 1, "devices_30d": 1, "devices_90d": 1 } }, "versions": { "api": "2026-11-21", "scorecard": "sc0" }, "rule": { "ruleset": "signup", "version": 3, "action": "allow", "path": [ "next", "next", "next", "next", "next", "next", "next" ] }}A customer's AI assistant signing in
{ "decision_id": "dec_01M8YGM5XD01PSSGP94Y3E33EZ", "request_id": "req_01M8YGM5XC3QF7W1JZ8T0D2K9A", "event_type": "login", "recommendation": "step_up", "risk_score": 120, "score": 120, "trust_score": 0, "reputation": "new", "reasons": [ "BOT_AI_AGENT", "BOT_AGENT_DECLARED" ], "bot": { "verdict": "ai_agent", "agent_type": "consumer_assistant", "agent_family": "claude_duet", "operator": "anthropic", "acting_for": "user", "environment": "hosted_browser", "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", "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 } }, "versions": { "api": "2026-11-21", "scorecard": "sc0" }, "rule": { "ruleset": "login", "version": 1, "action": "step_up", "code": "B004", "path": [ "next", "next", "next", "yes" ] }}Headers
Section titled “Headers”Per-stage timings. Sandbox keys only.
The request is not valid. code says why: invalid_body, invalid_event_type,
missing_account_id, unknown_element_type, element_not_accepted,
card_number_refused, ssn_refused, invalid_amount, invalid_currency, or
invalid_value_type.
object
object
Stable error code. Branch on this
What went wrong.
What to change.
Example
{ "error": { "code": "invalid_event_type", "message": "event_type is missing or malformed", "fix": "use a built-in integration point such as signup, login, or checkout, or one of your own (2 to 40 lowercase letters, digits, and underscores)" }}The key is missing, unknown, revoked, or expired (invalid_api_key).
object
object
Stable error code. Branch on this
What went wrong.
What to change.
Example
{ "error": { "code": "invalid_api_key", "message": "the API key is missing, unknown, revoked, expired, or not allowed from this IP", "fix": "send a secret key as 'Authorization: Bearer <key>'; manage keys on the account page" }}The key lacks the scope (scope_not_granted), or its IP allowlist does not include the caller (invalid_api_key).
object
object
Stable error code. Branch on this
What went wrong.
What to change.
Example
{ "error": { "code": "scope_not_granted", "message": "this key does not have the decide scope", "fix": "create a key with the decide scope" }}The key is calling faster than its limit (rate_limited). Each key has its own limit; see
Errors in the developer docs. Wait the seconds in Retry-After, then retry.
object
object
Stable error code. Branch on this
What went wrong.
What to change.
Example
{ "error": { "code": "rate_limited", "message": "this key is sending decisions faster than its limit", "fix": "wait for the Retry-After header, then retry; ask us if you need a higher limit" }}Headers
Section titled “Headers”Seconds to wait before retrying.