Skip to main content
Starts adding an authenticator app as a two-factor factor. The response has a new TOTP secret. Add it to an authenticator app, then call Finish TOTP enrollment with a code within 10 minutes.

Operation Type (for Signing)

Request Body

FieldTypeNeedDescriptionExample
”account”stringrequiredUser’s wallet address42trU9A5…
“signature”stringrequiredCryptographic signature5j1Vy9Uq…
“timestamp”integerrequiredCurrent timestamp in milliseconds1716200000000
”label”stringrequiredYour name for the factor. 1 to 64 characters, with no control characters and no leading or trailing spacesAuthenticator app
”expiry_window”integeroptionalSignature expiry in milliseconds30000
”two_factor”objectconditionalProof. Required while 2FA is on. Not part of the signed payload. See Proofs
Sign this request with the account’s own key. Agent wallets cannot sign it. The account must be a main account. If 2FA is already on, send a proof in two_factor. Any proof type works, including a recovery key. After the proof passes, you can send the same request with the same label again for 5 minutes without a new proof. An account has one authenticator app. If it already has one, the new one replaces it when you finish enrollment.

Signing

Sign label as the data object. Do not sign two_factor. For the request above, the message to sign is:

Response

  • Status 200: Enrollment started
Codes use SHA-1, 6 digits, and a 30-second period. The authenticator app shows the issuer Pacifica and a short form of your wallet address. Keep the secret private. Anyone who has it can make codes.
  • Status 400: Invalid request parameters, label, or signature
  • Status 401: The proof is wrong, expired, or already used
  • Status 403: The account is a subaccount, or it does not exist
  • Status 422: The account has no room for another factor (a user can have at most 8 factors)
  • Status 428: 2FA is on, and the request has no two_factor
  • Status 429: Too many proof attempts, or more than 20 enrollments started in 10 minutes
  • Status 500: Internal server error
  • Status 503: The two-factor service is unavailable. Retry later

Code Example (Python)