# Setup

## Get Beeper app setup state

`client.app.setup.retrieve(RequestOptionsoptions?): SetupRetrieveResponse`

**get** `/v1/app/setup`

Return the current Beeper Desktop or Beeper Server sign-in and encrypted messaging setup state. This endpoint is public before sign-in so apps can discover that sign-in is needed; after sign-in, pass a read token.

### Returns

- `SetupRetrieveResponse`

  - `e2ee: E2EE`

    Encrypted messaging setup status.

    - `crossSigning: boolean`

      Whether this account can verify trusted devices.

    - `firstSyncDone: boolean`

      Whether the first encrypted message sync is complete.

    - `hasBackedUpRecoveryKey: boolean`

      Whether the user confirmed that they saved their recovery key.

    - `initialized: boolean`

      Whether encrypted messaging setup has started.

    - `keyBackup: boolean`

      Whether encrypted message backup is available.

    - `secrets: Secrets`

      Encrypted messaging keys available on this device.

      - `masterKey: boolean`

        Whether the account identity key is available.

      - `megolmBackupKey: boolean`

        Whether the encrypted message backup key is available.

      - `recoveryKey: boolean`

        Whether a recovery key is available.

      - `selfSigningKey: boolean`

        Whether the device trust key is available.

      - `userSigningKey: boolean`

        Whether the user trust key is available.

    - `secretStorage: boolean`

      Whether secure key storage is available.

    - `verified: boolean`

      Whether this device is trusted for encrypted messages.

    - `recoveryKeyGeneratedAt?: number`

      Unix timestamp for when the recovery key was created.

  - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

    Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

    - `"needs-login"`

    - `"initializing"`

    - `"needs-cross-signing-setup"`

    - `"needs-verification"`

    - `"needs-secrets"`

    - `"needs-first-sync"`

    - `"ready"`

  - `matrix?: Matrix`

    Signed-in account details. Omitted until sign-in is complete.

    - `deviceID: string`

      Current device ID.

    - `homeserver: string`

      Beeper homeserver URL for this account.

    - `userID: string`

      Signed-in Beeper user ID.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const setup = await client.app.setup.retrieve();

