Skip to content
Connect an agent

Keys

Start setting up an authenticator app

Makes a new secret for an authenticator app and answers it once.

POST/user/two-factor/setup

TL;DR

QuestionAnswer
What does it do?Start setting up an authenticator app.
What does it take?Nothing.
What does it return?Status 200 with a body of type TwoFactorSetup.
What can go wrong?401 not signed in; 403 the request came from an origin that may not make changes; 409 two-step sign-in is already on (account.two_factor_on); 429 too many requests; 503 this server cannot set up two-step sign-in (account.two_factor_unavailable). Every failure uses the one error envelope.

What it does

Makes a new secret for an authenticator app and answers it once. Nothing is turned on until POST /user/two-factor/enable gets a right code from the app.

Responses

StatusMeaningBody
200The secret, shown once.TwoFactorSetup
401Not signed in.ErrorResponse
403The request came from an origin that may not make changes.ErrorResponse
409Two-step sign-in is already on (account.two_factor_on).ErrorResponse
429Too many requests.ErrorResponse
503This server cannot set up two-step sign-in (account.two_factor_unavailable).ErrorResponse

Response body

A 200 answer has the type TwoFactorSetup.

FieldTypeRequiredDescription
secretstringyesThe shared secret in base32, for typing into an app that cannot scan.
uristringyesThe otpauth:// address an authenticator app scans as a QR code.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools