/api/user/sessions

View and manage the logged in user's sessions.

Info

This endpoint requires authentication.

GET
Request

Get the current and other sessions.

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
currentstringThe session ID of the current browser session.
otherstring[]Other session IDs for this user (excluding current).
{
"current": "MW4kw66bAsosVnaAB2VyuCRt6Sh2XNfo",
"other": ["TOW2VBpuVWhBrum4F7EYat353xUpR3J2"]
}

DELETE
Request

Delete and invalidate a session.

Body

Content-Type: application/json

PropertyTypeDescription
sessionIdstring?Session ID to invalidate (cannot delete the current session).
allboolean?If true, removes all sessions except the current session.

Example

{
"sessionId": "TOW2VBpuVWhBrum4F7EYat353xUpR3J2"
}

or to invalidate all other sessions:

{
"all": true
}

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
currentstringThe session ID of the current session.
otherstring[]Remaining other sessions after the change.

Error Responses

  • 400 Bad Request
    • Trying to delete the current session. This should be done through the logout endpoint.
    • Invalid session id
    • Missing required properties


Last updated: 5/28/2025
Edit this page on GitHub