---
title: "Generate a TOTP secret"
method: POST
path: "/api/my-account/mfa-verifications/totp-secret/generate"
tags: ["My account"]
---

# Generate a TOTP secret

`POST /api/my-account/mfa-verifications/totp-secret/generate`

## Request

- Base URL: `https://[tenant_id].logto.app`
- URL: `https://[tenant_id].logto.app/api/my-account/mfa-verifications/totp-secret/generate`
- Auth: OAuth 2 (client credentials, token URL `/oidc/token`, scopes: `all`)

Generate a TOTP secret for the user.

## Response `200`

The TOTP secret was generated successfully.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/logto/apis/logto-api-references.md) - [All operations](https://skmtc.dev/logto/apis/logto-api-references/llms.txt) - [OpenAPI document](https://skmtc.dev/logto/apis/logto-api-references/revisions/beed1405186a?raw)
