## Get Beeper app setup state

`app.setup.retrieve()  -> 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

- `class SetupRetrieveResponse: …`

  - `e2ee: E2EE`

    Encrypted messaging setup status.

    - `cross_signing: bool`

      Whether this account can verify trusted devices.

    - `first_sync_done: bool`

      Whether the first encrypted message sync is complete.

    - `has_backed_up_recovery_key: bool`

      Whether the user confirmed that they saved their recovery key.

    - `initialized: bool`

      Whether encrypted messaging setup has started.

    - `key_backup: bool`

      Whether encrypted message backup is available.

    - `secrets: E2EESecrets`

      Encrypted messaging keys available on this device.

      - `master_key: bool`

        Whether the account identity key is available.

      - `megolm_backup_key: bool`

        Whether the encrypted message backup key is available.

      - `recovery_key: bool`

        Whether a recovery key is available.

      - `self_signing_key: bool`

        Whether the device trust key is available.

      - `user_signing_key: bool`

        Whether the user trust key is available.

    - `secret_storage: bool`

      Whether secure key storage is available.

    - `verified: bool`

      Whether this device is trusted for encrypted messages.

    - `recovery_key_generated_at: Optional[float]`

      Unix timestamp for when the recovery key was created.

  - `state: Literal["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: Optional[Matrix]`

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

    - `device_id: str`

      Current device ID.

    - `homeserver: str`

      Beeper homeserver URL for this account.

    - `user_id: str`

      Signed-in Beeper user ID.

  - `verification: Optional[Verification]`

    Trusted device verification progress.

    - `id: str`

      Verification ID to pass in verification action paths.

    - `available_actions: List[Literal["accept", "cancel", "qr.confirmScanned", 2 more]]`

      Verification actions that are valid for the current state.

      - `"accept"`

      - `"cancel"`

      - `"qr.confirmScanned"`

      - `"sas.start"`

      - `"sas.confirm"`

    - `direction: Literal["incoming", "outgoing"]`

      Whether this device started or received the verification.

      - `"incoming"`

      - `"outgoing"`

    - `methods: List[Literal["qr", "sas"]]`

      Verification methods supported for this transaction.

      - `"qr"`

      - `"sas"`

    - `purpose: Literal["login", "device"]`

      Why this verification exists.

      - `"login"`

      - `"device"`

    - `state: Literal["requested", "ready", "sas_ready", 4 more]`

      Current trusted-device verification state.

      - `"requested"`

      - `"ready"`

      - `"sas_ready"`

      - `"qr_scanned"`

      - `"done"`

      - `"cancelled"`

      - `"error"`

    - `error: Optional[VerificationError]`

      Verification error details, if verification stopped.

      - `code: str`

        Verification error code.

      - `reason: str`

        User-facing verification error message.

    - `other_device: Optional[VerificationOtherDevice]`

      Other device participating in verification.

      - `id: str`

        Other device ID.

      - `name: Optional[str]`

        Other device display name, if known.

    - `other_user_id: Optional[str]`

      Other Beeper user participating in verification.

    - `qr: Optional[VerificationQR]`

      QR verification data.

      - `data: str`

        QR code payload to display for verification.

    - `sas: Optional[VerificationSAS]`

      Emoji or number comparison data for verification.

      - `emojis: str`

        Emoji sequence to compare on both devices.

      - `decimals: Optional[str]`

        Number sequence to compare on both devices.

### Example

```python
import os
from beeper_desktop_api import BeeperDesktop

client = BeeperDesktop(
    access_token=os.environ.get("BEEPER_ACCESS_TOKEN"),  # This is the default and can be omitted
)
setup = client.app.setup.retrieve()
print(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"
    }
  }
}
```
