Retrieve the sessions of all users on the workspace. This endpoint requires 2FA.
Permission required: view-device-management
Changelog
Version | Description |
---|---|
5.0.0 | Added |
The user ID.
The authentication token.
The 2FA code from the authentication method. If the method is password, encrypt it as SHA256.
The desired method to get the 2FA code. It can be email
, totp
, or password
.
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": "o94SveQp6fyPsoiNC",
"userId": "2tTEqR7ZNMJ4HGGNa",
"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-24T00:25:54.234Z",
"_user": {
"username": "testroxie",
"name": "Test"
},
"_id": "o94SveQp6fyPsoiNC"
},
{
"sessionId": "BdSrCZXNKCbRi8Eqn",
"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-24T00:25:52.246Z",
"_user": {
"username": "test.test",
"name": "test test"
},
"_id": "BdSrCZXNKCbRi8Eqn"
},
{
"sessionId": "tTouumJMrHMjnedWf",
"userId": "GonjPyg3gB3Z9ur9s",
"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-23T19:14:29.865Z",
"_user": {
"name": "test",
"username": "test.test"
},
"_id": "tTouumJMrHMjnedWf"
},
{
"sessionId": "7ykYEK3KWnk4EeA7s",
"userId": "2tTEqR7ZNMJ4HGGNa",
"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-23T19:14:28.717Z",
"_user": {
"username": "testroxie",
"name": "Test"
},
"_id": "7ykYEK3KWnk4EeA7s"
},
{
"sessionId": "jfD6mnHnrEJdPq9MF",
"userId": "stjxrXYBWy3EcDugH",
"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-23T15:21:57.188Z",
"_user": {
"username": "rocket.agent",
"name": "Rocket Agent"
},
"_id": "jfD6mnHnrEJdPq9MF"
},
{
"sessionId": "2jQnfG74X3EZYL9tj",
"userId": "rYhzFRd2QZjNwAAXX",
"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-23T15:19:48.723Z",
"_user": {
"name": "Rodriq",
"username": "rodriq"
},
"_id": "2jQnfG74X3EZYL9tj"
},
{
"sessionId": "fsfE772s78AmPxGKk",
"userId": "uZ5JvvioeHK8Coyqe",
"device": {
"type": "browser",
"name": "Firefox",
"longVersion": "112.0",
"os": {
"name": "Windows",
"version": "10"
},
"version": "112.0"
},
"host": "localhost:3000",
"ip": "172.18.0.4",
"loginAt": "2023-05-16T20:50:33.608Z",
"_user": {
"username": "user-0"
},
"_id": "fsfE772s78AmPxGKk"
},
{
"sessionId": "W4y9xkjyqFvbjENco",
"userId": "b66oZ8i9pkeSko33v",
"device": {
"type": "browser",
"name": "Chrome",
"longVersion": "113.0.0.0",
"os": {
"name": "Windows",
"version": "10"
},
"version": "113.0.0"
},
"host": "localhost:3000",
"ip": "172.18.0.4",
"loginAt": "2023-05-16T12:46:09.469Z",
"_user": {
"username": "guester",
"name": "Guester"
},
"_id": "W4y9xkjyqFvbjENco"
},
{
"sessionId": "94yTWFkADGBvE9t7P",
"userId": "aspKK7FHe7iQgzexX",
"device": {
"type": "browser",
"name": "Firefox",
"longVersion": "112.0",
"os": {
"name": "Windows",
"version": "10"
},
"version": "112.0"
},
"host": "localhost:3000",
"ip": "172.18.0.4",
"loginAt": "2023-05-11T18:47:13.865Z",
"_user": {
"username": "user-00",
"name": "User 00"
},
"_id": "94yTWFkADGBvE9t7P"
}
],
"total": 13,
"count": 50,
"offset": 0,
"success": true
}
Bad Request
{
"success": false,
"error": "TOTP Required [totp-required]",
"errorType": "totp-required",
"details": {
"method": "password",
"codeGenerated": false,
"availableMethods": []
}
}
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}
Forbidden
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}