Client Login History
Audit trail of authentication attempts (success and failure) by an RBAC client. Distinct from /sessions — that endpoint shows successful sessions; this one shows every attempt, including failures, useful for spotting brute-force attempts or anomalous login locations.
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
limit int
Max records to return. Must be a positive integer; otherwise the default of
50 is used.Response (200 OK)
A bare JSON array of login-history objects (not wrapped in an envelope), most recent first.
[].endpoint_uuid, client_uuid string (uuid)
Owning endpoint and client. Login-history records have no public id of their own.
[].created_at datetime
When the attempt occurred.
[].success boolean
true = authentication succeeded; false = wrong credentials, expired token, etc.[].auth_method string
Method attempted:
username_password, token, oauth, or session.[].oauth_provider string?
Provider type for OAuth attempts (e.g.
google). Omitted otherwise.[].ip_address string
Source IP of the attempt.
[].user_agent string?
User-Agent of the attempt. Omitted if empty.
[].failure_reason string?
Free-text reason set on failed attempts. Omitted on success.
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/login-history" \
-H "X-API-KEY: <your_api_key>"
Python — surface failures
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
hist = client._get_raw(
"/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/clients/019b4b9d-d300-736b-8601-153b3d9f70ee/login-history?limit=100"
)
fails = [e for e in hist if not e["success"]]
print(f"{len(fails)} failed attempts in window")
for e in fails[:5]:
print(f" {e['created_at']} {e['ip_address']} {e.get('failure_reason')}")
Response — 200 OK
[
{
"endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e",
"client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee",
"created_at": "2026-04-29T13:45:00Z",
"success": true,
"auth_method": "oauth",
"oauth_provider": "google",
"ip_address": "203.0.113.42",
"user_agent": "Mozilla/5.0 ..."
},
{
"endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e",
"client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee",
"created_at": "2026-04-29T13:44:30Z",
"success": false,
"auth_method": "username_password",
"ip_address": "198.51.100.7",
"user_agent": "curl/8.0",
"failure_reason": "wrong_password"
}
]
Was this helpful?