---
title: "Sign up with Webauthn"
method: POST
path: "/signup/webauthn"
tags: ["authentication"]
---

# Sign up with Webauthn

`POST /signup/webauthn`

Initiate a Webauthn sign-up process by sending a challenge to the user's device. The user must not have an existing account.

## Request body

- SignUpWebauthnRequest
  - `email` string, email, required — A valid email
  - `options` SignUpOptions
    - `allowedRoles` string[]
    - `defaultRole` string
    - `displayName` string
    - `locale` string — A two or three characters locale
    - `metadata` object
    - `redirectTo` string, uri

## Response `200`

Challenge sent

- PublicKeyCredentialCreationOptions
  - `rp` RelyingPartyEntity, required
    - `name` string, required — A human-palatable name for the entity
    - `id` string, required — A unique identifier for the Relying Party entity, which sets the RP ID
  - `user` UserEntity, required
    - `name` string, required — A human-palatable name for the entity
    - `displayName` string, required — A human-palatable name for the user account, intended only for display
    - `id` string, required — The user handle of the user account entity
  - `challenge` string, byte, required — Base64url-encoded binary data
  - `pubKeyCredParams` CredentialParameter[], required — The desired credential types and their respective cryptographic parameters
    - `type` 'public-key', required — The valid credential types
    - `alg` integer, required — The cryptographic algorithm identifier
  - `timeout` integer — A time, in milliseconds, that the caller is willing to wait for the call to complete
  - `excludeCredentials` PublicKeyCredentialDescriptor[] — A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller
    - `type` 'public-key', required — The valid credential types
    - `id` string, byte, required — Base64url-encoded binary data
    - `transports` AuthenticatorTransport[] — The authenticator transports that can be used
  - `authenticatorSelection` AuthenticatorSelection
    - `authenticatorAttachment` 'platform' | 'cross-platform' — The authenticator attachment modality
    - `requireResidentKey` boolean — Whether the authenticator must create a client-side-resident public key credential source
    - `residentKey` 'discouraged' | 'preferred' | 'required' — The resident key requirement
    - `userVerification` 'required' | 'preferred' | 'discouraged' — A requirement for user verification for the operation
  - `hints` PublicKeyCredentialHints[] — Hints to help guide the user through the experience
  - `attestation` 'none' | 'indirect' | 'direct' | 'enterprise' — The attestation conveyance preference
  - `attestationFormats` AttestationFormat[] — The preferred attestation statement formats
  - `extensions` AuthenticationExtensions — Additional parameters requesting additional processing by the client and authenticator

## Other responses

- `default` — An error occurred while processing the request

---

[API](https://skmtc.net/nhost/apis/nhost-authentication-api.md) · [All operations](https://skmtc.net/nhost/apis/nhost-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhost/nhost-authentication-api/versions/a5c0d88b55c4/schema)
