Documentation

Session Management

View and manage admin login sessions

List Your Sessions

View all active sessions for your account.

Endpoint

GET/auth/admin/sessions

List all active sessions for the authenticated admin.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}

Response- List of sessions

json
{
  "sessions": [
    {
      "session_id": "550e8400-e29b-41d4-a716-446655440000",
      "created_at": "2025-01-14T10:30:00Z",
      "expires_at": "2025-01-21T10:30:00Z",
      "revoked_at": null,
      "current": true,
      "ip_address": "192.168.1.100",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
      "last_used_at": "2025-01-14T12:00:00Z"
    },
    {
      "session_id": "660e8400-e29b-41d4-a716-446655440001",
      "created_at": "2025-01-10T08:00:00Z",
      "expires_at": "2025-01-17T08:00:00Z",
      "revoked_at": null,
      "current": false,
      "ip_address": "10.0.0.50",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0)",
      "last_used_at": "2025-01-13T15:30:00Z"
    }
  ]
}

Session Fields

FieldTypeDescription
session_idUUIDUnique session identifier
created_attimestampWhen the session was created
expires_attimestampWhen the session will expire
revoked_attimestampWhen revoked (null if active)
currentbooleanTrue if this is the current session
ip_addressstringIP address of the session
user_agentstringBrowser/device user agent
last_used_attimestampLast activity time

Revoke Session

Terminate a specific session.

Endpoint

DELETE/auth/admin/sessions/{sessionID}

Revoke a specific session. The session will be immediately invalidated.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}

Path Parameters

ParameterTypeRequiredDescription
sessionIDstringYesUUID of the session to revoke

Response- No content on success (HTTP 204)

json

Error Responses

StatusCodeDescription
404not_foundSession not found or already revoked

Revoke All Sessions

Terminate all your sessions at once.

Endpoint

POST/auth/admin/sessions/revoke-all

Revoke all sessions for the authenticated admin. Optionally preserve the current session.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}
Content-TypestringYesapplication/json

Request Body- Revocation options

json
{
  "include_current": false
}

Response- No content on success (HTTP 204)

json

Request Body Parameters

FieldTypeDefaultDescription
include_currentbooleanfalseIf true, also revokes the current session (logs you out)

List User Sessions (Admin)

View sessions for another admin user.

Endpoint

GET/auth/admin/users/{userID}/sessions

List all sessions for a specific admin user. Requires admin role.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}

Path Parameters

ParameterTypeRequiredDescription
userIDstringYesUUID of the admin user

Response- List of user's sessions

json
{
  "sessions": [
    {
      "session_id": "550e8400-e29b-41d4-a716-446655440000",
      "created_at": "2025-01-14T10:30:00Z",
      "expires_at": "2025-01-21T10:30:00Z",
      "current": false,
      "ip_address": "192.168.1.100",
      "user_agent": "Mozilla/5.0...",
      "last_used_at": "2025-01-14T12:00:00Z"
    }
  ]
}

Error Responses

StatusCodeDescription
403forbiddenAdmin role required

Revoke User Session (Admin)

Terminate a specific session for another user.

Endpoint

DELETE/auth/admin/users/{userID}/sessions/{sessionID}

Revoke a specific session for another admin user. Requires admin role.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}

Path Parameters

ParameterTypeRequiredDescription
userIDstringYesUUID of the admin user
sessionIDstringYesUUID of the session to revoke

Response- No content on success (HTTP 204)

json

Error Responses

StatusCodeDescription
403forbiddenAdmin role required
404not_foundSession not found

Revoke All User Sessions (Admin)

Terminate all sessions for another user.

Endpoint

POST/auth/admin/users/{userID}/sessions/revoke-all

Revoke all sessions for a specific admin user. Requires admin role.

Headers

ParameterTypeRequiredDescription
AuthorizationstringYesBearer {access_token}

Path Parameters

ParameterTypeRequiredDescription
userIDstringYesUUID of the admin user

Response- No content on success (HTTP 204)

json

Error Responses

StatusCodeDescription
403forbiddenAdmin role required