/v1/apps/{app_id}/webauthn-configAuthSet the per-app passkey (WebAuthn) relying-party settings.
Path parameters
app_id*stringId of the app.
Request body
enabled*booleanWhether passkey enrollment and passkey sign-in are available for this app. Turning it off leaves existing credentials in place; they simply cannot be used until it is turned back on.
rp_id*stringWebAuthn relying-party id — a bare domain, no scheme or port (`example.com`, not `https://app.example.com`). Must be the host of, or a registrable suffix of the host of, at least one origin in the app auth config's `allowed_redirect_origins`; the browser enforces the same rule client-side, so a mismatch makes the ceremony fail silently in the user's browser. Cannot be changed once any passkey is registered.
Example: "example.com"
rp_namestringHuman-readable name the platform passkey UI shows ("Save a passkey for <rp_name>"). Defaults to `rp_id` when blank.
Example: "Acme"
require_user_verificationbooleanRequire the authenticator to verify the user (biometric / PIN) for SECOND-FACTOR ceremonies. Passwordless sign-in always requires it regardless of this flag — a presence-only tap is not an authentication when the passkey is the only credential. Default true.
Response · 200
enabled*booleanWhether passkeys are on for the app.
rp_id*stringWebAuthn relying-party id (a bare domain), or `null` while passkeys are not configured.
rp_name*stringName the platform passkey UI shows, or `null` (then `rp_id`).
require_user_verification*booleanWhether second-factor passkey ceremonies require user verification (biometric or PIN).
ceremony_origins*arrayOrigins a passkey ceremony will be accepted from: the entries of `allowed_redirect_origins` that `rp_id` actually covers. An EMPTY array while `enabled` is true means the app is misconfigured and every ceremony will be refused with 412 — the usual cause is an `allowed_redirect_origins` edit that dropped the passkey site.
credential_count*numberNumber of passkeys currently registered against this app. Non-zero means `rp_id` is frozen: it is hashed into every one of those credentials, so a PUT that changes it is refused with 409. Exposed so an admin UI can say that before the change is attempted rather than after.
Example
Request
PUT https://api.auth.productcraft.co/v1/apps/{app_id}/webauthn-config
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"enabled": false,
"rp_id": "example.com",
"rp_name": "Acme",
"require_user_verification": false
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const webauthnConfig = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").webauthnConfig.update({ enabled: true, rp_id: "example.com" });auth.admin.app(…).webauthnConfig.update(params, options?): Auth.WebauthnConfig
Response
{
"enabled": false,
"rp_id": "string",
"rp_name": "string",
"require_user_verification": false,
"ceremony_origins": [
"string"
],
"credential_count": 0
}