Confirm authenticator-app setup
curl --request PUT \
--url https://my.server.express/api/v1/auth/2fa/totp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
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"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"backupCodes": [
"<string>"
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Auth
Confirm authenticator-app setup
Checks a code against the pending secret and switches the authenticator on. Returns 10 fresh backup codes and clears any left from a previous enrolment. The codes are shown once — no endpoint returns them again. A wrong code is 400 (usually a phone clock that’s drifted). 409 if already confirmed. Writes an ENABLE_TOTP audit entry.
PUT
/
v1
/
auth
/
2fa
/
totp
Confirm authenticator-app setup
curl --request PUT \
--url https://my.server.express/api/v1/auth/2fa/totp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
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"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"backupCodes": [
"<string>"
]
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Body
application/json
Six-digit code from the authenticator app.