Herald
OpenapiUser

Enable TOTP two-factor authentication for the current user

Initiates TOTP setup by generating a secret key, QR code URL, and backup codes. The user must verify the TOTP code to complete the setup. Requires a single-use reauth ticket obtained by verifying any one of the user's factors (password, TOTP, or Passkey) via `POST /api/user/reauth/verify` (see `consume_reauth`).

POST
/api/user/totp

Initiates TOTP setup by generating a secret key, QR code URL, and backup codes. The user must verify the TOTP code to complete the setup. Requires a single-use reauth ticket obtained by verifying any one of the user's factors (password, TOTP, or Passkey) via POST /api/user/reauth/verify (see consume_reauth).

Authorization

bearer_auth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

reauth_token*string

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/user/totp" \  -H "Content-Type: application/json" \  -d '{    "reauth_token": "string"  }'
{  "backupCodes": [    "string"  ],  "qrCodeUrl": "string",  "secret": "string",  "tempToken": "string"}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}
{  "code": "string",  "details": null,  "message": "string",  "requestId": "string",  "status": 0}