Get all sessions

GET
/api/users/[user_id]/sessions

Query Parameters

page
number

Page Number

size
number

Page Size

client_id
string

Client Id by which the user sessions needs to be filtered.

sort
string

Value in 'sort_key:sort_order' format, by which results will be sorted. Sort order value can be '1' for ascending and '-1' for descending. Acceptable sort key values are 'session_id', 'initiated_at', 'expires_at' and 'last_updated'

Path Parameters

user_id
string
Required

User Id

Authentication

X-API-KEY
header
Required

Api key needed to access the endpoints. X-API-KEY: Your_API_Key

Headers

accept
string
  • application/json
  • application/problem+json

Responses

200
OK
400
Bad Request
422
Unprocessable Entity
404
Not Found
401
Unauthorized
403
Forbidden

Request Example

Request
curl -X GET "https://<your-domain>/api/users/{user_id}/sessions?page=1&size=10&client_id=eCOGRJYpnNwwAAuCeReEW&sort=initiated_at:1" \
 -H "X-API-KEY: <your-api-key>" \
 -H "Accept: application/json"

Response Example

Response
200 OK
[
  {
    "last_updated": 1640975400,
    "expires_at": 1640983490,
"last_metadata": { "country": "United States of America", "city": "Los Angeles", "latitude": "34.043238", "ip_address": "1.1.1.1", "region": "North America", "user_agent": "The User Agent", "longitude": "-118.250918"
}, "session_key": "CF13F82261B1FCE312E5651500620295BEDBF32207446BA5C1D9B61129F05A22", "session_id": "96484D319ACC21380CCE026E54807B4D", "initiated_at": 1640975400,
"client_ids": [ "eCOGRJYpnNwwAAuCeReEW"
] } ]