Retrieves all sessions of the authenticated user making the request.
Changelog
| Version | Description |
|---|---|
| 5.0.0 | Added |
The user ID.
The authentication token.
Filter sessions list using regex.
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
OK
{
"sessions": [
{
"sessionId": "QoYYFw2t9oKks2niG",
"userId": "rbAXPnMktTFbNpwtJ",
"device": {
"type": "browser",
"name": "Chrome",
"longVersion": "113.0.0.0",
"os": {
"name": "Windows",
"version": "10"
},
"version": "113.0.0"
},
"host": "localhost:3000",
"ip": "172.20.0.2",
"loginAt": "2023-05-23T16:33:45.202Z",
"_id": "QoYYFw2t9oKks2niG",
"current": false
},
{
"sessionId": "WJ2giBwm4B9mcojFi",
"userId": "rbAXPnMktTFbNpwtJ",
"device": {
"type": "mobile",
"name": "Chrome",
"longVersion": "112.0.0.0",
"os": {
"name": "Android",
"version": "10"
},
"version": "112.0.0"
},
"host": "localhost:3000",
"ip": "172.20.0.2",
"loginAt": "2023-05-23T12:43:52.023Z",
"_id": "WJ2giBwm4B9mcojFi",
"current": false
}
],
"total": 2,
"count": 50,
"offset": 0,
"success": true
}Whether the session belongs to the device making the request.
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}