---
title: "Generate 2Fa Secret"
method: POST
path: "/token/generate_2fa_secret"
tags: ["token"]
---

# Generate 2Fa Secret

`POST /token/generate_2fa_secret`

Flow A: opt-in. Generate secret + QR for an already-logged-in user enabling 2FA.

## Cookies

- `access_token` string, nullable

## Response `200`

Successful Response

- Enable2FAResponse
  - `secret` string, required
  - `qr_code` string, required

## Other responses

- `422` — Validation Error

---

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