# PasskeyService

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://docs.spinbox.dev/reference/status.md); what Spinbox does not do is on [Limitations](https://docs.spinbox.dev/overview/limitations.md).

> spin.v1.PasskeyService: each procedure, its request and its response.

<!-- Generated by tools/refgen from spin:internal/controlplane/apidocs/spin.v1.openapi.json. Edit the source, not this file. -->

PasskeyService is a person's passkeys: WebAuthn credentials of their account, under the. installation's base domain (internal/passkey). A passkey signs a challenge the control plane. issued, never a document: what turns a session into a key that logs in (SSHKeyService.AddSSHKey) is an assertion of one, so a session alone - stolen, or an agent's - is no shell.

## BeginPasskeyCeremony

`POST /spin.v1.PasskeyService/BeginPasskeyCeremony`

A challenge for one ceremony of the caller's, bound to what it is for: a passkey registered, a key added, a passkey deleted. Taken once, by the call it is answered in, within minutes.

**Request**

| Field | Type | What it is |
|---|---|---|
| `purpose` | [PasskeyPurpose](https://docs.spinbox.dev/reference/api/types.md#passkeypurpose) |  |
| `subject` | string |  |

**Response**

| Field | Type | What it is |
|---|---|---|
| `challenge` | string (byte) |  |
| `rpId` | string | The relying party a credential is made for and asserted under: the installation's base domain. |
| `credentialIds` | list of string (byte) | The caller's passkeys' credential ids, for an assertion's allowCredentials. |

## DeletePasskey

`POST /spin.v1.PasskeyService/DeletePasskey`

Deletes a passkey of the caller's, with an assertion of one of theirs.

**Request**

| Field | Type | What it is |
|---|---|---|
| `id` | string |  |
| `stepUp` | [PasskeyAssertion](https://docs.spinbox.dev/reference/api/types.md#passkeyassertion) |  |

**Response**

No fields: `{}`.

## ListPasskeys

`POST /spin.v1.PasskeyService/ListPasskeys`

**Request**

No fields: `{}`.

**Response**

| Field | Type | What it is |
|---|---|---|
| `passkeys` | list of [Passkey](https://docs.spinbox.dev/reference/api/types.md#passkey) |  |

## RegisterPasskey

`POST /spin.v1.PasskeyService/RegisterPasskey`

Registers a passkey to the caller's account. The first is registered on their session alone; another takes an assertion of one they have, so a session cannot add a passkey of its own.

**Request**

| Field | Type | What it is |
|---|---|---|
| `name` | string |  |
| `challenge` | string (byte) |  |
| `credentialId` | string (byte) |  |
| `clientDataJson` | string (byte) |  |
| `authenticatorData` | string (byte) |  |
| `publicKey` | string (byte) | The credential's public key, SubjectPublicKeyInfo (AuthenticatorAttestationResponse.getPublicKey). |
| `stepUp` | [PasskeyAssertion](https://docs.spinbox.dev/reference/api/types.md#passkeyassertion) | An assertion of a passkey the account has, over a PASSKEY_PURPOSE_ADD_PASSKEY challenge naming this credential; unset for the account's first. |

**Response**

| Field | Type | What it is |
|---|---|---|
| `passkey` | [Passkey](https://docs.spinbox.dev/reference/api/types.md#passkey) |  |
