Skip to content

List all service enrollments (auditor-only)

GET
/api/admin/enrollments
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.

after
string

Enrollment ID to start after (cursor): the previous page’s next_cursor

limit
integer

Page size (default 25, max 100)

Example

25
q
string

Search query (max 200 chars)

Example

"alice"

Paged enrollment list

Media typeapplication/json
object
enrollments
required
Array<object>
object
approved_by_email
required
string
approved_by_username
required

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.

string
certificate_valid_seconds

CertificateValidSeconds is how long each redeemed certificate is valid.

integer
created_at
required

CreatedAt is when the enrollment was approved.

string
expires_at
required

ExpiresAt bounds the code.

string
first_redeemed_at

FirstRedeemedAt is the first successful redemption, absent for a code that has never produced a certificate.

string
id
required
string
key_id
required

KeyID is likewise fixed at approval and lands verbatim in every certificate.

string
last_retrieved_at

LastRetrievedAt is the most recent redemption attempt.

string
notification_email

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.

string
options
required

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
extensions
required
Array<string>
force_command
string
no_touch_required
required
boolean
source_addresses
Array<string>
principals
required

Principals is what every certificate this code produces carries.

Array<string>
public_key_fingerprint

PublicKeyFingerprint identifies the keypair the code is bound to. Empty if the stored key could not be parsed.

string
retrieval_count
required

RetrievalCount counts every logged redemption attempt.

integer
service_account
required

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/).

string
next_cursor

NextCursor is the after for the following page: the id of this page’s last row, absent on the last page.

string
total
required

Total is how many enrollments match the search, across all pages.

integer

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

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Not authenticated

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Not authorized as auditor

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

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.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}