Docs

Begin passkey registration

POST
/users/{user_id}/passkeys/registrations

Starts a WebAuthn registration ceremony for the user and returns the creation options for navigator.credentials.create(). Complete the ceremony with POST /users/{user_id}/passkeys/registrations/{registration_id} within five minutes. Credentials already registered for the user are excluded automatically.

Authorization

oauth2 user.write
headerAuthorizationBearer <token>

Scope: user.write

Path Parameters

user_id*string

The unique identifier of the user.

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

Request Body

application/json
  1. body

Request to begin 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*string

Relying Party ID the credential is scoped to.

Length1 <= length
rp_origins*array<>

Allowed origins for this ceremony's attestation.

Items1 <= items
username?string

Browser-visible account label for the credential picker. Optional: when omitted, a neutral default is used.

display_name?string

Browser-visible display name. Optional; defaults to the username.

Response Body

The registration ceremony was started

application/json
  1. response

The started registration ceremony.

registration_id*string

Identifier of this ceremony. Pass it back 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().

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.beginUserPasskeyRegistration(  "user_01KWH3B72K7M7F0N9WD3P2E4YM",  { rp_id: "string", rp_origins: ["http://example.com"] },);
Example Response
{  "registration_id": "string",  "options": {}}

Was this helpful?