Docs

Finish a passkey registration

POST
/users/{user_id}/passkeys/registrations/{registration_id}

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.

Authorization

oauth2 user.write
headerAuthorizationBearer <token>

Scope: user.write

Path Parameters

user_id*string

The user ID: the id that createUser (POST /users) or queryUsers (POST /users/query) returns.

Match^user_[a-zA-Z0-9_-]+$
registration_id*string

The registration_id that createUserPasskeyRegistration (POST /users/{user_id}/passkeys/registrations) returns.

Request Body

application/json
  1. body

The request body for completing a WebAuthn registration ceremony.

attestation*

The WebAuthn AttestationResponse object from navigator.credentials.create().

name?string

Label for the credential in passkey management surfaces. Optional: when omitted, a name is derived from the credential itself.

Response Body

The registered passkey.

application/json
  1. response

The registered passkey.

id*string

The unique identifier of the passkey.

name*string

The name of the passkey.

created_at*string

The timestamp when the passkey was created.

Formatdate-time
Example Request
import { 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: {} },);
Example Response
{  "id": "string",  "name": "string",  "created_at": "2019-08-24T14:15:22Z"}

Was this helpful?