List Client Sessions

GET /v1/endpoints/{id}/rbac/clients/{client_id}/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/{id}/revoke or all at once via POST .../sessions/revoke-all.

Path parameters

id string (uuid) Req
Endpoint UUID.
client_id int64 Req
Client ID.

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.

[].id int64
Session ID. Use in revoke calls.
[].endpoint_id, client_id int64
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.

Errors

401 Unauthorized
Missing auth.
404 Not Found
Endpoint doesn't exist or doesn't belong to the calling account.
Request
curl "https://api.ngris.com/v1/endpoints/<uuid>/rbac/clients/11/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/<endpoint_uuid>/rbac/clients/11/sessions" ) for s in sessions: if s["is_active"]: print(f"#{s['id']} {s['ip_address']} ({s.get('user_agent')})")
Response — 200 OK
[ { "id": 1, "endpoint_id": 184, "client_id": 11, "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 } ]
On this page
List Client Sessions
Iris