Confirm 2FA setup
POST
/2fa/confirm
const url = 'https://auth.timetonic.com/api/2fa/confirm';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"code":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://auth.timetonic.com/api/2fa/confirm \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "code": "example" }'Verify code and enable 2FA
Authorizations
Section intitulée « Authorizations »Request Bodyrequired
Section intitulée « Request Bodyrequired »Media typeapplication/json
object
code
required
6-digit TOTP code
string
Examplegenerated
{ "code": "example"}Responses
Section intitulée « Responses »2FA enabled with backup codes
Media typeapplication/json
object
success
boolean
message
string
backup_codes
Array<string>
Examplegenerated
{ "success": true, "message": "example", "backup_codes": [ "example" ]}Bad request
Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{ "success": false, "error": "bad_request", "message": "Invalid request"}Authentication required or failed
Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{ "success": false, "error": "unauthorized", "message": "Authentication required"}