List all service enrollments (auditor-only)
const url = 'https://example.com/api/admin/enrollments?limit=25&q=%22alice%22';const options = {method: 'GET', headers: {'X-Ssoossh-Key-Secret': '<X-Ssoossh-Key-Secret>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/admin/enrollments?limit=25&q=%22alice%22' \ --header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>'Returns a paged list of all service enrollments across users, searchable by approver name, principals, key ID, or request ID. Visible to auditors. Newest first, with cursor-based pagination (not offset): pass the previous page’s next_cursor as after.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Enrollment ID to start after (cursor): the previous page’s next_cursor
Page size (default 25, max 100)
Example
25Search query (max 200 chars)
Example
"alice"Responses
Section titled “Responses”Paged enrollment list
object
object
ApprovedByUsername and ApprovedByEmail name the user who approved this enrollment. Provenance, not ownership — the code outlives their access to it and is not theirs to move.
CertificateValidSeconds is how long each redeemed certificate is valid.
CreatedAt is when the enrollment was approved.
ExpiresAt bounds the code.
FirstRedeemedAt is the first successful redemption, absent for a code that has never produced a certificate.
KeyID is likewise fixed at approval and lands verbatim in every certificate.
LastRetrievedAt is the most recent redemption attempt.
NotificationEmail is where notifications about this enrollment go instead of to every holder of the service account. Empty means they fan out. Visible to auditors because it decides who hears about a credential; changing it needs SOC.
Options are the certificate options fixed at approval, already narrowed by server config: what a redemption actually grants, not what the client asked for.
object
Principals is what every certificate this code produces carries.
PublicKeyFingerprint identifies the keypair the code is bound to. Empty if the stored key could not be parsed.
RetrievalCount counts every logged redemption attempt.
ServiceAccount is the account this code was approved for, and who owns it: everyone holding the account (see https://mnestor.github.io/ssoossh/concepts/service-certificates/).
NextCursor is the after for the following page: the id of this page’s last row, absent on the last page.
Total is how many enrollments match the search, across all pages.
Example generated
{ "enrollments": [ { "approved_by_email": "example", "approved_by_username": "example", "certificate_valid_seconds": 1, "created_at": "example", "expires_at": "example", "first_redeemed_at": "example", "id": "example", "key_id": "example", "last_retrieved_at": "example", "notification_email": "example", "options": { "extensions": [ "example" ], "force_command": "example", "no_touch_required": true, "source_addresses": [ "example" ] }, "principals": [ "example" ], "public_key_fingerprint": "example", "retrieval_count": 1, "service_account": "example" } ], "next_cursor": "example", "total": 1}Invalid paging/search parameters, an after that names no enrollment, or offset
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}Not authenticated
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}Not authorized as auditor
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}