Skip to main content
GET
/
mfa
/
totp
/
generate
Generate TOTP secret
curl --request GET \
  --url https://{subdomain}.auth.{region}.nhost.run/v1/mfa/totp/generate \
  --header 'Authorization: Bearer <token>'
{
  "imageUrl": "data:image/png;base64,iVBORw0KGg...",
  "totpSecret": "ABCDEFGHIJK23456"
}

Authorizations

Authorization
string
header
required

Bearer authentication with JWT access token. Used to authenticate requests to protected endpoints.

Response

TOTP secret successfully generated

Response containing TOTP setup information for MFA

imageUrl
string
required

URL to QR code image for scanning with an authenticator app

Example:

"data:image/png;base64,iVBORw0KGg..."

totpSecret
string
required

TOTP secret key for manual setup with an authenticator app

Example:

"ABCDEFGHIJK23456"

I