Skip to content

Totp Setup

POST
/api/v1/auth/totp/setup
curl --request POST \
--url https://example.com/api/v1/auth/totp/setup \
--header 'Content-Type: application/json' \
--data '{ "password": "example" }'

Start TOTP setup for a local-auth user — generates and stores a pending secret.

Requires the current password: a stolen session or API token must not be able to enrol its own authenticator, which ends every other session and locks the owner out.

Media typeapplication/json
TOTPSetupRequest

The current password: starting 2FA enrolment is as sensitive as turning it off.

object
password
required
Password
string
<= 1024 characters

Example generated

{
"password": "example"
}

Successful Response

Media typeapplication/json
TOTPSetupResponse
object
provisioning_uri
required
Provisioning Uri
string

Example generated

{
"provisioning_uri": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}