Skip to main content

List Sessions

curl -X GET "https://panel.example.com/api/account/sessions?page=1&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
Retrieve a paginated list of active sessions for the authenticated user.

Query Parameters

page
number
default:"1"
The page number to retrieve (minimum: 1).
limit
number
default:"50"
Number of items per page (minimum: 1, maximum: 100).

Response

data
array
Array of session objects.
currentToken
string | null
The token of the current session, if available.
pagination
object
Pagination metadata.
{
  "data": [
    {
      "token": "session_abc123xyz789",
      "issuedAt": "2024-03-01T10:00:00.000Z",
      "expiresAt": "2024-03-31T10:00:00.000Z",
      "expiresAtTimestamp": 1711882800000,
      "isCurrent": true,
      "ipAddress": "192.168.1.100",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
      "browser": "Chrome",
      "os": "Windows 10",
      "device": "Desktop",
      "lastSeenAt": "2024-03-15T14:30:00.000Z",
      "firstSeenAt": "2024-03-01T10:00:00.000Z",
      "fingerprint": "fp_1a2b3c4d5e6f"
    }
  ],
  "currentToken": "session_abc123xyz789",
  "pagination": {
    "page": 1,
    "perPage": 50,
    "total": 1,
    "totalPages": 1
  }
}

Delete All Sessions

curl -X DELETE "https://panel.example.com/api/account/sessions?includeCurrent=false" \
  -H "Authorization: Bearer YOUR_API_KEY"
Revoke all other sessions, optionally including the current session.

Query Parameters

includeCurrent
boolean
default:"false"
Whether to revoke the current session as well. If true, you will be logged out.

Response

data
object
Information about the revocation.
{
  "data": {
    "revoked": 1,
    "currentSessionRevoked": false
  }
}
Setting includeCurrent=true will revoke your current session and log you out.

Delete Specific Session

curl -X DELETE "https://panel.example.com/api/account/sessions/session_abc123xyz789" \
  -H "Authorization: Bearer YOUR_API_KEY"
Revoke a specific session by its token.

Path Parameters

token
string
required
The session token to revoke.

Response

data
object
Information about the revocation.
{
  "data": {
    "revoked": true,
    "currentSessionRevoked": false
  }
}

Error Codes

400
error
Missing session token in request path.
404
error
Session not found or failed to revoke.
Revoking your current session will log you out immediately.