Manual
CLI
API
Log in Get started free

Turn on two-factor authentication

Confirms a code from the authenticator app and turns two-factor authentication on.

Confirms a code from the authenticator app and turns two-factor authentication on.

HTTP
POST /account/mfa/enable

Access: Session token only. API keys get 403 with insufficient_scope.

Request body #

JSON.

FieldTypeRequiredDescription
codestringyesThe 6-digit code the app shows for the secret from Start two-factor setup.
JSON
{ "code": "123456" }

Response 201 #

JSON
{ "recoveryCodes": ["3fa9c-1b2d4", "9c0e1-77aa3"] }

recoveryCodes holds 10 codes. Each works once instead of an app code when you sign in. They are shown only now.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
409mfa_not_startedYou did not start the setup.
409mfa_enabledTwo-factor authentication is on already.
422invalid_requestcode is invalid.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.