Skip to content
Directory & LifecycleMarkdown

Self-service

What a signed-in user reads and manages for themselves, with no administrator involved, from their own profile to the passkeys and apps on their account.

AvailableDashboard and API

A signed-in user doesn’t need an administrator to see who the realm thinks they are, or to clean up their own account. With their own session they read their profile and their roles, list the passkeys and authenticator apps they hold and remove one they’ve lost, and see and take back the apps and agents they allowed. Each of these works for every user of the realm, staff and customers alike, and needs no set-up.

  • Privilege: none. Each call is made with the user’s own session and acts on their own account only.
  • Where: the API, and the dashboard pages users use themselves (AI Agents, Approvals, Authorized Apps and FIDO Devices).
  • The user is signed in to their own realm.

Every call here is made with the user’s own session, the one they hold after signing in, and acts on their own account only. None of them needs a realm administrator’s rights.

What the user doesCall
Read who they are: profile, roles and sessionPOST /whoami/v1
List their passkeys, authenticator apps and recovery codesGET /devices/v1
Remove a passkey or an authenticator appDELETE /devices/v1/{id}
List the apps they allowed, and remove oneGET /me/v1/oauth2/apps, DELETE /me/v1/oauth2/apps/{clientId}
List the agents that may act for them, and remove oneGET /me/v1/oauth2/agents, DELETE /me/v1/oauth2/agents/{agent}
See and answer what an agent asks them to approveGET /me/v1/oauth2/approvals, POST /me/v1/oauth2/approvals/{id}

The apps are covered in Authorized apps; the agents and approvals in Let users remove agents and Backchannel authentication.

whoami answers, in one call, who the session belongs to (id, realm), the user’s own record (user, without the password, with webAuthnDeviceCount, the number of passkeys they hold), their administrator roles in the realm, and the session’s facts: authLevel, authType, authInstant and expiresInSecs.

devices/v1 lists every factor the user holds, without its secret: each with its id, kind (webauthn for a passkey, totp for an authenticator app, recovery for recovery codes), name, lastUsedAt, and whether it is disabled. A passkey adds what it is (aaguid, keyType, algorithm, whether it is backed up); an app adds its algorithm, digits and period; recovery codes add how many are remaining. Add ?kind=webauthn to list one kind.

There’s nothing to set up. As a signed-in user, with your own session in $CVYUH_SESSION (see Call the API):

Terminal window
curl -X POST https://foobar.cvyuh.com/api/v0/am/whoami/v1 \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

List your passkeys:

Terminal window
curl "https://foobar.cvyuh.com/api/v0/am/devices/v1?kind=webauthn" \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
{ "data": [
{ "id": "<device id>", "kind": "webauthn", "name": "<name>", "lastUsedAt": "<RFC 3339 time>",
"disabled": false, "backupEligible": true, "backupState": true, "keyType": "<key type>", "algorithm": "<algorithm>" }
] }

Remove one you’ve lost:

Terminal window
curl -X DELETE https://foobar.cvyuh.com/api/v0/am/devices/v1/<device id> \
-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"

The realm answers 204.

  • A removed passkey or authenticator app stops working at once; the next sign-in asks for another factor.
  • Apps that follow the user’s credential changes are told of each removal (see below).
AnswerWhat it meansWhat to do
401The session has endedSign in again
404No such factor on this account, or the call was made in a realm other than the user’s ownCheck the id from the list; call the user’s own realm
400A DELETE on recovery codes, which aren’t removed one at a timeKeep them; they’re the way back in

Each removal is recorded as DELETED on the factor, with the user as the one who made it, and as a credential change sent to anyone following the user’s credential changes through Send signals.

SymptomCauseFix
A user has lost or removed every factor and can’t sign inRecovery codes are the way back in; without them, no administrator call clears a user’s factors todayThe user signs in with a recovery code and adds a new factor. If they have none left, see the known limitation below
whoami answers user: nullThe call was made in a realm below the user’s ownCall the user’s own realm for their record

When a user has no way back in. An administrator can’t yet remove another user’s factors or issue new recovery codes, and users can’t rename factors or make new recovery codes themselves. Ask users to keep their recovery codes, and to hold more than one factor. See Known limitations.

  • Only in the user’s own realm. Listing or removing factors in any other realm answers 404.
  • Recovery codes aren’t removed one at a time. They are the way back in when every other factor is gone; a DELETE on them answers 400.
  • whoami reads the user’s record only in their own realm. Asked in a realm below theirs, user is null, while roles says what they may administer there.