Turn two-factor off
POST
/api/v1/mailbox/security/2fa/disableNeeds a current code (or a recovery code), so a stolen session alone cannot turn it off.
Errors
| Status | When |
|---|---|
401 |
No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login. |
403 |
The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required. |
422 |
The code is wrong. |
Request body
codestringrequiredA current code, or a recovery code.
Request
POST
/api/v1/mailbox/security/2fa/disablecurl -X POST 'https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable' \
-H 'Authorization: Bearer MAILBOX_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"code": "492039"
}'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable', {
method: 'POST',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": "492039"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
json={
"code": "492039"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->post('https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable', [
'code' => '492039',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/security/2fa/disable")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"code": "492039"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
dataobjecttwo_factor_enabledboolean
200
application/json{
"type": "success",
"msg": "Two-factor authentication disabled",
"data": {
"two_factor_enabled": false
}
}Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`. |
403 | The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`. |
422 | The code is wrong. |
Every status, with what causes it and what to do, is on the error reference.