Change the password
POST
/api/v1/mailbox/security/passwordChanges the mailbox password. Every other session is signed out (the one making the call stays); mail apps need the new password.
Errors
| Status | When |
|---|---|
401 |
No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login. |
401 |
Current password is incorrect. |
409 |
New password must be different from the current one. |
422 |
The new password is too weak or too long. |
429 |
Too many wrong current passwords. |
Request body
current_passwordstringrequiredThe password in use now.
new_passwordstringrequiredThe new password. Must differ from the current one.
Request
POST
/api/v1/mailbox/security/passwordcurl -X POST 'https://courier.mailyte.com/api/v1/mailbox/security/password' \
-H 'Authorization: Bearer MAILBOX_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"current_password": "old-password",
"new_password": "a-long-new-passphrase"
}'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/security/password', {
method: 'POST',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"current_password": "old-password",
"new_password": "a-long-new-passphrase"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://courier.mailyte.com/api/v1/mailbox/security/password",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
json={
"current_password": "old-password",
"new_password": "a-long-new-passphrase"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->post('https://courier.mailyte.com/api/v1/mailbox/security/password', [
'current_password' => 'old-password',
'new_password' => 'a-long-new-passphrase',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/security/password")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"current_password": "old-password",
"new_password": "a-long-new-passphrase"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
dataobjectsessions_revokedintegerOther sessions signed out.
cache_flushedboolean
200
application/json{
"type": "success",
"msg": "Password changed",
"data": {
"sessions_revoked": 2,
"cache_flushed": true
}
}Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | `Current password is incorrect`. |
409 | `New password must be different from the current one`. |
422 | The new password is too weak or too long. |
429 | Too many wrong current passwords. |
502 | The mail server could not be reached, so the password was not checked. Try again. |
Every status, with what causes it and what to do, is on the error reference.