Create a email suppression
/api/v1/email-suppressionsRequest body
reasonstringrequiredunsubscribed | complained | bounced | manualWhy they are blocked.
emailstringrequiredThe address to block. With
scope: domain, a domain likeexample.com(no @).scopestringaddress | domainaddress(the default) blocks one address.domainblocks every address at a domain.notestringOptional. Your own note on why.
Request
/api/v1/email-suppressionscurl -X POST 'https://app.mailyte.com/api/v1/email-suppressions' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"reason": "unsubscribed",
"email": "ada@example.com"
}'const response = await fetch('https://app.mailyte.com/api/v1/email-suppressions', {
method: 'POST',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"reason": "unsubscribed",
"email": "ada@example.com"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://app.mailyte.com/api/v1/email-suppressions",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
json={
"reason": "unsubscribed",
"email": "ada@example.com"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->post('https://app.mailyte.com/api/v1/email-suppressions', [
'reason' => 'unsubscribed',
'email' => 'ada@example.com',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/email-suppressions")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = {
"reason": "unsubscribed",
"email": "ada@example.com"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringsuppressionidstringemailstringThe address, or the bare domain when
scopeisdomain. Always lowercase.scopestringaddress | domainA
domainrule blocks every recipient at that EXACT domain. Subdomains are separate rules, matching SendGrid and Mailgun, so a rule never blocks more than the string somebody typed.applies_tostringall | marketingWhat this blocks.
allstops every email, including app email such as receipts and password resets.marketingstops only marketing. An unsubscribe blocks marketing; a bounce or complaint blocks everything.reasonstringWhy the address is blocked: usually
unsubscribed,complained,bouncedormanual. Imported rows can carry other values (importby default), so do not treat this as a closed list.sourcestringmanual | automaticmanualis a person or your API call;automaticis our bounce and complaint listener. A manual entry is never downgraded to automatic by a later event.notestringYour own note. Null when none was written; entries we add automatically have none.
suppressed_atstringWhen the address was blocked.
expires_atstringWhen the block ends and the address can be emailed again. Null means never, which is the case for everything you add and for every bounce, complaint and unsubscribe. The one block that ends: a mailbox that stayed full for three days is skipped for 30.
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait. |
Every status, with what causes it and what to do, is on the error reference.