Skip to content

Finish setting up a passkey as the second factor

POST /auth/passkey/mfa-setup/registration/verify

Unauthenticated, during sign-in. Verifies the attestation from navigator.credentials.create() against the challenge from POST /auth/passkey/mfa-setup/registration/options (single-use), stores the passkey, issues eight backup codes, and finishes the sign-in as /auth/mfa/token/setup/verify does: it sets the session cookie and spends the mfa_token.

Show the backup codes once, as for the authenticator app: they are the way back in if the passkey is lost. At a later sign-in, enter one on POST /auth/mfa/token/verify-backup with the mfa_token. Each works once. They are returned only here and never stored in plain text.

name is trimmed; a blank string is stored as null. An attestation that does not verify counts as a wrong two-factor answer, on the same budget as wrong codes.

Request Body

responseobject
required·

The PublicKeyCredential returned by navigator.credentials.create(), JSON-serialized (base64url). Extra fields the browser adds (clientExtensionResults, authenticatorAttachment) are accepted and ignored.

responseobject
required
3 properties
attestationObjectstring

base64url. Max 64 KB.

clientDataJSONstring

base64url. Max 64 KB.

transportsstring[]

Transport hints reported by the authenticator. Max 16 entries of 64 characters each.

Example: ["internal","hybrid"]
idstring

base64url credential ID. Max 64 KB.

rawIdstring

base64url credential ID. Max 64 KB.

typestring

Always public-key. Max 64 characters.

Example: public-key
mfa_tokenstring

The mfa_token from the sign-in that answered mfa_setup_required.

namestring

Optional label for the passkey. Trimmed; blank becomes null.

Example: MacBook Touch ID

Response Body

passkeyobject
required·

A registered WebAuthn credential, sanitized for display. Credential material (credential_id, public_key) is never returned.

backup_stateboolean

Whether the credential is currently synced into a backup (the WebAuthn BS flag). Refreshed on every sign-in.

Example: true
created_atstring · date-time

ISO-8601 UTC timestamp of registration.

Example: 2026-07-01T11:03:20.000Z
device_typestring

multiDevice for a synced passkey (iCloud Keychain, Google Password Manager); singleDevice for a device-bound one (a security key, or a platform authenticator that does not sync).

Example: multiDevice
Possible values:
singleDevicemultiDevicenull
idstring · uuid

The unique ID of the passkey. Use this to rename or delete it.

Example: 1ba1f401-7183-47c5-9e39-e8e257e3c795
last_used_atstring · date-time

ISO-8601 UTC timestamp of the last successful sign-in with this passkey; null if it has never been used.

Example: 2026-07-23T09:12:44.000Z
namestring

User-supplied label, or null when the passkey was registered without one.

Example: MacBook Touch ID
backup_codesstring[]

Eight single-use backup codes. Shown only in this response.

successboolean
Example: true

Errors

StatusDescription
400Missing, expired, used or wrong-purpose mfa_token; the account already has a second factor; the challenge expired or was already used; wrong origin or rpId, user verification absent, or a malformed attestation; unknown body keys; or a body that is not JSON.
403The account is turned off.
404Passkeys are not enabled for this environment, or a passkey does not count as a second factor here yet (PASSKEY_MFA is off).
409This credential is already registered.
429Too many wrong two-factor answers for this account, or too many calls.
curl -X POST 'https://api.truto.one/auth/passkey/mfa-setup/registration/verify' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "mfa_token": "your_mfa_token",
  "response": {},
  "name": "MacBook Touch ID"
}'
const body = {
  "mfa_token": "your_mfa_token",
  "response": {},
  "name": "MacBook Touch ID"
};

const response = await fetch('https://api.truto.one/auth/passkey/mfa-setup/registration/verify', {
  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/mfa-setup/registration/verify"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "mfa_token": "your_mfa_token",
    "response": {},
    "name": "MacBook Touch ID"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())