Skip to content
Download Beeper

Complete setup sign-in with code

client.App.Setup.Response(ctx, body) (*AppSetupResponseResponseUnion, error)
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.

ParametersExpand Collapse
body AppSetupResponseParams
Response param.Field[string]

Sign-in code from the user email.

SetupRequestID param.Field[string]

Setup request ID returned by the start step.

ReturnsExpand Collapse
type AppSetupResponseResponseUnion interface{…}
One of the following:
type AppSetupResponseResponseSuccess struct{…}
Matrix AppSetupResponseResponseSuccessMatrix

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 AppSetupResponseResponseSuccessSession

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

E2EE AppSetupResponseResponseSuccessSessionE2EE

Encrypted messaging setup status.

CrossSigning bool

Whether this account can verify trusted devices.

FirstSyncDone bool

Whether the first encrypted message sync is complete.

HasBackedUpRecoveryKey bool

Whether the user confirmed that they saved their recovery key.

Initialized bool

Whether encrypted messaging setup has started.

KeyBackup bool

Whether encrypted message backup is available.

Secrets AppSetupResponseResponseSuccessSessionE2EESecrets

Encrypted messaging keys available on this device.

MasterKey bool

Whether the account identity key is available.

MegolmBackupKey bool

Whether the encrypted message backup key is available.

RecoveryKey bool

Whether a recovery key is available.

SelfSigningKey bool

Whether the device trust key is available.

UserSigningKey bool

Whether the user trust key is available.

SecretStorage bool

Whether secure key storage is available.

Verified bool

Whether this device is trusted for encrypted messages.

RecoveryKeyGeneratedAt float64Optional

Unix timestamp for when the recovery key was created.

State string

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

One of the following:
const AppSetupResponseResponseSuccessSessionStateNeedsLogin AppSetupResponseResponseSuccessSessionState = "needs-login"
const AppSetupResponseResponseSuccessSessionStateInitializing AppSetupResponseResponseSuccessSessionState = "initializing"
const AppSetupResponseResponseSuccessSessionStateNeedsCrossSigningSetup AppSetupResponseResponseSuccessSessionState = "needs-cross-signing-setup"
const AppSetupResponseResponseSuccessSessionStateNeedsVerification AppSetupResponseResponseSuccessSessionState = "needs-verification"
const AppSetupResponseResponseSuccessSessionStateNeedsSecrets AppSetupResponseResponseSuccessSessionState = "needs-secrets"
const AppSetupResponseResponseSuccessSessionStateNeedsFirstSync AppSetupResponseResponseSuccessSessionState = "needs-first-sync"
const AppSetupResponseResponseSuccessSessionStateReady AppSetupResponseResponseSuccessSessionState = "ready"
Matrix AppSetupResponseResponseSuccessSessionMatrixOptional

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 AppSetupResponseResponseSuccessSessionVerificationOptional

Trusted device verification progress.

ID string

Verification ID to pass in verification action paths.

AvailableActions []string

Verification actions that are valid for the current state.

One of the following:
const AppSetupResponseResponseSuccessSessionVerificationAvailableActionAccept AppSetupResponseResponseSuccessSessionVerificationAvailableAction = "accept"
const AppSetupResponseResponseSuccessSessionVerificationAvailableActionCancel AppSetupResponseResponseSuccessSessionVerificationAvailableAction = "cancel"
const AppSetupResponseResponseSuccessSessionVerificationAvailableActionQRConfirmScanned AppSetupResponseResponseSuccessSessionVerificationAvailableAction = "qr.confirmScanned"
const AppSetupResponseResponseSuccessSessionVerificationAvailableActionSASStart AppSetupResponseResponseSuccessSessionVerificationAvailableAction = "sas.start"
const AppSetupResponseResponseSuccessSessionVerificationAvailableActionSASConfirm AppSetupResponseResponseSuccessSessionVerificationAvailableAction = "sas.confirm"
Direction string

Whether this device started or received the verification.

