Start enabling email codes
POST
/v1/auth/2fa/email/enable
const url = 'https://api.emite.cr/v1/auth/2fa/email/enable';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/enable \ --header 'Content-Type: application/json' \ --data '{ "password": "example" }'Sends a 6-digit code, valid for 15 minutes, to the account email: the mailbox confirmation needed to enable the email-code method, completed at POST /v1/auth/2fa/email/confirm. Requires the current password. 409 TWO_FACTOR_ALREADY_ENABLED when the method is already active. 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.