# Finish Passkey Registration

`POST /gate/passkeys/register/finish` · Identity & Access · Sign-in & Sessions

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

| Name | In | Required | Description |
|---|---|---|---|
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `response` | object | yes | 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. |
| `label` | string | no | A name for the passkey. It is accepted but not stored. |

```json
{
  "response": null,
  "label": "string"
}
```

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | The result of the registration. |
| `data.passkey` | object | yes | The passkey now registered to the end user. |
| `data.passkey.id` | string | yes | The id of the stored passkey (`eupk_...`). |
| `data.passkey.credentialId` | string | yes | The WebAuthn credential id, base64url. |
| `meta` | object | yes | Request metadata: cost, timing and the request and trace ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | Your session has expired or been revoked. Sign in again to continue. |
| 401 | `K9O_INVALID_CREDENTIALS` | Passkey attestation verification failed. Try registering your passkey again. |
| 404 | `K9O_END_USER_NOT_FOUND` | No account was found for the provided identity. |

## Code samples

### cURL

```bash
curl -X POST 'https://<org>.api-<region>.k9o.io/@storefront/gate/passkeys/register/finish' \
  -H 'Authorization: Bearer $K9O_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "response": null,
  "label": "string"
}'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/gate/passkeys/register/finish', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
  "response": null,
  "label": "string"
}),
});
const { data, meta } = await res.json();
```

### @k9o/core

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


Canonical page: https://docs.kilimanjaro.dev/api-playground/identity-access/finish-passkey-registration
