List Client Sessions

GET /v1/endpoints/{uuid}/rbac/clients/{client_uuid}/sessions

List active and recent sessions for an RBAC client — useful for admin audit views and security reviews ("did this user log in from somewhere unexpected?"). Each session represents one authenticated browser/device connection.

By default only currently-valid sessions (not revoked, not yet expired) are returned. Active sessions can be revoked individually via POST .../sessions/{session_uuid}/revoke or all at once via 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.

Deprecated: the legacy integer id is still accepted in the path until the sunset, answered with Deprecation and Sunset headers. Use the uuid.

Query parameters

include_expired boolean
When true, also include expired sessions. Revoked sessions are always excluded. Default false.

Response (200 OK)

A bare JSON array of session objects (not wrapped in an envelope), ordered by created_at DESC.

[].uuid string (uuid)
The session's public id. Use it in revoke calls.
[].endpoint_uuid, client_uuid string (uuid)
Owning endpoint and client.
[].created_at datetime
Login time.
[].expires_at datetime
Auto-expiry time.
[].last_activity_at datetime
Most recent request from this session.
[].ip_address string
Client IP at login time.
[].user_agent string
User-Agent header from login. Omitted if empty.
[].revoked_at datetime?
When the session was revoked, if applicable.
[].is_active boolean
false when revoked or expired.

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 id after the sunset (integer_id_unsupported).
401 Unauthorized
Missing auth.
404 Not Found
Endpoint doesn't exist or doesn't belong to the calling account, or the client isn't a client of this endpoint (client not found).
Request
curl "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/sessions" \ -H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") sessions = client._get_raw( "/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/sessions" ) for s in sessions: if s["is_active"]: print(f"{s['uuid']} {s['ip_address']} ({s.get('user_agent')})")
Response — 200 OK
[ { "uuid": "019b65dc-c0b3-7240-816e-2a3305e5f5eb", "endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e", "client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "created_at": "2026-04-29T11:00:00Z", "expires_at": "2026-04-30T11:00:00Z", "last_activity_at": "2026-04-29T13:45:00Z", "ip_address": "203.0.113.42", "user_agent": "Mozilla/5.0 (Macintosh) Chrome/123", "is_active": true } ]
Was this helpful?
On this page
List Client Sessions
Was this helpful?