Block a sender
POST
/api/v1/mailbox/blocked-sendersMail from this address goes straight to Junk. One full address per call (whole domains cannot be blocked); up to 500.
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. |
Request body
addressstringrequiredThe full address to block.
Request
POST
/api/v1/mailbox/blocked-senderscurl -X POST 'https://courier.mailyte.com/api/v1/mailbox/blocked-senders' \
-H 'Authorization: Bearer MAILBOX_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"address": "spam@example.net"
}'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/blocked-senders', {
method: 'POST',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"address": "spam@example.net"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://courier.mailyte.com/api/v1/mailbox/blocked-senders",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
json={
"address": "spam@example.net"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->post('https://courier.mailyte.com/api/v1/mailbox/blocked-senders', [
'address' => 'spam@example.net',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/blocked-senders")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
request["Content-Type"] = "application/json"
request.body = {
"address": "spam@example.net"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
dataobjectaddressesarray<string>managedbooleanfolderstringWhere their mail goes instead.
limitinteger
200
application/json{
"type": "success",
"msg": "Sender blocked",
"data": {
"addresses": [
"spam@example.net"
],
"managed": true,
"folder": "Junk",
"limit": 500
}
}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 | Validation Error |
Every status, with what causes it and what to do, is on the error reference.