---
title: "Get the QR code for the authenticated user's 2FA enrolment"
method: GET
path: "/user/two-factor-qr-code"
tags: ["Users"]
---

# Get the QR code for the authenticated user's 2FA enrolment

`GET /user/two-factor-qr-code`

Returns a fresh QR code the user can scan with their
authenticator app to register the shared secret. The QR code is
returned both as an `otpauth://` URL and as an inline SVG ready
for embedding in HTML.

## Response `200`

The QR code was successfully retrieved.

- TwoFactorQrCode — A two-factor authentication QR code object. Contains the URL the authenticator app should be pointed at along with a pre-rendered SVG version of the QR code for display in the UI.
  - `url` string, required — The url-encoded `otpauth://` URI represented by the QR code.
  - `svg` string, required — An inline SVG rendering of the QR code, ready for embedding in HTML.

## Other responses

- `401` — The user is unauthenticated

---

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