Skip to content

Get a decision

POST
/v1/decision
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.

Media typeapplication/json
object
request_id

The tag’s request ID, from the hidden form field (request_id by default). Without it there is no device.

string
<= 64 characters
event_type
required

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.

string
/^[a-z][a-z0-9_]{1,39}$/
account_id
required

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.

string
email

The account’s email. Matched by a keyed token and shown in your console; never echoed in responses.

string
phone

The account’s phone

string
elements

Identity elements in the general form. email and phone above are shorthand for these.

Array<object>

One identity element. Email and phone are matched by keyed tokens; the email is also kept for your console.

object
type
required

SSN, date of birth, name, and addresses are refused until the secure vault ships.

string
Allowed values: account_id email phone
value
required
string
ip

The end user’s IP

string
user_agent

The end user’s User-Agent header

string
<= 512 characters
amount

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.

One of:
number
currency

The ISO 4217 code of amount. Defaults to USD. Unknown codes are refused with invalid_currency.

string
>= 3 characters <= 3 characters
value_type

Optional. What the amount is, so savings reports can weigh a credit line differently from an order.

string
Allowed values: order payout transfer credit_line balance bonus other
sdk_version

Your SDK or integration version

string
agent_signature

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
signature
required

The Signature header.

string
signature_input
required

The Signature-Input header.

string
signature_agent

The Signature-Agent header

string
authority
required

The Host the end user’s request named.

string

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"
}

The decision.

Media typeapplication/json
object
decision_id
required

Our ID for this decision. Report outcomes against it.

string
request_id

The tag’s request ID you sent.

string
event_type
required

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.

string
/^[a-z][a-z0-9_]{1,39}$/
recommendation
required

What to do. Your rules decide it; without rules, the score does.

string
Allowed values: allow review step_up deny
risk_score
required

Higher is riskier.

integer
<= 1000
score
required

Same as risk_score.

integer
<= 1000
trust_score
required

Good history between this device and account.

integer
<= 1000
reputation
required
string
Allowed values: new known trusted suspect bad
reasons
required

Reason codes, strongest first (see GET /v1/reason-codes).

Array<string>
bot
required

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
verdict
required
string
Allowed values: human ai_agent good_bot bad_bot
agent_type

The kind of agent or bot, for example consumer_assistant or search_crawler.

string
agent_family

The agent or bot family

string
family_confidence

How sure the family name is

number
<= 1
step_up

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.

string
claimed_family

The family a spoofed session pretended to be.

string
operator

Who runs the agent

string
acting_for

Who the agent acts for: user (a person), operator, or unknown.

string
environment

Where it runs, for example local_browser or hosted_browser.

string
evidence

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).

string
Allowed values: verified declared inferred
confidence
required
number
<= 1
reasons
required

Reason codes behind the verdict (see GET /v1/reason-codes).

Array<string>
device
required

The device, or null when the tag did not run.

One of:

The device, recognized again on every return visit to your site. It describes a device, not a person.

object
id
required

Stable device ID for your account.

string
confidence
required

How sure the match is.

number
<= 1
new
required

First time we have seen this device at your site.

boolean
first_seen
required
string format: date-time
last_seen
required
string format: date-time
visit_count
required

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).

integer
match_path
required

How the device was recognized.

string
Allowed values: new token+fingerprint token_only fingerprint
token_mismatch

The device’s stored token disagrees with its other signals.

boolean
same_machine

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.

Array<object>
object
device_id
required
string
confidence
required
number
<= 1
blocked

The linked device was reported as a bad actor, denied in the last 72 hours, or is on your block list.

boolean
network
required

The end user’s network, from local geo data and IP reputation lists. Present fields only.

object
ip
string
country

ISO 3166-1 country code.

string
region

ISO 3166-2 subdivision code.

string
city
string
lat
number
lon
number
accuracy_km
integer
time_zone
string
asn
integer
as_org
string
hosting
required

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.

boolean
private

A private or reserved address.

boolean
tor

The IP is a current Tor exit relay (NET_TOR_EXIT).

boolean
vpn

The IP belongs to a commercial VPN network (NET_VPN).

boolean
proxy

The IP is an open public proxy (NET_PUBLIC_PROXY).

boolean
hijacked_range

The IP is in a netblock listed as hijacked or run by criminals (NET_HIJACKED_RANGE).

boolean
private_relay

The IP is iCloud Private Relay egress: ordinary people behind Apple’s relay, so it is not scored as hosting or VPN.

boolean
this_customer
required

How this device, account, email, and phone link to each other at your site only.

object
device

Distinct linked nodes over the last 24 hours, 7, 30, and 90 days, for example accounts_24h on the device block. account.new_device says the account had not used this device before.

object
key
additional properties
One of:
integer
account

Distinct linked nodes over the last 24 hours, 7, 30, and 90 days, for example accounts_24h on the device block. account.new_device says the account had not used this device before.

object
key
additional properties
One of:
integer
email

Distinct linked nodes over the last 24 hours, 7, 30, and 90 days, for example accounts_24h on the device block. account.new_device says the account had not used this device before.

object
key
additional properties
One of:
integer
phone

Distinct linked nodes over the last 24 hours, 7, 30, and 90 days, for example accounts_24h on the device block. account.new_device says the account had not used this device before.

object
key
additional properties
One of:
integer
versions
required

The API and scorecard versions that answered.

object
key
additional properties
string
rule

Which of your business rules answered. Version 0 is the built-in starter rules.

object
ruleset
required

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.

string
version
required
integer
action
required
string
Allowed values: allow review step_up deny
code

The reason code of the rule that gave the action

string
points

Points rules added to (or took from) the risk score.

integer
path
required

The branches taken through the ruleset.

Array<string>
shadow

What a ruleset version in shadow would have answered. It never changes the decision.

object
version
required
integer
action
required
string
Allowed values: allow review step_up deny
code
string
list

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
list
required
string
Allowed values: block hold allow
kind
required

What the entry matched on.

string
Allowed values: device account ip email_domain agent_family
entry_id
required

The list entry’s ID

string
warnings

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.

Array<string>

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"
]
}
}
Server-Timing
string

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.

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Branch on this

string
message
required

What went wrong.

string
fix

What to change.

string

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).

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Branch on this

string
message
required

What went wrong.

string
fix

What to change.

string

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).

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Branch on this

string
message
required

What went wrong.

string
fix

What to change.

string

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.

Media typeapplication/json
object
error
required
object
code
required

Stable error code. Branch on this

string
message
required

What went wrong.

string
fix

What to change.

string

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"
}
}
Retry-After
integer
>= 1

Seconds to wait before retrying.