Start passkey registration
/auth/passkey/registration/options
Issues the PublicKeyCredentialCreationOptionsJSON for navigator.credentials.create() and parks the challenge server-side for 5 minutes, keyed to the signed-in user. Starting a second registration invalidates the first.
Session only. An API token is rejected with 403, and so is a session that is impersonating another user — a credential enrolled under impersonation would outlive the support session and sign in as the user forever.
Step-up required. A passkey outlives logout, session revocation and a password reset, so a session cookie alone is not enough to add one: the caller must re-prove a factor the cookie does not carry. Send {} first: the call answers 400 with a StepUpRequired body whose step_up_factors lists, in order, what this account may prove — passkey (it already has one; options from POST /auth/passkey/step-up/options), totp (it has an authenticator app), and otherwise email_code (the code from POST /auth/step-up/email-code, sent for passkey_register) or, under enforced SSO, reauth. Retry with the matching field filled in. reauth has no field: it passes only on a session signed in within the last 15 minutes, so sign in again, then retry. A proof for a factor not in the list is ignored. Five failed attempts per user in 15 minutes answer 429; the count is shared with the other step-up checks (API token creation, two-factor changes, MCP server creation and MCP client approval).
Request Body
The PublicKeyCredential returned by navigator.credentials.get(), JSON-serialized (base64url). Extra fields the browser adds are accepted and ignored.
4 properties
base64url. Max 64 KB.
base64url. Max 64 KB.
base64url. Max 64 KB.
base64url. Max 64 KB. Ignored — the credential ID resolves the user.
base64url credential ID. Max 64 KB.
base64url credential ID. Max 64 KB.
Always public-key. Max 64 characters.
public-keyThe 6-digit code from POST /auth/step-up/email-code, sent for passkey_register. Checked only when step_up_factors includes email_code.
Current code from the authenticator app. Checked only when step_up_factors includes totp.
Response Body
v1 asks for no attestation.
nonenone
residentKey: required because sign-in is usernameless, and userVerification: required so every assertion carries a second factor — which is what lets a passkey login satisfy mfa_required.
truerequiredrequiredbase64url challenge. Single-use, stored server-side for 5 minutes.
KcFagQyHSuG-Ds86-L3A-acvh4G_RfEbZCzPphaw6K4The user's existing credentials, so an authenticator they already enrolled refuses to register a duplicate.
public-keyClient extensions the library asks for. credProps lets the browser report back whether the credential really was created as discoverable.
trueAlways empty — v1 gives the browser no authenticator hints.
Offered algorithms — Ed25519 (-8), ES256 (-7), RS256 (-257).
-7public-keyRelying party. id is the environment's APP_URL host, so a passkey registered on one environment is never offered on another.
app.truto.oneTrutoBrowser-side ceremony timeout in milliseconds.
60000User handle the authenticator groups credentials under. id is the base64url-encoded Truto user id.
Jane DoeMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExjane@acme.comErrors
| Status | Description |
|---|---|
400 | Step-up proof missing or wrong (body carries step_up, step_up_factors and step_up_action), the per-user cap of 20 passkeys is already reached, unknown body keys, or a body that is not JSON. |
401 | Not signed in. |
403 | Not a browser session, the session is impersonating, or the organization enforces SSO (non-staff). |
404 | Passkeys are not enabled for this environment. |
429 | More than 5 failed step-up attempts for this user in 15 minutes, across every step-up check. |
curl -X POST 'https://api.truto.one/auth/passkey/registration/options' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"totp_code": "your_totp_code",
"email_code": "your_email_code",
"passkey": {}
}'const body = {
"totp_code": "your_totp_code",
"email_code": "your_email_code",
"passkey": {}
};
const response = await fetch('https://api.truto.one/auth/passkey/registration/options', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your_api_token>',
'Content-Type': 'application/json',
},
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);import requests
url = "https://api.truto.one/auth/passkey/registration/options"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"totp_code": "your_totp_code",
"email_code": "your_email_code",
"passkey": {}
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())