Finish a passkey registration
Verifies the attestation against the registration ceremony and stores
the new passkey for the user. registration_id is the one that
createUserPasskeyRegistration (POST /users/{user_id}/passkeys/registrations)
returned when it started the ceremony. The attestation is
the browser's answer from navigator.credentials.create().
A rejected attestation leaves the ceremony open for a retry. An expired ceremony answers
att.stale_challenge: begin a new registration. An unknown or
already-consumed registration ID answers att.not_found.
oauth2 user.writeAuthorizationBearer <token>Scope: user.write
user_id*stringThe user ID: the id that createUser (POST /users) or queryUsers (POST /users/query) returns.
^user_[a-zA-Z0-9_-]+$registration_id*stringThe registration_id that createUserPasskeyRegistration (POST /users/{user_id}/passkeys/registrations) returns.
application/json- body
The request body for completing a WebAuthn registration ceremony.
attestation*The WebAuthn AttestationResponse object from navigator.credentials.create().
name?stringLabel for the credential in passkey management surfaces. Optional: when omitted, a name is derived from the credential itself.
The registered passkey.
application/json- response
The registered passkey.
id*stringThe unique identifier of the passkey.
name*stringThe name of the passkey.
created_at*stringThe timestamp when the passkey was created.
date-timeimport { createZitadelClient } from "@zitadel/api/client";const client = createZitadelClient({ baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080", token: process.env.ZITADEL_PROJECT_SECRET!, // server-side only});const userPasskeyRegistration = await client.completeUserPasskeyRegistration( "user_01KWH3B72K7M7F0N9WD3P2E4YM", "att_01J0Z9KX7Y0Q2Y7JX5M9K2YF3C", { attestation: {} },);{ "id": "string", "name": "string", "created_at": "2019-08-24T14:15:22Z"}Was this helpful?