Start authenticator-app setup
curl --request POST \
--url https://my.server.express/api/v1/auth/2fa/totp \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://my.server.express/api/v1/auth/2fa/totp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/auth/2fa/totp"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"success": true,
"data": {
"secret": "<string>",
"otpauthUri": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Auth
Start authenticator-app setup
Generates a TOTP secret and returns it with an otpauth:// URI for the QR code. Nothing is active until PUT confirms a code. Calling this again replaces an unconfirmed enrolment. Returns 409 if an authenticator is already confirmed, and 503 if the server has no encryption key to store the secret with.
POST
/
v1
/
auth
/
2fa
/
totp
Start authenticator-app setup
curl --request POST \
--url https://my.server.express/api/v1/auth/2fa/totp \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://my.server.express/api/v1/auth/2fa/totp', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/auth/2fa/totp"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"success": true,
"data": {
"secret": "<string>",
"otpauthUri": "<string>"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}