One of the following:
const AppSetupResponseResponseSuccessSessionVerificationDirectionIncoming AppSetupResponseResponseSuccessSessionVerificationDirection = "incoming"
const AppSetupResponseResponseSuccessSessionVerificationDirectionOutgoing AppSetupResponseResponseSuccessSessionVerificationDirection = "outgoing"
Methods []string

Verification methods supported for this transaction.

One of the following:
const AppSetupResponseResponseSuccessSessionVerificationMethodQR AppSetupResponseResponseSuccessSessionVerificationMethod = "qr"
const AppSetupResponseResponseSuccessSessionVerificationMethodSAS AppSetupResponseResponseSuccessSessionVerificationMethod = "sas"
Purpose string

Why this verification exists.

One of the following:
const AppSetupResponseResponseSuccessSessionVerificationPurposeLogin AppSetupResponseResponseSuccessSessionVerificationPurpose = "login"
const AppSetupResponseResponseSuccessSessionVerificationPurposeDevice AppSetupResponseResponseSuccessSessionVerificationPurpose = "device"
State string

Current trusted-device verification state.

One of the following:
const AppSetupResponseResponseSuccessSessionVerificationStateRequested AppSetupResponseResponseSuccessSessionVerificationState = "requested"
const AppSetupResponseResponseSuccessSessionVerificationStateReady AppSetupResponseResponseSuccessSessionVerificationState = "ready"
const AppSetupResponseResponseSuccessSessionVerificationStateSASReady AppSetupResponseResponseSuccessSessionVerificationState = "sas_ready"
const AppSetupResponseResponseSuccessSessionVerificationStateQRScanned AppSetupResponseResponseSuccessSessionVerificationState = "qr_scanned"
const AppSetupResponseResponseSuccessSessionVerificationStateDone AppSetupResponseResponseSuccessSessionVerificationState = "done"
const AppSetupResponseResponseSuccessSessionVerificationStateCancelled AppSetupResponseResponseSuccessSessionVerificationState = "cancelled"
const AppSetupResponseResponseSuccessSessionVerificationStateError AppSetupResponseResponseSuccessSessionVerificationState = "error"
Error AppSetupResponseResponseSuccessSessionVerificationErrorOptional

Verification error details, if verification stopped.

Code string

Verification error code.

Reason string

User-facing verification error message.

OtherDevice AppSetupResponseResponseSuccessSessionVerificationOtherDeviceOptional

Other device participating in verification.

ID string

Other device ID.

Name stringOptional

Other device display name, if known.

OtherUserID stringOptional

Other Beeper user participating in verification.

QR AppSetupResponseResponseSuccessSessionVerificationQROptional

QR verification data.

Data string

QR code payload to display for verification.

SAS AppSetupResponseResponseSuccessSessionVerificationSASOptional

Emoji or number comparison data for verification.

Emojis string

Emoji sequence to compare on both devices.

Decimals stringOptional

Number sequence to compare on both devices.

type AppSetupResponseResponseRegistrationRequired struct{…}
Copy AppSetupResponseResponseRegistrationRequiredCopy

Copy to display during account creation.

Submit Continue

Submit button label.

Terms ByContinuingYouAgreeToTheTermsOfUseAndAcknowledgeThePrivacyPolicy

Terms and privacy notice to show before account creation.

Title ChooseYourUsername

Title for the username step.

UsernamePlaceholder Username

Placeholder for the username field.

LeadToken string

Registration token returned by Beeper.

RegistrationRequired bool

Indicates that the user needs to create a Beeper account.

SetupRequestID string

Setup request ID to use when creating the account.

UsernameSuggestions []stringOptional

Suggested usernames for the new account.

Complete setup sign-in with code

package main

import (
  "context"
  "fmt"

  "github.com/beeper/desktop-api-go"
  "github.com/beeper/desktop-api-go/option"
)

func main() {
  client := beeperdesktopapi.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  response, err := client.App.Setup.Response(context.TODO(), beeperdesktopapi.AppSetupResponseParams{
    Response: "response",
    SetupRequestID: "setupRequestID",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "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"
      }
    }
  }
}
Returns Examples
{
  "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"
      }
    }
  }
}