Device Intelligence API
Takes a token from our device SDK and returns a stable device ID, a 0 to 100 risk score, individual risk signals and how many of your accounts use the device.
- Source
- Device signals collected by our Android, iOS and web SDK
- Turnaround
- Real time, under a second
- Endpoint
- POST /v1/device/assess
- Who can use it
- Businesses using the SDK in their app or site, with fraud prevention covered in their privacy notice.
Overview
Organised fraud often runs on emulators and phones with cloned apps, with dozens of accounts per device. Our web and mobile SDK collects device signals at sign-up, login or payout. Your server sends us the session token and we return a stable device ID, a risk score and the signals behind it, including how many of your accounts we've seen on that device.
Good to know
Determined fraudsters can reset or spoof some signals. Treat it as one input to your risk rules, not a verdict.
What you get
- Stable device IDRecognise the same device after app reinstalls and cleared cookies, within the limits of each platform.
- Clear signalsEmulator, root or jailbreak, app cloning and mock location are returned as separate flags.
- Accounts per deviceSee how many of your user accounts share one device, a strong sign of farming.
- Light SDKA small SDK for Android, iOS and web that doesn't need extra permissions from the user.
Request
POST https://api.ampletrails.com/v1/device/assess
| Field | Type | Status | Description |
|---|---|---|---|
session_token | string | Required | Token generated by our web or mobile SDK on the user's device |
user_id | string | Optional | Your user ID to link the device to |
event | string | Optional | Event being assessed (signup, login, payout) |
Response
Fields inside data. Every response also carries status, request_id and, on errors, message. See error codes.
| Field | Meaning | Example |
|---|---|---|
device_id | Stable device fingerprint | dv_3f9a0c71 |
risk_score | Device risk score from 0 (safe) to 100 (high risk) | 12 |
signals.emulator | Running on an emulator | false |
signals.rooted | Rooted or jailbroken device | false |
signals.app_cloner | App cloning or dual-app detected | false |
signals.location_spoofing | GPS or mock-location tampering | false |
accounts_on_device | Number of your user accounts seen on this device | 1 |
Example
curl -X POST https://api.ampletrails.com/v1/device/assess \
-H "Authorization: Bearer $AMPLE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"session_token": "dvs_eyJhbGciOi…", "user_id": "user_102938", "event": "signup"}'import os, requests
resp = requests.post(
"https://api.ampletrails.com/v1/device/assess",
headers={"Authorization": f"Bearer {os.environ['AMPLE_API_KEY']}"},
json={
"session_token": "dvs_eyJhbGciOi…",
"user_id": "user_102938",
"event": "signup"
},
timeout=30,
)
resp.raise_for_status()
print(resp.json()["data"])const resp = await fetch("https://api.ampletrails.com/v1/device/assess", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMPLE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"session_token": "dvs_eyJhbGciOi…",
"user_id": "user_102938",
"event": "signup"
}),
});
const { data } = await resp.json();$ch = curl_init("https://api.ampletrails.com/v1/device/assess");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AMPLE_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["session_token" => "dvs_eyJhbGciOi…", "user_id" => "user_102938", "event" => "signup"]),
]);
$data = json_decode(curl_exec($ch), true)["data"];{
"status": "success",
"request_id": "req_7f3a9c21e4",
"data": {
"device_id": "dv_3f9a0c71",
"risk_score": 12,
"signals": {
"emulator": false,
"rooted": false,
"app_cloner": false,
"location_spoofing": false
},
"accounts_on_device": 1
}
}Example data. The exact field list for your account comes with your sandbox documentation.
Use cases
Sign-up bonus abuse
Stop one phone creating dozens of accounts to farm rewards.
Loan app fraud
Flag applications from emulators or devices linked to past defaulters.
Payout protection
Check the device before a withdrawal or a change of bank account.
Questions about this API
Do we need to integrate an SDK?
Yes. The signals come from the user's device, so the SDK runs in your app or web page and gives your server a token to send us.
Is this allowed under privacy rules?
Device data can be personal data. Mention fraud prevention in your privacy notice and only use the results for that purpose.
Will rooted phones always be fraud?
No. Some genuine users root their phones. Use the signal with others rather than blocking on it alone.
What does the risk score mean?
It's a 0 to 100 summary of the signals. Start by reviewing high scores, then set automatic rules once you've seen your own data.
Try the Device Intelligence API
Sandbox keys, the full field reference and a Postman collection, usually within a working day.