Revoke Active Session
Revoke one other active session owned by the current user. Use /auth/logout for the bearer session making the request.
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 | The target session must belong to the caller and cannot be the current bearer session. |
Request fields
| Field | Type | Contract |
|---|---|---|
session_id | integer path parameter | Owned session ID returned by GET /auth/sessions. |
| Request body | none | No body is accepted. |
Code examples
import osfrom memorysync import ControlPlaneClientclient = ControlPlaneClient(base_url="https://api.memorysync.io",access_token=os.environ["MEMORYSYNC_ACCESS_TOKEN"],)client.revoke_session(302)
Response shape
- A successful response has status 204 and no body.
- Attempting to revoke the current session through this route is rejected; use
/auth/logout.
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
RESULTRemove the confirmed session from local state after 204.
- 05
Reconcile
SAFEIf the result is uncertain, list active sessions before sending another revoke.
Security notes
Required
Keep organization controls inside trusted boundaries.
- Only present session IDs returned for the current user.
- Require user confirmation for remote sign-out.
- Do not reveal whether an unowned session ID exists.
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.