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
The page number to retrieve (minimum: 1).
Number of items per page (minimum: 1, maximum: 100).
Response
Array of session objects.
The session token identifier.
ISO 8601 timestamp of when the session was created.
ISO 8601 timestamp of when the session expires.
Unix timestamp (milliseconds) of expiration time.
Whether this is the current session making the request.
The IP address associated with this session.
The user agent string from the session.
Parsed browser name from the user agent.
Parsed operating system name from the user agent.
Parsed device name from the user agent.
ISO 8601 timestamp of when the session was last active.
ISO 8601 timestamp of when the session was first seen.
Browser fingerprint (only available for current session).
The token of the current session, if available.
Pagination metadata.
Number of items per page.
Total number of sessions.
{
"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
Whether to revoke the current session as well. If true, you will be logged out.
Response
Information about the revocation.
The number of sessions revoked (always 1 in current implementation).
Whether the current session was revoked.
{
"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
The session token to revoke.
Response
Information about the revocation.
Whether the session was successfully revoked.
Whether the revoked session was the current session.
{
"data": {
"revoked": true,
"currentSessionRevoked": false
}
}
Error Codes
Missing session token in request path.
Session not found or failed to revoke.
Revoking your current session will log you out immediately.