---
title: "POST /v1/account/2fa/enroll"
method: POST
path: "/v1/account/2fa/enroll"
tags: ["AccountService"]
---

# POST /v1/account/2fa/enroll

`POST /v1/account/2fa/enroll`

EnrollTOTP 二步验证第一阶段：生成 TOTP secret 并以 pending 状态存库，
 返回 secret/otpauthUrl/qrCodePngBase64；此时 2FA 尚未启用。

## Request body

- AccountV1EnrollTOTPRequest

## Response `200`

OK

- AccountV1EnrollTOTPReply
  - `otpAuthUrl` string — otpauth:// URI，供前端生成二维码
  - `qrCodePngBase64` string — QR 码 PNG 图片的 base64 编码（data:image/png;base64,...）
  - `secret` string — TOTP 原文 secret（base32 编码），仅此一次展示，用户须存入 Authenticator App

---

[API](https://skmtc.dev/apiqik/apis/apiqik-api.md) · [All operations](https://skmtc.dev/apiqik/apis/apiqik-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apiqik/apiqik-api/revisions/e06b96127408/schema)
