API7 Docs

Confirm and enable two-factor (2FA) for the current user

POST /api/me/2fa/enable

POST /api/me/2fa/enable

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Request Body

application/json

A two-factor verification code (TOTP or one-time recovery code).

Response Body

application/json

curl -X POST "$API_BASE_URL/api/me/2fa/enable" \  -H "Content-Type: application/json" \  -d '{    "code": "string"  }'

Two-factor authentication enabled. Returns one-time recovery codes shown only once.

{
  "value": {
    "recovery_codes": [
      "string"
    ]
  }
}
Complete operation details and schema variants

POST /api/me/2fa/enable

Confirm and enable two-factor (2FA) for the current user

Confirm a pending TOTP secret with a valid code and enable two-factor authentication. Returns one-time recovery codes that are shown only once.

Parameters

Request body

Content type: application/json

  • code (string, required): The TOTP code or a one-time recovery code.

Responses

  • 200: Two-factor authentication enabled. Returns one-time recovery codes shown only once.
  • allOf variant 1
  • value (object, optional): The specific resource.
  • allOf variant 2
  • value (object, optional):
  • value.recovery_codes (array, optional): One-time recovery codes. Store them securely; each can be used once if the authenticator device is unavailable.
  • 400: Invalid arguments. Error details will be provided in the response.

cURL

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