Confirm the new authenticator
POST
/v1/auth/2fa/totp/replace/confirm
const url = 'https://api.emite.cr/v1/auth/2fa/totp/replace/confirm';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"123456"}'};
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://api.emite.cr/v1/auth/2fa/totp/replace/confirm \ --header 'Content-Type: application/json' \ --data '{ "code": "123456" }'Confirms the replacement with a code from the NEW authenticator, which takes the place of the current one: from then on only its codes work. The recovery codes are not touched, and the person receives an email notice. Within 15 minutes of starting it: 400 TOTP_REPLACEMENT_EXPIRED (params.minutes) after that, 400 TOTP_REPLACEMENT_NOT_STARTED without a replacement in progress, 400 INVALID_TWO_FACTOR_CODE for a wrong code.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
code
required
A code from the new authenticator.
string
Example
123456