registerPasskey
POST
/api/v1/me/security/passkeys
const url = 'https://example.com/api/v1/me/security/passkeys';const options = { method: 'POST', headers: { 'X-CSRF-Token': 'example', 'X-MFA-Challenge': 'example', 'Content-Type': 'application/json' }, body: '{"id":"example","rawId":"example","type":"public-key","authenticatorAttachment":"platform","clientExtensionResults":{},"response":{"clientDataJSON":"example","attestationObject":"example","transports":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/me/security/passkeys \ --header 'Content-Type: application/json' \ --header 'X-CSRF-Token: example' \ --header 'X-MFA-Challenge: example' \ --data '{ "id": "example", "rawId": "example", "type": "public-key", "authenticatorAttachment": "platform", "clientExtensionResults": {}, "response": { "clientDataJSON": "example", "attestationObject": "example", "transports": [ "example" ] } }'The passkey is named from the authenticator’s AAGUID; no name is accepted here. Use the rename endpoint to change it.
Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters”X-CSRF-Token
required
string
X-MFA-Challenge
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
A PublicKeyCredential from navigator.credentials.create(), serialized with base64url binary fields. Parsed by the WebAuthn library rather than field by field.
object
id
required
string
rawId
required
Base64url
string
type
required
string
authenticatorAttachment
string
clientExtensionResults
object
response
required
object
clientDataJSON
required
Base64url
string
attestationObject
required
Base64url
string
transports
Array<string>
Responses
Section titled “ Responses ”Passkey enrolled
The passkey could not be verified