Skip to content

Start an authenticator app enrolment

POST
/v1/mfa/enrollment/start/authenticator/

Starts enrolling the logged-in user in MFA with an authenticator app. For users only. The first enrolment needs no password or mfa_token; later ones need both. Confirm with Confirm an MFA enrolment.

Authorization

apiKey
headerAuthorizationBasic <token>

HTTP Basic authentication with your API key or the id of a token as the username and an empty password.

Request Body

application/json
  1. body
password?string

The password of the user. Needed when the user already has MFA.

mfa_token?string

A code from a method the user already has. Needed when the user already has MFA.

force_send_sms?boolean

Send an SMS code to confirm, when the user has both SMS and an authenticator app.

Response Body

The enrolment has started.

application/json
  1. response
id?string

The ID of the enrolment.

otpauth_url?string

The otpauth:// URL to show as a QR code for the authenticator app.

secret?string

The secret, for users who add it to the app by hand.

curl -X POST 'https://api.example.com/v1/mfa/enrollment/start/authenticator/' \  --user "$API_KEY:" \  -H 'Content-Type: application/json' \  -d '{  "password": "correct-Horse-battery-7",  "mfa_token": "123456"}'
{  "id": "845c16de-f627-48cb-bc81-a6b3b1fb134b__bc060460-266e-43f2-a030-e8b8d80126da",  "otpauth_url": "otpauth://totp/user%40example.com?secret=EXAMPLESECRET&issuer=Example+platform",  "secret": "EXAMPLESECRET"}