AuthnAuthzAPI
Get Started
Get Started
  1. Session Management
  • Overview
  • Registration & Onboarding
    • Register a new user
      POST
    • Verify email address
      POST
    • Resend verification code
      POST
  • Authentication
    • Login user
      POST
    • Logout user
      POST
    • Request a password reset email
      POST
    • Verify password reset token
      POST
    • Update password
      POST
    • Refresh access token
      POST
    • Get current authenticated user
      GET
  • OAuth Authentication
    • OAuth authentication
      GET
    • OAuth callback
      GET
  • Session Management
    • Get all sessions
      GET
    • Revoke session
      DELETE
    • Revoke all sessions
      DELETE
  • Profile Management
    • View profile information
      GET
    • Update profile information
      PATCH
  1. Session Management

Get all sessions

Developing
GET
/sessions
Retrieves all active and historical sessions associated with the authenticated user's account. This endpoint enables users to monitor account activity across devices, browsers, and locations, identify the current session, and manage active sessions for account security.
The system maintains server-side session records for every successful authentication and stores session metadata including user ID, IP address, user agent, device information, geolocation, creation timestamp, expiration timestamp, and activity status. Users can view all active sessions and remotely terminate other sessions.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or

Responses

🟢200Success
application/json
Bodyapplication/json

🟠401Token Missing
🟠401Invalid Token
🟠401Token Expired
🟠403Account Not Exists
🟠403Account Soft Deleted
🟠403Account Deactivated
🟠403Account Locked
🟠403Account Not Verified
🟠401Session Not Found
🟠401Session Revoked
🟠401Session Expired
🟠429Rate Limit Exceeded
🔴500Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'http://localhost:3000/api/v1/sessions' \
--header 'Authorization: Bearer <token>'
Response Response Example
200 - Example
{
    "status": "success",
    "message": "Active sessions retrieved successfully.",
    "data": {
        "sessions": [
            {
                "id": "a8eb2b2823418d108d38d20c8a0148318ecbf904",
                "user_id": "1ce65d8ee01af3622a3566b9e67911c14066e1a4",
                "ip_address": "ebdd:2fd0:2fe5:cffc:e173:e1ca:8661:d5d4",
                "user_agent": "Mozilla/5.0 (Windows; U; Windows NT 6.1) AppleWebKit/532.0.0 (KHTML, like Gecko) Chrome/15.0.857.0 Safari/532.0.0",
                "device_info": {
                    "name": "Chrome on Windows",
                    "operating_system": "Windows",
                    "type": "Desktop",
                    "browser": "Chrome"
                },
                "geolocation": {
                    "country_code": "SA",
                    "country": "Eswatini",
                    "region": "Lake Mylene",
                    "city": "Port Guadalupeborough",
                    "latitude": 64.3546,
                    "longitude": -85.4859,
                    "timezone": "Europe/San_Marino"
                },
                "is_active": false,
                "last_active_at": "2026-07-16T12:43:57.461Z",
                "is_current": true,
                "created_at": "2026-07-16T12:43:57.461Z",
                "updated_at": "2026-07-16T12:43:57.461Z"
            },
            {
                "id": "a6613bcffe90bb684a86d4e13cbe520087fc3868",
                "user_id": "dc30de4f6285dd78687b023397d3df6b957d02df",
                "ip_address": "cecd:dc25:2c3a:9f06:de86:6b49:3285:985e",
                "user_agent": "Opera/9.78 (X11; Linux i686; U; LA Presto/2.9.186 Version/10.00)",
                "device_info": {
                    "name": "Chrome on Windows",
                    "operating_system": "Windows",
                    "type": "Desktop",
                    "browser": "Chrome"
                },
                "geolocation": {
                    "country_code": "IM",
                    "country": "Papua New Guinea",
                    "region": "East Kyleefield",
                    "city": "West Ismaelworth",
                    "latitude": 26.3537,
                    "longitude": -178.9834,
                    "timezone": "Europe/Jersey"
                },
                "is_active": false,
                "last_active_at": "2026-07-16T12:43:57.464Z",
                "is_current": false,
                "created_at": "2026-07-16T12:43:57.464Z",
                "updated_at": "2026-07-16T12:43:57.464Z"
            },
            {
                "id": "ab3f7f24822c40d294c778256b51c64f57ffea3f",
                "user_id": "b6712c6d7cac30120ce74e6199f2702e32be35fc",
                "ip_address": "a97f:9a73:0c36:9a1f:3c16:e7de:0e3f:6bfe",
                "user_agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; Trident/4.1)",
                "device_info": {
                    "name": "Chrome on Windows",
                    "operating_system": "Windows",
                    "type": "Desktop",
                    "browser": "Chrome"
                },
                "geolocation": {
                    "country_code": "TM",
                    "country": "Turkmenistan",
                    "region": "Charleneland",
                    "city": "Marvinfurt",
                    "latitude": -18.3353,
                    "longitude": 26.6064,
                    "timezone": "Africa/Ouagadougou"
                },
                "is_active": false,
                "last_active_at": "2026-07-16T12:43:57.467Z",
                "is_current": false,
                "created_at": "2026-07-16T12:43:57.467Z",
                "updated_at": "2026-07-16T12:43:57.467Z"
            }
        ]
    }
}
Modified at 2026-07-18 20:07:53
Previous
OAuth callback
Next
Revoke session
Built with