API7 Docs

Start two-factor (2FA) enrollment for the current user

POST /api/me/2fa/setup

POST /api/me/2fa/setup

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Response Body

application/json

curl -X POST "$API_BASE_URL/api/me/2fa/setup"

Two-factor enrollment started. Returns the secret and a QR code to register in an authenticator app.

{
  "value": {
    "secret": "string",
    "otpauth_url": "string",
    "qr_code": "string"
  }
}
Complete operation details and schema variants

POST /api/me/2fa/setup

Start two-factor (2FA) enrollment for the current user

Generate a new TOTP secret for the currently authenticated user and return it together with a provisioning URI and QR code. The secret is not active until confirmed via the enable endpoint.

Parameters

Responses

  • 200: Two-factor enrollment started. Returns the secret and a QR code to register in an authenticator app.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional):
  • value.secret (string, optional): The base32 shared secret for manual entry into an authenticator app.
  • value.otpauth_url (string, optional): The otpauth:// provisioning URI.
  • value.qr_code (string, optional): A data URI (data:image/png;base64,...) QR code encoding the provisioning URI.
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

curl -X POST '$API_BASE_URL/api/me/2fa/setup'