# Begin Passkey Sign-In

`POST /gate/passkeys/signin/begin` · Identity & Access · Sign-in & Sessions

Initiates WebAuthn passkey authentication for an end-user by returning an assertion challenge. The challenge is presented to the client-side WebAuthn API to prompt the user's registered authenticator; the resulting signed assertion is submitted to the finish endpoint. This endpoint is app-layer-unauthenticated — no existing JWT is required to begin passkey sign-in.

## 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 |
|---|---|---|---|
| `email` | string (email) | no | The end user's email address. When given, `allowCredentials` lists that end user's passkeys. Omit it for a discoverable-credential sign-in, where the browser offers every passkey it holds for this site. |

```json
{
  "email": "jane@demo.example"
}
```

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | object | yes | WebAuthn authentication options (`PublicKeyCredentialRequestOptionsJSON`). Pass them to the browser, for example to `startAuthentication()` from `@simplewebauthn/browser`, then send the result to signin/finish. |
| `data.rpId` | string | yes | The relying party id the passkey must be bound to, set by the deployment. |
| `data.challenge` | string | yes | A random challenge, base64url. It is held for this ceremony and works once; pass the options to the browser unchanged. |
| `data.allowCredentials` | array of object | yes | The passkeys of the end user named by `email`. Empty when no email was sent, or when that address has no passkeys: the browser then offers any passkey it holds for this site. |
| `data.allowCredentials.[]id` | string | yes | The credential id, base64url. |
| `data.allowCredentials.[]transports` | array of string | yes | How the browser can reach the authenticator, as the authenticator reported at registration (`usb`, `nfc`, `ble`, `internal`, `hybrid`, ...). |
| `data.allowCredentials.[]type` | enum ("public-key") | yes | The credential type. Always `public-key`. |
| `data.timeout` | integer | yes | How long the browser may wait for the end user, in milliseconds. Always 60000. |
| `data.userVerification` | enum ("preferred") | yes | User verification (biometric or PIN) is asked for. Sign-in/finish requires that it was done. |
| `meta` | object | yes | Request metadata: cost, timing and the request and trace ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 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/signin/begin' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "jane@demo.example"
}'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/gate/passkeys/signin/begin', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
  "email": "jane@demo.example"
}),
});
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.signIn.begin({
  email: 'jane@demo.example'
})
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/identity-access/begin-passkey-sign-in