console.log(setup.e2ee);
```

#### Response

```json
{
  "e2ee": {
    "crossSigning": true,
    "firstSyncDone": true,
    "hasBackedUpRecoveryKey": true,
    "initialized": true,
    "keyBackup": true,
    "secrets": {
      "masterKey": true,
      "megolmBackupKey": true,
      "recoveryKey": true,
      "selfSigningKey": true,
      "userSigningKey": true
    },
    "secretStorage": true,
    "verified": true,
    "recoveryKeyGeneratedAt": 0
  },
  "state": "needs-login",
  "matrix": {
    "deviceID": "deviceID",
    "homeserver": "homeserver",
    "userID": "userID"
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Start Beeper app setup

`client.app.setup.start(RequestOptionsoptions?): SetupStartResponse`

**post** `/v1/app/setup/start`

Start setting up Beeper Desktop or Beeper Server. The flow supports existing Beeper accounts and new account creation.

### Returns

- `SetupStartResponse`

  - `setupRequestID: string`

    Setup request ID to use in the next sign-in step.

  - `signInMethods: Array<string>`

    Available sign-in methods for this setup request.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop();

const response = await client.app.setup.start();

console.log(response.setupRequestID);
```

#### Response

```json
{
  "setupRequestID": "setupRequestID",
  "signInMethods": [
    "string"
  ]
}
```

## Send setup sign-in code

`client.app.setup.email(SetupEmailParamsbody, RequestOptionsoptions?): void`

**post** `/v1/app/setup/email`

Send a sign-in code to the user email address for app setup.

### Parameters

- `body: SetupEmailParams`

  - `email: string`

    Email address to send the sign-in code to.

  - `setupRequestID: string`

    Setup request ID returned by the start step.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop();

await client.app.setup.email({ email: 'dev@stainless.com', setupRequestID: 'setupRequestID' });
```

## Complete setup sign-in with code

`client.app.setup.response(SetupResponseParamsbody, RequestOptionsoptions?): SetupResponseResponse`

**post** `/v1/app/setup/response`

Finish setup sign-in with the code sent to the user email address. If the user needs a new account, the response includes account creation copy and username suggestions.

### Parameters

- `body: SetupResponseParams`

  - `response: string`

    Sign-in code from the user email.

  - `setupRequestID: string`

    Setup request ID returned by the start step.

### Returns

- `SetupResponseResponse = Success | RegistrationRequired`

  - `Success`

    - `matrix: Matrix`

      Account credentials for first-party app setup.

      - `accessToken: string`

        Beeper account access token. Returned once for first-party app setup.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `session: Session`

      Current app sign-in and encrypted messaging setup state after sign-in.

      - `e2ee: E2EE`

        Encrypted messaging setup status.

        - `crossSigning: boolean`

          Whether this account can verify trusted devices.

        - `firstSyncDone: boolean`

          Whether the first encrypted message sync is complete.

        - `hasBackedUpRecoveryKey: boolean`

          Whether the user confirmed that they saved their recovery key.

        - `initialized: boolean`

          Whether encrypted messaging setup has started.

        - `keyBackup: boolean`

          Whether encrypted message backup is available.

        - `secrets: Secrets`

          Encrypted messaging keys available on this device.

          - `masterKey: boolean`

            Whether the account identity key is available.

          - `megolmBackupKey: boolean`

            Whether the encrypted message backup key is available.

          - `recoveryKey: boolean`

            Whether a recovery key is available.

          - `selfSigningKey: boolean`

            Whether the device trust key is available.

          - `userSigningKey: boolean`

            Whether the user trust key is available.

        - `secretStorage: boolean`

          Whether secure key storage is available.

        - `verified: boolean`

          Whether this device is trusted for encrypted messages.

        - `recoveryKeyGeneratedAt?: number`

          Unix timestamp for when the recovery key was created.

      - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

        Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

        - `"needs-login"`

        - `"initializing"`

        - `"needs-cross-signing-setup"`

        - `"needs-verification"`

        - `"needs-secrets"`

        - `"needs-first-sync"`

        - `"ready"`

      - `matrix?: Matrix`

        Signed-in account details. Omitted until sign-in is complete.

        - `deviceID: string`

          Current device ID.

        - `homeserver: string`

          Beeper homeserver URL for this account.

        - `userID: string`

          Signed-in Beeper user ID.

      - `verification?: Verification`

        Trusted device verification progress.

        - `id: string`

          Verification ID to pass in verification action paths.

        - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

          Verification actions that are valid for the current state.

          - `"accept"`

          - `"cancel"`

          - `"qr.confirmScanned"`

          - `"sas.start"`

          - `"sas.confirm"`

        - `direction: "incoming" | "outgoing"`

          Whether this device started or received the verification.

          - `"incoming"`

          - `"outgoing"`

        - `methods: Array<"qr" | "sas">`

          Verification methods supported for this transaction.

          - `"qr"`

          - `"sas"`

        - `purpose: "login" | "device"`

          Why this verification exists.

          - `"login"`

          - `"device"`

        - `state: "requested" | "ready" | "sas_ready" | 4 more`

          Current trusted-device verification state.

          - `"requested"`

          - `"ready"`

          - `"sas_ready"`

          - `"qr_scanned"`

          - `"done"`

          - `"cancelled"`

          - `"error"`

        - `error?: Error`

          Verification error details, if verification stopped.

          - `code: string`

            Verification error code.

          - `reason: string`

            User-facing verification error message.

        - `otherDevice?: OtherDevice`

          Other device participating in verification.

          - `id: string`

            Other device ID.

          - `name?: string`

            Other device display name, if known.

        - `otherUserID?: string`

          Other Beeper user participating in verification.

        - `qr?: QR`

          QR verification data.

          - `data: string`

            QR code payload to display for verification.

        - `sas?: SAS`

          Emoji or number comparison data for verification.

          - `emojis: string`

            Emoji sequence to compare on both devices.

          - `decimals?: string`

            Number sequence to compare on both devices.

  - `RegistrationRequired`

    - `copy: Copy`

      Copy to display during account creation.

      - `submit: "Continue"`

        Submit button label.

        - `"Continue"`

      - `terms: "By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy."`

        Terms and privacy notice to show before account creation.

        - `"By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy."`

      - `title: "Choose your username"`

        Title for the username step.

        - `"Choose your username"`

      - `usernamePlaceholder: "Username"`

        Placeholder for the username field.

        - `"Username"`

    - `leadToken: string`

      Registration token returned by Beeper.

    - `registrationRequired: true`

      Indicates that the user needs to create a Beeper account.

      - `true`

    - `setupRequestID: string`

      Setup request ID to use when creating the account.

    - `usernameSuggestions?: Array<string>`

      Suggested usernames for the new account.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop();

const response = await client.app.setup.response({
  response: 'response',
  setupRequestID: 'setupRequestID',
});

console.log(response);
```

#### Response

```json
{
  "matrix": {
    "accessToken": "accessToken",
    "deviceID": "deviceID",
    "homeserver": "homeserver",
    "userID": "userID"
  },
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  }
}
```

## Create account for setup

`client.app.setup.register(SetupRegisterParamsbody, RequestOptionsoptions?): SetupRegisterResponse`

**post** `/v1/app/setup/register`

Create a Beeper account after the user chooses a username and accepts the Terms of Use.

### Parameters

- `body: SetupRegisterParams`

  - `acceptTerms: true`

    Confirms that the user agreed to our [terms of use](https://www.beeper.com/terms-onboarding) and has read our [privacy policy](https://www.beeper.com/privacy).

    - `true`

  - `leadToken: string`

    Registration token returned by Beeper.

  - `setupRequestID: string`

    Setup request ID returned by the start step.

  - `username: string`

    Username selected by the user.

### Returns

- `SetupRegisterResponse`

  - `matrix: Matrix`

    Account credentials for first-party app setup.

    - `accessToken: string`

      Beeper account access token. Returned once for first-party app setup.

    - `deviceID: string`

      Current device ID.

    - `homeserver: string`

      Beeper homeserver URL for this account.

    - `userID: string`

      Signed-in Beeper user ID.

  - `session: Session`

    Current app sign-in and encrypted messaging setup state after sign-in.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop();

const response = await client.app.setup.register({
  acceptTerms: true,
  leadToken: 'leadToken',
  setupRequestID: 'setupRequestID',
  username: 'x',
});

console.log(response.matrix);
```

#### Response

```json
{
  "matrix": {
    "accessToken": "accessToken",
    "deviceID": "deviceID",
    "homeserver": "homeserver",
    "userID": "userID"
  },
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  }
}
```

## Domain Types

### Setup Retrieve Response

- `SetupRetrieveResponse`

  - `e2ee: E2EE`

    Encrypted messaging setup status.

    - `crossSigning: boolean`

      Whether this account can verify trusted devices.

    - `firstSyncDone: boolean`

      Whether the first encrypted message sync is complete.

    - `hasBackedUpRecoveryKey: boolean`

      Whether the user confirmed that they saved their recovery key.

    - `initialized: boolean`

      Whether encrypted messaging setup has started.

    - `keyBackup: boolean`

      Whether encrypted message backup is available.

    - `secrets: Secrets`

      Encrypted messaging keys available on this device.

      - `masterKey: boolean`

        Whether the account identity key is available.

      - `megolmBackupKey: boolean`

        Whether the encrypted message backup key is available.

      - `recoveryKey: boolean`

        Whether a recovery key is available.

      - `selfSigningKey: boolean`

        Whether the device trust key is available.

      - `userSigningKey: boolean`

        Whether the user trust key is available.

    - `secretStorage: boolean`

      Whether secure key storage is available.

    - `verified: boolean`

      Whether this device is trusted for encrypted messages.

    - `recoveryKeyGeneratedAt?: number`

      Unix timestamp for when the recovery key was created.

  - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

    Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

    - `"needs-login"`

    - `"initializing"`

    - `"needs-cross-signing-setup"`

    - `"needs-verification"`

    - `"needs-secrets"`

    - `"needs-first-sync"`

    - `"ready"`

  - `matrix?: Matrix`

    Signed-in account details. Omitted until sign-in is complete.

    - `deviceID: string`

      Current device ID.

    - `homeserver: string`

      Beeper homeserver URL for this account.

    - `userID: string`

      Signed-in Beeper user ID.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Setup Start Response

- `SetupStartResponse`

  - `setupRequestID: string`

    Setup request ID to use in the next sign-in step.

  - `signInMethods: Array<string>`

    Available sign-in methods for this setup request.

### Setup Response Response

- `SetupResponseResponse = Success | RegistrationRequired`

  - `Success`

    - `matrix: Matrix`

      Account credentials for first-party app setup.

      - `accessToken: string`

        Beeper account access token. Returned once for first-party app setup.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `session: Session`

      Current app sign-in and encrypted messaging setup state after sign-in.

      - `e2ee: E2EE`

        Encrypted messaging setup status.

        - `crossSigning: boolean`

          Whether this account can verify trusted devices.

        - `firstSyncDone: boolean`

          Whether the first encrypted message sync is complete.

        - `hasBackedUpRecoveryKey: boolean`

          Whether the user confirmed that they saved their recovery key.

        - `initialized: boolean`

          Whether encrypted messaging setup has started.

        - `keyBackup: boolean`

          Whether encrypted message backup is available.

        - `secrets: Secrets`

          Encrypted messaging keys available on this device.

          - `masterKey: boolean`

            Whether the account identity key is available.

          - `megolmBackupKey: boolean`

            Whether the encrypted message backup key is available.

          - `recoveryKey: boolean`

            Whether a recovery key is available.

          - `selfSigningKey: boolean`

            Whether the device trust key is available.

          - `userSigningKey: boolean`

            Whether the user trust key is available.

        - `secretStorage: boolean`

          Whether secure key storage is available.

        - `verified: boolean`

          Whether this device is trusted for encrypted messages.

        - `recoveryKeyGeneratedAt?: number`

          Unix timestamp for when the recovery key was created.

      - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

        Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

        - `"needs-login"`

        - `"initializing"`

        - `"needs-cross-signing-setup"`

        - `"needs-verification"`

        - `"needs-secrets"`

        - `"needs-first-sync"`

        - `"ready"`

      - `matrix?: Matrix`

        Signed-in account details. Omitted until sign-in is complete.

        - `deviceID: string`

          Current device ID.

        - `homeserver: string`

          Beeper homeserver URL for this account.

        - `userID: string`

          Signed-in Beeper user ID.

      - `verification?: Verification`

        Trusted device verification progress.

        - `id: string`

          Verification ID to pass in verification action paths.

        - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

          Verification actions that are valid for the current state.

          - `"accept"`

          - `"cancel"`

          - `"qr.confirmScanned"`

          - `"sas.start"`

          - `"sas.confirm"`

        - `direction: "incoming" | "outgoing"`

          Whether this device started or received the verification.

          - `"incoming"`

          - `"outgoing"`

        - `methods: Array<"qr" | "sas">`

          Verification methods supported for this transaction.

          - `"qr"`

          - `"sas"`

        - `purpose: "login" | "device"`

          Why this verification exists.

          - `"login"`

          - `"device"`

        - `state: "requested" | "ready" | "sas_ready" | 4 more`

          Current trusted-device verification state.

          - `"requested"`

          - `"ready"`

          - `"sas_ready"`

          - `"qr_scanned"`

          - `"done"`

          - `"cancelled"`

          - `"error"`

        - `error?: Error`

          Verification error details, if verification stopped.

          - `code: string`

            Verification error code.

          - `reason: string`

            User-facing verification error message.

        - `otherDevice?: OtherDevice`

          Other device participating in verification.

          - `id: string`

            Other device ID.

          - `name?: string`

            Other device display name, if known.

        - `otherUserID?: string`

          Other Beeper user participating in verification.

        - `qr?: QR`

          QR verification data.

          - `data: string`

            QR code payload to display for verification.

        - `sas?: SAS`

          Emoji or number comparison data for verification.

          - `emojis: string`

            Emoji sequence to compare on both devices.

          - `decimals?: string`

            Number sequence to compare on both devices.

  - `RegistrationRequired`

    - `copy: Copy`

      Copy to display during account creation.

      - `submit: "Continue"`

        Submit button label.

        - `"Continue"`

      - `terms: "By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy."`

        Terms and privacy notice to show before account creation.

        - `"By continuing, you agree to the Terms of Use and acknowledge the Privacy Policy."`

      - `title: "Choose your username"`

        Title for the username step.

        - `"Choose your username"`

      - `usernamePlaceholder: "Username"`

        Placeholder for the username field.

        - `"Username"`

    - `leadToken: string`

      Registration token returned by Beeper.

    - `registrationRequired: true`

      Indicates that the user needs to create a Beeper account.

      - `true`

    - `setupRequestID: string`

      Setup request ID to use when creating the account.

    - `usernameSuggestions?: Array<string>`

      Suggested usernames for the new account.

### Setup Register Response

- `SetupRegisterResponse`

  - `matrix: Matrix`

    Account credentials for first-party app setup.

    - `accessToken: string`

      Beeper account access token. Returned once for first-party app setup.

    - `deviceID: string`

      Current device ID.

    - `homeserver: string`

      Beeper homeserver URL for this account.

    - `userID: string`

      Signed-in Beeper user ID.

  - `session: Session`

    Current app sign-in and encrypted messaging setup state after sign-in.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

# Recovery Key

## Verify with recovery key

`client.app.setup.recoveryKey.verify(RecoveryKeyVerifyParamsbody, RequestOptionsoptions?): RecoveryKeyVerifyResponse`

**post** `/v1/app/setup/verification/recovery-key`

Unlock encrypted messages with the user recovery key.

### Parameters

- `body: RecoveryKeyVerifyParams`

  - `recoveryKey: string`

    Recovery key saved by the user.

### Returns

- `RecoveryKeyVerifyResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.recoveryKey.verify({ recoveryKey: 'x' });

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  }
}
```

## Domain Types

### Recovery Key Verify Response

- `RecoveryKeyVerifyResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

# Reset

## Create new recovery key

`client.app.setup.recoveryKey.reset.create(ResetCreateParamsbody?, RequestOptionsoptions?): ResetCreateResponse`

**post** `/v1/app/setup/verification/recovery-key/reset`

Create a new recovery key when the user cannot use the existing one.

### Parameters

- `body: ResetCreateParams`

  - `existingRecoveryKey?: string`

    Existing recovery key, if the user has it.

### Returns

- `ResetCreateResponse`

  - `recoveryKey: string`

    New recovery key. Show it once and ask the user to save it.

  - `session: Session`

    Current app sign-in and encrypted messaging setup state after creating the new recovery key.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const reset = await client.app.setup.recoveryKey.reset.create();

console.log(reset.recoveryKey);
```

#### Response

```json
{
  "recoveryKey": "recoveryKey",
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  }
}
```

## Confirm new recovery key

`client.app.setup.recoveryKey.reset.confirm(ResetConfirmParamsbody, RequestOptionsoptions?): ResetConfirmResponse`

**post** `/v1/app/setup/verification/recovery-key/reset/confirm`

Confirm that the new recovery key should be used for this account.

### Parameters

- `body: ResetConfirmParams`

  - `recoveryKey: string`

    New recovery key returned by the reset step.

### Returns

- `ResetConfirmResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.recoveryKey.reset.confirm({ recoveryKey: 'x' });

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  }
}
```

## Domain Types

### Reset Create Response

- `ResetCreateResponse`

  - `recoveryKey: string`

    New recovery key. Show it once and ask the user to save it.

  - `session: Session`

    Current app sign-in and encrypted messaging setup state after creating the new recovery key.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

### Reset Confirm Response

- `ResetConfirmResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

# Verifications

## List active verifications

`client.app.setup.verifications.list(RequestOptionsoptions?): VerificationListResponse`

**get** `/v1/app/setup/verifications`

List pending and active device verifications. Use this to recover state without a WebSocket connection.

### Returns

- `VerificationListResponse`

  - `items: Array<Item>`

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const verifications = await client.app.setup.verifications.list();

console.log(verifications.items);
```

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  ]
}
```

## Start device verification

`client.app.setup.verifications.create(VerificationCreateParamsbody?, RequestOptionsoptions?): VerificationCreateResponse`

**post** `/v1/app/setup/verifications`

Start verifying this device from another signed-in device.

### Parameters

- `body: VerificationCreateParams`

  - `purpose?: "login" | "device"`

    Why this verification is being started.

    - `"login"`

    - `"device"`

  - `userID?: string`

    Beeper user ID to verify. Defaults to the signed-in user.

### Returns

- `VerificationCreateResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const verification = await client.app.setup.verifications.create();

