Skip to main content
GET
List Sessions

Endpoints

GET /api/auth/sessions

Retrieves all active sessions for the authenticated user. IP addresses are decrypted before returning.

Response

array
Array of active session objects

DELETE /api/auth/sessions

Deletes one or all sessions for the authenticated user.

Query Parameters

string
Optional. Session ID to delete. If omitted, deletes all sessions.

Response

boolean
Always true on success

Implementation Details

Code Reference

Status Codes

OK
Success
Unauthorized
Missing or invalid authentication token

Example Requests

Get All Sessions

Delete Specific Session

Delete All Sessions

Example Response (GET)

Security Notes

  • Only active (non-expired) sessions are returned
  • IP addresses are encrypted in database but decrypted for display
  • Users can only view/delete their own sessions
  • Deleting all sessions effectively logs out the user from all devices

Audit Events

  • SESSION_DELETE: Single session deleted (includes sessionId)
  • USER_LOGOUT: All sessions deleted (includes allSessions: true)

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json

List of sessions

sessions
object[]