Begin a passkey registration
Starts a WebAuthn registration ceremony for the user and returns the
creation options for navigator.credentials.create(). A passkey is
registered in two steps: this one returns options for the browser, and
completeUserPasskeyRegistration (POST /users/{user_id}/passkeys/registrations/{registration_id}) verifies the browser's answer.
Complete the ceremony with
POST /users/{user_id}/passkeys/registrations/{registration_id} within five
minutes, using the registration_id this response returns. Credentials
already registered for the user are excluded automatically.
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_-]+$application/json- body
The request body for beginning a WebAuthn registration ceremony for the user.
Management callers are not browsers, so the relying-party parameters cannot be derived from an Origin header and must be supplied explicitly.
rp_id*stringThe relying party ID, the domain the credential is scoped to.
1 <= lengthrp_origins*array<>The origins allowed for this ceremony's attestation.
1 <= itemsusername?stringThe account label the browser shows in its credential picker. Optional: when omitted, a neutral default is used.
display_name?stringThe display name the browser shows. Optional; defaults to the username.
The started registration ceremony.
application/json- response
The started registration ceremony.
registration_id*stringThe ID of this ceremony. Pass it back as registration_id on
POST /users/{user_id}/passkeys/registrations/{registration_id}, together
with the attestation.
options*The PublicKeyCredentialCreationOptions object, passed directly to the
browser's navigator.credentials.create().
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.createUserPasskeyRegistration( "user_01KWH3B72K7M7F0N9WD3P2E4YM", { rp_id: "string", rp_origins: ["http://example.com"] },);{ "registration_id": "string", "options": {}}Was this helpful?