POST
/
v1
/
sessions
/
get-session-details
curl --location 'https://user-auth.otpless.app/v1/sessions/get-session-details' \
  --header 'Content-Type: application/json' \
  --header 'clientId: YOUR_CLIENT_ID' \
  --header 'clientSecret: YOUR_CLIENT_SECRET' \
  --data '{
      "sessionToken": "RECEIVED_SESSION_TOKEN_FROM_OTPLESS"
  }'
  
{
  "sessionToken": "SESSION_ID",
  "userId": "USER_ID",
  "startedAt": 1725879411000,
  "lastActiveAt": 1725879411000,
  "identities": [
    {
      "identityType": "EMAIL",
      "identityValue": "user@example.com",
      "channel": "EMAIL_LOGIN",
      "methods": [
        "EMAIL"
      ],
      "name": "Lorem Ipsum",
      "verifiedAt": 1725879354000
    }
  ],
  "deviceInfo": {
    "userAgent": "Mozilla/5.0 (Linux; Android 11; SM-M022G Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/127.0.6533.103 Mobile Safari/537.36",
    "platform": "Linux armv7l",
    "vendor": "Google Inc.",
    "browser": "Chrome",
    "connection": "4g",
    "language": "en",
    "cookieEnabled": true,
    "screenWidth": 385,
    "screenHeight": 854,
    "screenColorDepth": 24,
    "devicePixelRatio": 1.875,
    "timezoneOffset": -330,
    "cpuArchitecture": "4-core",
    "fontFamily": "sans-serif"
  },
  "network": {
    "ip": "157.35.40.203",
    "timezone": "Asia/Kolkata",
    "ipLocation": {
      "city": {
        "name": "Patna"
      },
      "subdivisions": {
        "code": "BR",
        "name": "Bihar"
      },
      "country": {
        "code": "IN",
        "name": "India"
      },
      "continent": {
        "code": "AS"
      },
      "latitude": 25.5908,
      "longitude": 85.1348,
      "postalCode": "800001"
    }
  }
}

Authorizations

clientId
string
header
required

The clientId used for API authentication.

clientSecret
string
header
required

The clientSecret used for API authentication.

Body

application/json
Payload containing the sessionToken received from otpless authentication and client credentials for verification.
sessionToken
string
required

The unique identifier of the session.

Response

200
application/json
The user's information was successfully retrieved.
sessionToken
string

The unique identifier of the session.

Example:

"SESSION_ID"

userId
string

The unique identifier of the user associated with the session.

Example:

"USER_ID"

startedAt
integer

The timestamp when the session started.

Example:

1725879411000

lastActiveAt
integer

The timestamp when the session was last active.

Example:

1725879411000

identities
object[]

An array containing details about the user's identities (email, mobile, etc.).

deviceInfo
object

Information about the user's device, such as user agent, platform, browser, etc.

network
object

Information about the network, such as IP address, timezone, location, etc.