/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
Property | Type | Description |
---|---|---|
current | string | The session ID of the current browser session. |
other | string[] | Other session IDs for this user (excluding current). |
{"current": "MW4kw66bAsosVnaAB2VyuCRt6Sh2XNfo","other": ["TOW2VBpuVWhBrum4F7EYat353xUpR3J2"]}
DELETE Request
Delete and invalidate a session.
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
sessionId | string? | Session ID to invalidate (cannot delete the current session). |
all | boolean? | 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
Property | Type | Description |
---|---|---|
current | string | The session ID of the current session. |
other | string[] | 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