List Active Sessions
List the current user’s active sessions through the safe self-service endpoint without exposing refresh-token hashes or device fingerprints.
Endpoint contract
Use the exact method and path shown above. Paths are relative to the API base URL.
Authentication, permission, and scope
| Control | Required contract |
|---|---|
| Authentication | Bearer access token for the current user. |
| Permission or scope | Current authenticated session. |
| Resource scope | Only active, non-expired sessions owned by the caller are returned. |
Request fields
| Field | Type | Contract |
|---|---|---|
| Request body | none | This endpoint accepts no request body. |
Code examples
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)sessions = client.list_sessions()
Response shape
{"sessions":[{"id":301,"is_current":true,"session_type":"browser","session_name":"Chrome on Windows","user_agent":"Mozilla/5.0","ip":"203.0.113.10","location":"Example City","geo":null,"created_at":"2026-07-31T09:00:00Z","last_activity_at":"2026-08-01T11:55:00Z","expires_at":"2026-08-08T09:00:00Z"}],"current_session_id":301}
- The response intentionally omits refresh-token hashes, token-family details, and device fingerprints.
- Use
is_currentto prevent the wrong revoke action in your UI.
Status outcomes
Read the operation-specific response and persist only fields needed by the task.
Fix invalid path, query, or body fields before trying again.
Refresh authentication or verify the required organization permission and scope.
Treat the resource as unavailable without revealing whether it exists elsewhere.
Use returned retry metadata when present and reconcile uncertain mutations before repeating them.
Production handling
- 01
Authorize
APPConfirm the signed-in principal may perform this product action.
- 02
Validate
INPUTValidate identifiers and body fields before sending the request.
- 03
Call
SDKUse the named ControlPlaneClient method or equivalent HTTPS request from a trusted application context.
- 04
Inspect
RESULTRender active sessions and clearly mark the current one.
- 05
Reconcile
SAFERefresh the list after a revoke or logout-all operation.
Security notes
Required
Keep organization controls inside trusted boundaries.
- Do not use IP or user-agent strings as proof of identity.
- Safely encode session names and location fields.
- Keep bearer tokens out of client-visible logs.
Avoid
Do not weaken the route contract in client code.
- Do not expose bearer or refresh tokens in URLs, logs, or public clients.
- Do not accept organization, member, project, or resource IDs without application authorization.
- Do not treat returned data as trusted HTML, prompt instructions, or proof of application authorization.