console.log(verification.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Get verification

`client.app.setup.verifications.retrieve(stringverificationID, RequestOptionsoptions?): VerificationRetrieveResponse`

**get** `/v1/app/setup/verifications/{verificationID}`

Get the current state of a device verification transaction.

### Parameters

- `verificationID: string`

  Verification ID.

### Returns

- `VerificationRetrieveResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const verification = await client.app.setup.verifications.retrieve('x');

console.log(verification.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Accept device verification

`client.app.setup.verifications.accept(stringverificationID, RequestOptionsoptions?): VerificationAcceptResponse`

**post** `/v1/app/setup/verifications/{verificationID}/accept`

Accept an incoming device verification request.

### Parameters

- `verificationID: string`

  Verification ID.

### Returns

- `VerificationAcceptResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.accept('x');

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Cancel device verification

`client.app.setup.verifications.cancel(stringverificationID, VerificationCancelParamsbody?, RequestOptionsoptions?): VerificationCancelResponse`

**post** `/v1/app/setup/verifications/{verificationID}/cancel`

Cancel an active device verification request.

### Parameters

- `verificationID: string`

  Verification ID.

- `body: VerificationCancelParams`

  - `code?: string`

    Optional cancellation code.

  - `reason?: string`

    Optional user-facing cancellation reason.

### Returns

- `VerificationCancelResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.cancel('x');

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Domain Types

### Verification List Response

- `VerificationListResponse`

  - `items: Array<Item>`

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Verification Create Response

- `VerificationCreateResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Verification Retrieve Response

- `VerificationRetrieveResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Verification Accept Response

- `VerificationAcceptResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Verification Cancel Response

- `VerificationCancelResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

# QR

## Scan verification QR code

`client.app.setup.verifications.qr.scan(QRScanParamsbody, RequestOptionsoptions?): QRScanResponse`

**post** `/v1/app/setup/verifications/qr/scan`

Submit the QR code scanned from another signed-in device.

### Parameters

- `body: QRScanParams`

  - `data: string`

    QR code payload scanned from the other device.

### Returns

- `QRScanResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.qr.scan({ data: 'x' });

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Confirm QR code scan

`client.app.setup.verifications.qr.confirmScanned(stringverificationID, RequestOptionsoptions?): QRConfirmScannedResponse`

**post** `/v1/app/setup/verifications/{verificationID}/qr/confirm-scanned`

Confirm that another device scanned this device QR code.

### Parameters

- `verificationID: string`

  Verification ID.

### Returns

- `QRConfirmScannedResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.qr.confirmScanned('x');

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Domain Types

### QR Scan Response

- `QRScanResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### QR Confirm Scanned Response

- `QRConfirmScannedResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

# SAS

## Start emoji verification

`client.app.setup.verifications.sas.start(stringverificationID, RequestOptionsoptions?): SASStartResponse`

**post** `/v1/app/setup/verifications/{verificationID}/sas/start`

Start emoji comparison for device verification.

### Parameters

- `verificationID: string`

  Verification ID.

### Returns

- `SASStartResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.sas.start('x');

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Confirm emoji verification

`client.app.setup.verifications.sas.confirm(stringverificationID, RequestOptionsoptions?): SASConfirmResponse`

**post** `/v1/app/setup/verifications/{verificationID}/sas/confirm`

Confirm that the emoji or number sequence matches on both devices.

### Parameters

- `verificationID: string`

  Verification ID.

### Returns

- `SASConfirmResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### Example

```typescript
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.app.setup.verifications.sas.confirm('x');

console.log(response.session);
```

#### Response

```json
{
  "session": {
    "e2ee": {
      "crossSigning": true,
      "firstSyncDone": true,
      "hasBackedUpRecoveryKey": true,
      "initialized": true,
      "keyBackup": true,
      "secrets": {
        "masterKey": true,
        "megolmBackupKey": true,
        "recoveryKey": true,
        "selfSigningKey": true,
        "userSigningKey": true
      },
      "secretStorage": true,
      "verified": true,
      "recoveryKeyGeneratedAt": 0
    },
    "state": "needs-login",
    "matrix": {
      "deviceID": "deviceID",
      "homeserver": "homeserver",
      "userID": "userID"
    },
    "verification": {
      "id": "id",
      "availableActions": [
        "accept"
      ],
      "direction": "incoming",
      "methods": [
        "qr"
      ],
      "purpose": "login",
      "state": "requested",
      "error": {
        "code": "code",
        "reason": "reason"
      },
      "otherDevice": {
        "id": "id",
        "name": "name"
      },
      "otherUserID": "otherUserID",
      "qr": {
        "data": "data"
      },
      "sas": {
        "emojis": "emojis",
        "decimals": "decimals"
      }
    }
  },
  "verification": {
    "id": "id",
    "availableActions": [
      "accept"
    ],
    "direction": "incoming",
    "methods": [
      "qr"
    ],
    "purpose": "login",
    "state": "requested",
    "error": {
      "code": "code",
      "reason": "reason"
    },
    "otherDevice": {
      "id": "id",
      "name": "name"
    },
    "otherUserID": "otherUserID",
    "qr": {
      "data": "data"
    },
    "sas": {
      "emojis": "emojis",
      "decimals": "decimals"
    }
  }
}
```

## Domain Types

### SAS Start Response

- `SASStartResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.

### SAS Confirm Response

- `SASConfirmResponse`

  - `session: Session`

    Current app sign-in and encrypted messaging setup state.

    - `e2ee: E2EE`

      Encrypted messaging setup status.

      - `crossSigning: boolean`

        Whether this account can verify trusted devices.

      - `firstSyncDone: boolean`

        Whether the first encrypted message sync is complete.

      - `hasBackedUpRecoveryKey: boolean`

        Whether the user confirmed that they saved their recovery key.

      - `initialized: boolean`

        Whether encrypted messaging setup has started.

      - `keyBackup: boolean`

        Whether encrypted message backup is available.

      - `secrets: Secrets`

        Encrypted messaging keys available on this device.

        - `masterKey: boolean`

          Whether the account identity key is available.

        - `megolmBackupKey: boolean`

          Whether the encrypted message backup key is available.

        - `recoveryKey: boolean`

          Whether a recovery key is available.

        - `selfSigningKey: boolean`

          Whether the device trust key is available.

        - `userSigningKey: boolean`

          Whether the user trust key is available.

      - `secretStorage: boolean`

        Whether secure key storage is available.

      - `verified: boolean`

        Whether this device is trusted for encrypted messages.

      - `recoveryKeyGeneratedAt?: number`

        Unix timestamp for when the recovery key was created.

    - `state: "needs-login" | "initializing" | "needs-cross-signing-setup" | 4 more`

      Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server.

      - `"needs-login"`

      - `"initializing"`

      - `"needs-cross-signing-setup"`

      - `"needs-verification"`

      - `"needs-secrets"`

      - `"needs-first-sync"`

      - `"ready"`

    - `matrix?: Matrix`

      Signed-in account details. Omitted until sign-in is complete.

      - `deviceID: string`

        Current device ID.

      - `homeserver: string`

        Beeper homeserver URL for this account.

      - `userID: string`

        Signed-in Beeper user ID.

    - `verification?: Verification`

      Trusted device verification progress.

      - `id: string`

        Verification ID to pass in verification action paths.

      - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

        Verification actions that are valid for the current state.

        - `"accept"`

        - `"cancel"`

        - `"qr.confirmScanned"`

        - `"sas.start"`

        - `"sas.confirm"`

      - `direction: "incoming" | "outgoing"`

        Whether this device started or received the verification.

        - `"incoming"`

        - `"outgoing"`

      - `methods: Array<"qr" | "sas">`

        Verification methods supported for this transaction.

        - `"qr"`

        - `"sas"`

      - `purpose: "login" | "device"`

        Why this verification exists.

        - `"login"`

        - `"device"`

      - `state: "requested" | "ready" | "sas_ready" | 4 more`

        Current trusted-device verification state.

        - `"requested"`

        - `"ready"`

        - `"sas_ready"`

        - `"qr_scanned"`

        - `"done"`

        - `"cancelled"`

        - `"error"`

      - `error?: Error`

        Verification error details, if verification stopped.

        - `code: string`

          Verification error code.

        - `reason: string`

          User-facing verification error message.

      - `otherDevice?: OtherDevice`

        Other device participating in verification.

        - `id: string`

          Other device ID.

        - `name?: string`

          Other device display name, if known.

      - `otherUserID?: string`

        Other Beeper user participating in verification.

      - `qr?: QR`

        QR verification data.

        - `data: string`

          QR code payload to display for verification.

      - `sas?: SAS`

        Emoji or number comparison data for verification.

        - `emojis: string`

          Emoji sequence to compare on both devices.

        - `decimals?: string`

          Number sequence to compare on both devices.

  - `verification?: Verification`

    Trusted device verification progress.

    - `id: string`

      Verification ID to pass in verification action paths.

    - `availableActions: Array<"accept" | "cancel" | "qr.confirmScanned" | 2 more>`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: "incoming" | "outgoing"`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: Array<"qr" | "sas">`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: "login" | "device"`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: "requested" | "ready" | "sas_ready" | 4 more`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error?: Error`

      Verification error details, if verification stopped.

      - `code: string`

        Verification error code.

      - `reason: string`

        User-facing verification error message.

    - `otherDevice?: OtherDevice`

      Other device participating in verification.

      - `id: string`

        Other device ID.

      - `name?: string`

        Other device display name, if known.

    - `otherUserID?: string`

      Other Beeper user participating in verification.

    - `qr?: QR`

      QR verification data.

      - `data: string`

        QR code payload to display for verification.

    - `sas?: SAS`

      Emoji or number comparison data for verification.

      - `emojis: string`

        Emoji sequence to compare on both devices.

      - `decimals?: string`

        Number sequence to compare on both devices.
