# App ## Get Beeper app setup state `$client->app->session(): AppSessionResponse` **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 - `AppSessionResponse` - `E2EE e2ee` Encrypted messaging setup status. - `State state` Current sign-in and encrypted messaging setup state for Beeper Desktop or Beeper Server. - `?Matrix matrix` Signed-in account details. Omitted until sign-in is complete. - `?Verification verification` Trusted device verification progress. ### Example ```php app->session(); var_dump($response); ``` #### 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" } } } ``` ## Domain Types ### Verification - `Verification` - `string id` Verification ID to pass in verification action paths. - `list availableActions` Verification actions that are valid for the current state. - `Direction direction` Whether this device started or received the verification. - `list methods` Verification methods supported for this transaction. - `Purpose purpose` Why this verification exists. - `State state` Current trusted-device verification state. - `?Error error` Verification error details, if verification stopped. - `?OtherDevice otherDevice` Other device participating in verification. - `?string otherUserID` Other Beeper user participating in verification. - `?Qr qr` QR verification data. - `?SAS sas` Emoji or number comparison data for verification. # Login ## Start Beeper app setup `$client->app->login->start(): LoginStartResponse` **post** `/v1/app/setup/start` Start setting up Beeper Desktop or Beeper Server. The flow supports existing Beeper accounts and new account creation. ### Returns - `LoginStartResponse` - `string setupRequestID` Setup request ID to use in the next sign-in step. - `list signInMethods` Available sign-in methods for this setup request. ### Example ```php app->login->start(); var_dump($response); ``` #### Response ```json { "setupRequestID": "setupRequestID", "signInMethods": [ "string" ] } ``` ## Send setup sign-in code `$client->app->login->email(string email, string setupRequestID): void` **post** `/v1/app/setup/email` Send a sign-in code to the user email address for app setup. ### Parameters - `email: string` Email address to send the sign-in code to. - `setupRequestID: string` Setup request ID returned by the start step. ### Example ```php app->login->email( email: 'dev@stainless.com', setupRequestID: 'setupRequestID' ); var_dump($result); ``` ## Complete setup sign-in with code `$client->app->login->response(string response, string setupRequestID): LoginResponseResponse` **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 - `response: string` Sign-in code from the user email. - `setupRequestID: string` Setup request ID returned by the start step. ### Returns - `LoginResponseResponse` - `AppSetupCompleteResponse` - `Matrix matrix` Account credentials for first-party app setup. - `Session session` Current app sign-in and encrypted messaging setup state after sign-in. - `AppSetupRegistrationRequiredResponse` - `Copy copy` Copy to display during account creation. - `string leadToken` Registration token returned by Beeper. - `true registrationRequired` Indicates that the user needs to create a Beeper account. - `string setupRequestID` Setup request ID to use when creating the account. - `?list usernameSuggestions` Suggested usernames for the new account. ### Example ```php app->login->response( response: 'response', setupRequestID: 'setupRequestID' ); var_dump($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->login->register(true acceptTerms, string leadToken, string setupRequestID, string username): LoginRegisterResponse` **post** `/v1/app/setup/register` Create a Beeper account after the user chooses a username and accepts the Terms of Use. ### Parameters - `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). - `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 - `LoginRegisterResponse` - `Matrix matrix` Account credentials for first-party app setup. - `Session session` Current app sign-in and encrypted messaging setup state after sign-in. ### Example ```php app->login->register( acceptTerms: true, leadToken: 'leadToken', setupRequestID: 'setupRequestID', username: 'x', ); var_dump($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" } } } } ``` # Verification # Recovery Key ## Verify with recovery key `$client->app->login->verification->recoveryKey->verify(string recoveryKey): RecoveryKeyVerifyResponse` **post** `/v1/app/setup/verification/recovery-key` Unlock encrypted messages with the user recovery key. ### Parameters - `recoveryKey: string` Recovery key saved by the user. ### Returns - `RecoveryKeyVerifyResponse` - `Session session` Current app sign-in and encrypted messaging setup state. ### Example ```php app->login->verification->recoveryKey->verify( recoveryKey: 'x' ); var_dump($response); ``` #### 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" } } } } ``` # Reset ## Create new recovery key `$client->app->login->verification->recoveryKey->reset->create(?string existingRecoveryKey): ResetNewResponse` **post** `/v1/app/setup/verification/recovery-key/reset` Create a new recovery key when the user cannot use the existing one. ### Parameters - `existingRecoveryKey?:optional string` Existing recovery key, if the user has it. ### Returns - `ResetNewResponse` - `string recoveryKey` 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. ### Example ```php app->login->verification->recoveryKey->reset->create( existingRecoveryKey: 'existingRecoveryKey' ); var_dump($reset); ``` #### 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->login->verification->recoveryKey->reset->confirm(string recoveryKey): ResetConfirmResponse` **post** `/v1/app/setup/verification/recovery-key/reset/confirm` Confirm that the new recovery key should be used for this account. ### Parameters - `recoveryKey: string` New recovery key returned by the reset step. ### Returns - `ResetConfirmResponse` - `Session session` Current app sign-in and encrypted messaging setup state. ### Example ```php app->login->verification->recoveryKey->reset->confirm( recoveryKey: 'x' ); var_dump($response); ``` #### 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" } } } } ``` # Verifications ## List active verifications `$client->app->verifications->list(): VerificationListResponse` **get** `/v1/app/setup/verifications` List pending and active device verifications. Use this to recover state without a WebSocket connection. ### Returns - `VerificationListResponse` - `list items` ### Example ```php app->verifications->list(); var_dump($verifications); ``` #### 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->verifications->create(?Purpose purpose, ?string userID): VerificationNewResponse` **post** `/v1/app/setup/verifications` Start verifying this device from another signed-in device. ### Parameters - `purpose?:optional Purpose` Why this verification is being started. - `userID?:optional string` Beeper user ID to verify. Defaults to the signed-in user. ### Returns - `VerificationNewResponse` - `Session session` Current app sign-in and encrypted messaging setup state. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->create( purpose: 'login', userID: 'userID' ); var_dump($verification); ``` #### 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->verifications->retrieve(string verificationID): VerificationGetResponse` **get** `/v1/app/setup/verifications/{verificationID}` Get the current state of a device verification transaction. ### Parameters - `verificationID: string` Verification ID. ### Returns - `VerificationGetResponse` - `Session session` Current app sign-in and encrypted messaging setup state. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->retrieve('x'); var_dump($verification); ``` #### 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->verifications->accept(string verificationID): 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. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->accept('x'); var_dump($response); ``` #### 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->verifications->cancel(string verificationID, ?string code, ?string reason): VerificationCancelResponse` **post** `/v1/app/setup/verifications/{verificationID}/cancel` Cancel an active device verification request. ### Parameters - `verificationID: string` Verification ID. - `code?:optional string` Optional cancellation code. - `reason?:optional string` Optional user-facing cancellation reason. ### Returns - `VerificationCancelResponse` - `Session session` Current app sign-in and encrypted messaging setup state. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->cancel( 'x', code: 'code', reason: 'reason' ); var_dump($response); ``` #### 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" } } } ``` # Qr ## Scan verification QR code `$client->app->verifications->qr->scan(string data): QrScanResponse` **post** `/v1/app/setup/verifications/qr/scan` Submit the QR code scanned from another signed-in device. ### Parameters - `data: string` QR code payload scanned from the other device. ### Returns - `QrScanResponse` - `Session session` Current app sign-in and encrypted messaging setup state. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->qr->scan(data: 'x'); var_dump($response); ``` #### 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->verifications->qr->confirmScanned(string verificationID): 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. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->qr->confirmScanned('x'); var_dump($response); ``` #### 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" } } } ``` # SAS ## Start emoji verification `$client->app->verifications->sas->start(string verificationID): 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. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->sas->start('x'); var_dump($response); ``` #### 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->verifications->sas->confirm(string verificationID): 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. - `?Verification verification` Trusted device verification progress. ### Example ```php app->verifications->sas->confirm('x'); var_dump($response); ``` #### 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" } } } ```