Reference / Auth

Begin MFA enrollment for a login that returned `mfa_enrollment_required`. Pre-session: the user is identified by the `pending_token`, not a session. Returns the TOTP provisioning secret.

POST /v1/auth/mfa/enroll/begin
End-user session operationId: mfa_enroll_begin

Authorization

Called from the browser with the publishable application id (x-application-id); the access token lives in memory.

Request body · required

  • pending_token string required

Responses

200 Enrollment started
{
  "data": {
    "factor_id": "018f3c4a-7b2e-7c1d-9e0a-1f2b3c4d5e6f",
    "otpauth_url": "string",
    "secret": "string"
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "meta": {
    "timestamp": "string"
  },
  "success": false
}
401 Invalid or expired pending token

Request

curl -X POST "http://localhost:8080/v1/auth/mfa/enroll/begin" \
  -H "Content-Type: application/json" \
  -d '{
  "pending_token": "string"
}'

Try it

live request
POST http://localhost:8080/v1/auth/mfa/enroll/begin

Request body

application/json