Get the latest test result of a connection

GET /v1/connections/{connection_id}/test-results/latest · permission connections:write

Returns the result of the most recent test sign-in of an enterprise connection from the last 24 hours: status, failure reason, the names of the attributes or claims the identity provider sent, the number of groups and the user fields that received a value through the attribute mapping. Attribute values, the raw SAML assertion and the ID token are never stored or returned. Test results are kept for 24 hours. Reads are not audited.

Request

Field Type Required Description
connection_id path yes Enterprise connection ID (conn_…).

Response

200 OK:

{
  "test_id": "conntest_01j9xr4a6b8c0d2e4f6g8h0j2k",
  "status": "passed",
  "failure_reason": null,
  "attribute_names": ["email", "given_name", "groups"],
  "group_count": 2,
  "mapped_fields": ["email", "given_name"],
  "started_at": "2026-10-20T10:00:00Z",
  "completed_at": "2026-10-20T10:01:12Z"
}
Field Description
status pending (the URL was not opened yet or the identity provider has not answered), passed or failed.
failure_reason Machine-readable reason of a failed test (for example configuration_changed when the connection was changed during the test); otherwise null.
attribute_names Names of the attributes or claims the identity provider sent (not their values).
group_count Number of groups received.
mapped_fields User fields that received a value through the attribute mapping (not the values).
started_at, completed_at When the test started and when the identity provider's answer was processed; completed_at is null while pending.

Errors

HTTP code When
404 not_found The connection does not exist in this environment, is not an enterprise connection, or has no test result from the last 24 hours.
401 unauthenticated The credential is missing, invalid or revoked.
403 insufficient_permissions The credential lacks the required permission.
429 rate_limited The rate limit was exceeded; retry after the Retry-After period.
503 service_unavailable A dependency is temporarily unavailable; retry after the Retry-After period.

Example

curl "https://api.eu.keenauth.com/v1/connections/conn_01j9xp6q0r1s5t7v9w1x3y5z7b/test-results/latest" \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
keenauth connections test-results latest conn_01j9xp6q0r1s5t7v9w1x3y5z7b