Documentation Index
Fetch the complete documentation index at: https://otpless.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
The SDK requires a minimum API level of 26 (Android 8.0 Oreo). Calls on devices below API 26 return silently without an error.
Prerequisites
- Android API level 26 or higher
- App ID, Client ID, and Client Secret from the OTPless dashboard
Installation
The SDK is distributed on Maven Central. In your app-levelbuild.gradle, add the dependency:
build.gradle
Add permissions
In yourAndroidManifest.xml, add the required and optional permissions:
AndroidManifest.xml
Initialize the SDK
Callinitialize in the onCreate() method of your Application class. Pass your App ID, Client ID, and Client Secret as a map.
Application.kt
Integrate with OtplessAuth SDK
If you are already using the OtplessAuth SDK, you can enable device fingerprinting directly onOtplessRequest without calling getIntelligence() manually. Set the deviceFingerprintMode property before calling OtplessSDK.start().
DeviceFingerprintMode values
| Value | Behaviour |
|---|---|
NONE | Device fingerprinting is disabled. Default value. |
ASYNC | Fingerprint is collected in parallel with the auth request. Does not add latency. |
SYNC | Fingerprint is collected before the auth request is sent. Ensures fingerprint data is always included. |
Fetch device intelligence
getIntelligence() is a suspend function. Call it from a coroutine scope and handle the result. It optionally accepts an UpdateInfo object to attach user-level and event-level context.
Pass additional context (optional)
Pass anUpdateInfo object directly to getIntelligence() to attach user-level and event-level context. This enriches the result and enables more accurate risk scoring.
UpdateInfo fields
| Field | Type | Description |
|---|---|---|
userId | String? | Your internal user identifier. Used to correlate the result with a user account. |
phoneNumber | String? | Customer phone number. |
phoneInputType | PhoneInputType? | How the phone number was entered: MANUAL, COPY_PASTED, GOOGLE_HINT. |
otpInputType | OtpInputType? | How the OTP was entered: MANUAL, COPY_PASTED, AUTO_FILLED. |
userEventType | UserEventType? | The action being performed: LOGIN, SIGNUP, TRANSACTION, OTHERS. |
merchantId | String? | Merchant identifier, if applicable. |
additionalInput | Map<String, String>? | Arbitrary key-value pairs for custom context. |
Sample response
Success
Error
Response fields
| Field | Type | Description | Default |
|---|---|---|---|
requestId | string | Unique identifier for the request. | "" |
sessionId | string | Unique identifier for the current app session. | "" |
newDevice | boolean | Whether this is the first time this device has been seen. | false |
deviceId | string | Stable identifier for the device. Persists across reinstalls and factory resets. | "" |
sessionRiskScore | float | Risk score (0–100) based on the current session state. | 0.0 |
deviceRiskScore | float | Risk score that also factors in the device’s historical state across past sessions. | 0.0 |
vpn | boolean | A VPN is active on the device. | false |
proxy | boolean | The device is behind a proxy server. | false |
emulator | boolean | The app is running on an emulator rather than physical hardware. | false |
rooted | boolean | The device has been modified for root access. | false |
cloned | boolean | The user is running a cloned instance of the app. | false |
geoSpoofed | boolean | The device’s location is being faked. | false |
remoteAppProviders | boolean | A remote access application (e.g. AnyDesk, TeamViewer) is installed. | false |
remoteAppProvidersCount | number | Number of remote access applications detected. | 0 |
mirroredScreen | boolean | The device’s screen is being mirrored. | false |
hooking | boolean | The app has been altered by a hooking framework. | false |
factoryReset | boolean | A suspicious factory reset has been performed. | false |
factoryResetTime | long | Timestamp of the last factory reset. -1 if not detected. | -1 |
appTampering | boolean | The app binary has been modified in an unauthorized way. | false |
genuineInstall | boolean | The app was installed from an official, trusted source. | false |
developerOptionsEnabled | boolean | Developer Options are enabled on the device. | false |
usbDebugging | boolean | USB debugging is enabled. | false |
wirelessDebugging | boolean | Wireless (ADB over Wi-Fi) debugging is enabled. | false |
unsecuredWifi | boolean | The device is connected to an unsecured Wi-Fi network. | false |
harmfulAppDetected | boolean | Potentially harmful applications are installed on the device. | false |
blacklistedDevice | boolean | The device is on the OTPless internal blocklist. | false |
keyloggerDetected | boolean | Keylogging behavior has been detected on the device. | false |
ip | string | Current IP address of the device. | "" |
ipDetails | object | IP metadata including country, city, ISP, coordinates, and fraud score. | {} |
gpsLocation | object | GPS location details including latitude, longitude, and address. | {} |
simInfo | object | SIM card details: current SIMs per slot and total SIMs used over the device’s lifetime. | {} |
deviceMeta | object | Device hardware metadata: brand, model, OS version, screen resolution, storage, RAM, CPU. | {} |
appAnalytics | object | App affinity scores (0–1) per category based on installed apps. | {} |
clientUserIds | array | All user IDs associated with this device across its history. | [] |
ruleAction | object | The triggered rule and recommended action (ALLOW, WARN, BLOCK) with a user-facing message. | {} |
appliedRules | object | Full list of evaluated rules, their scores, and the total rule score. | {} |
additionalData | object | Reserved for custom fields returned based on your account configuration. | {} |