---
title: "Generate TOTP secret"
method: GET
path: "/mfa/totp/generate"
tags: ["user"]
---

# Generate TOTP secret

`GET /mfa/totp/generate`

Generate a Time-based One-Time Password (TOTP) secret for setting up multi-factor authentication

## Response `200`

TOTP secret successfully generated

- TotpGenerateResponse — Response containing TOTP setup information for MFA
  - `imageUrl` string, required — URL to QR code image for scanning with an authenticator app
  - `totpSecret` string, required — TOTP secret key for manual setup with an authenticator app

## Other responses

- `default` — An error occurred while processing the request

---

[API](https://skmtc.net/nhost/apis/nhost-authentication-api.md) · [All operations](https://skmtc.net/nhost/apis/nhost-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/nhost/nhost-authentication-api/versions/a5c0d88b55c4/schema)
