Skip to main content
POST/gate/passkeys/register/finish

Finish Passkey Registration

Completes WebAuthn passkey registration by verifying the authenticator's attestation response and persisting the new pky_-prefixed credential.

Requires an active end-user session; the end-user must have initiated registration via the begin endpoint in the same session.

Parameters
projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Request body
response *any

The browser's registration result as JSON (a RegistrationResponseJSON, for example what startRegistration() from @simplewebauthn/browser returns for the options from register/begin).

Its response.clientDataJSON names the challenge, which must be one issued to this end user by register/begin and not used yet.

labelstring

A name for the passkey.

It is accepted but not stored.

Responses
HTTPK9O CodeDescription
200Success
401K9O_SESSION_EXPIREDYour session has expired or been revoked. Sign in again to continue.
401K9O_INVALID_CREDENTIALSPasskey attestation verification failed. Try registering your passkey again.
404K9O_END_USER_NOT_FOUNDNo account was found for the provided identity.
Response body (200)
data *object

The result of the registration.

passkey *object

The passkey now registered to the end user.

id *string

The id of the stored passkey (eupk_...).

credentialId *string

The WebAuthn credential id, base64url.

meta *any

Request metadata: cost, timing and the request and trace ids.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.gate.passkeys.register.finish({
  response: null,
  label: 'string'
})

Showing example in TypeScript

Request example
{
  "response": null,
  "label": "string"
}
Response example (200)
{
  "data": {
    "passkey": {
      "id": "string",
      "credentialId": "string"
    }
  }
}

More in Sign-in & Sessions