Email a management code
POST
/v1/auth/2fa/email/management-code
const url = 'https://api.emite.cr/v1/auth/2fa/email/management-code';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"password":"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://api.emite.cr/v1/auth/2fa/email/management-code \ --header 'Content-Type: application/json' \ --data '{ "password": "example" }'Sends a fresh 6-digit code, valid for 15 minutes, to the account email: the second-factor proof (code) that POST /v1/auth/2fa/disable and POST /v1/auth/2fa/recovery-codes/regenerate accept. Only for accounts whose SOLE method is email: any other answers 409 TWO_FACTOR_EMAIL_METHOD_REQUIRED and proves with its authenticator or a recovery code. Requires the current password. At most one code every 60 seconds (429 EMAIL_VERIFICATION_COOLDOWN); 503 EMAIL_DELIVERY_FAILED when the email could not be sent.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
password
required
The current password of the account. A wrong one answers 400 INVALID_CURRENT_PASSWORD.
string
Examplegenerated
{ "password": "example"}Responses
Section titled “Responses”The code was sent. The response has no body.