Update domain settings
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
abusePolicyOverride: true,
spamHeaderName: '<string>',
spamHeaderValue: '<string>',
admins: ['<string>'],
downstreamAddresses: [{priority: 1, weight: 1, port: 1, target: '<string>'}],
aliases: ['<string>']
})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/{domain}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/domains/{domain}/settings"
payload = {
"abusePolicyOverride": True,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>",
"admins": ["<string>"],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/inbound/v1/domains/{domain}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'abusePolicyOverride' => true,
'spamHeaderName' => '<string>',
'spamHeaderValue' => '<string>',
'admins' => [
'<string>'
],
'downstreamAddresses' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
],
'aliases' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://api.mailchannels.net/inbound/v1/domains/{domain}/settings \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
]
}
'{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Update domain settings
Update the abuse policy settings (these settings determine how spam messages are handled), downstream addresses, admins and aliases for a domain.
PUT
/
domains
/
{domain}
/
settings
Update domain settings
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
abusePolicyOverride: true,
spamHeaderName: '<string>',
spamHeaderValue: '<string>',
admins: ['<string>'],
downstreamAddresses: [{priority: 1, weight: 1, port: 1, target: '<string>'}],
aliases: ['<string>']
})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/{domain}/settings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/domains/{domain}/settings"
payload = {
"abusePolicyOverride": True,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>",
"admins": ["<string>"],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": ["<string>"]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mailchannels.net/inbound/v1/domains/{domain}/settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'abusePolicyOverride' => true,
'spamHeaderName' => '<string>',
'spamHeaderValue' => '<string>',
'admins' => [
'<string>'
],
'downstreamAddresses' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
],
'aliases' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://api.mailchannels.net/inbound/v1/domains/{domain}/settings \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
]
}
'{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Body
application/json
The abuse policy settings, downstream addresses, admins and aliases for the domains.
Response
The domain settings were successfully updated
Was this page helpful?

