Skip to content

Disable two-factor authentication

POST
/v1/auth/2fa/disable
curl --request POST \
--url https://api.emite.cr/v1/auth/2fa/disable \
--header 'Content-Type: application/json' \
--data '{ "password": "example", "code": "example" }'

Turns two-factor authentication off entirely: both methods and the recovery codes are deleted. Requires the current password and a second-factor proof in code: a code from the authenticator, an unused recovery code or, when email is the sole method, the code from POST /v1/auth/2fa/email/management-code (400 TWO_FACTOR_CODE_REQUIRED without one, 400 INVALID_TWO_FACTOR_CODE for a wrong one). 409 TWO_FACTOR_NOT_ENABLED when it is already off. The person receives an email notice.

Media typeapplication/json
object
password
required

The current password of the account. A wrong one answers 400 INVALID_CURRENT_PASSWORD.

string
code

Proof of the second factor, required although the schema marks it optional (400 TWO_FACTOR_CODE_REQUIRED without it): a current code from the authenticator app, an unused recovery code (spent by this call), or, only when email is the sole method of the account, the code sent by POST /v1/auth/2fa/email/management-code. A wrong one answers 400 INVALID_TWO_FACTOR_CODE.

string
Examplegenerated
{
"password": "example",
"code": "example"
}