Revoke Session

POST /v1/endpoints/{uuid}/rbac/clients/{client_uuid}/sessions/{session_uuid}/revoke

End a single active session. The session is marked revoked, and its token is rejected on later requests. Use this to log out a client from one specific device without affecting their other sessions (e.g. user reports a stolen laptop).

Revoking a session that doesn't exist for this endpoint/client (already revoked, expired-and-pruned, or not yours) returns 404 — this call is not idempotent. To kill every active session for a client, use POST .../sessions/revoke-all.

Path parameters

uuid string (uuid) Req
The endpoint's uuid from /endpoints.
client_uuid string (uuid) Req
The RBAC client's uuid. Resolved under this endpoint only.
session_uuid string (uuid) Req
The session's uuid from list sessions. Resolved under this client only.

Deprecated: legacy integer ids are still accepted in the path until the sunset, answered with Deprecation and Sunset headers. Use the uuids.

Request body

None — empty body or {}.

Response (200 OK)

endpoint_uuid, client_uuid, session_uuid string (uuid)
Echo of the revoked session's endpoint, client and session.
message string
"Session revoked successfully".

Deprecated: until the sunset this response also carries the legacy integer id and *_id fields. Don't use them; read uuid and the *_uuid fields.

Errors

400 Bad Request
An integer client or session id after the sunset (integer_id_unsupported).
401 Unauthorized
Missing auth.
403 Forbidden
Caller lacks the endpoints:delete permission in the active account.
404 Not Found
Endpoint doesn't belong to the calling account (endpoint not found), the client isn't a client of this endpoint (client not found), or no matching active session exists for this client (session not found).
Request
curl -X POST \ "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/sessions/019b65dc-c0b3-7240-816e-2a3305e5f5eb/revoke" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") client._post_void( "/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/sessions/019b65dc-c0b3-7240-816e-2a3305e5f5eb/revoke", {}, )
Response — 200 OK
{ "endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e", "client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "session_uuid": "019b65dc-c0b3-7240-816e-2a3305e5f5eb", "message": "Session revoked successfully" }
Was this helpful?
On this page
Revoke Session
Was this helpful?