const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domains: [
{
domain: '<string>',
downstreamAddress: [{priority: 1, weight: 1, port: 1, target: '<string>'}],
settings: {
abusePolicyOverride: true,
spamHeaderName: '<string>',
spamHeaderValue: '<string>'
},
aliases: ['<string>'],
admins: ['<string>']
}
]
})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/batch', 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/batch"
payload = { "domains": [
{
"domain": "<string>",
"downstreamAddress": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"settings": {
"abusePolicyOverride": True,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
},
"aliases": ["<string>"],
"admins": ["<string>"]
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domains' => [
[
'domain' => '<string>',
'downstreamAddress' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
],
'settings' => [
'abusePolicyOverride' => true,
'spamHeaderName' => '<string>',
'spamHeaderValue' => '<string>'
],
'aliases' => [
'<string>'
],
'admins' => [
'<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 POST \
--url https://api.mailchannels.net/inbound/v1/domains/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"domains": [
{
"domain": "<string>",
"downstreamAddress": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"settings": {
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
},
"aliases": [
"<string>"
],
"admins": [
"<string>"
]
}
]
}
'{
"successes": [
{
"domain": {
"domain": "<string>",
"subscriptionHandle": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
],
"settings": {
"abusePolicy": "block",
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
}
},
"code": 201,
"comment": "<string>"
}
],
"errors": [
{
"domain": {
"domain": "<string>",
"subscriptionHandle": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
],
"settings": {
"abusePolicy": "block",
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
}
},
"code": 201,
"comment": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Bulk provision domains
Provision up to 1000 domains to use MailChannels Inbound.
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
domains: [
{
domain: '<string>',
downstreamAddress: [{priority: 1, weight: 1, port: 1, target: '<string>'}],
settings: {
abusePolicyOverride: true,
spamHeaderName: '<string>',
spamHeaderValue: '<string>'
},
aliases: ['<string>'],
admins: ['<string>']
}
]
})
};
fetch('https://api.mailchannels.net/inbound/v1/domains/batch', 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/batch"
payload = { "domains": [
{
"domain": "<string>",
"downstreamAddress": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"settings": {
"abusePolicyOverride": True,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
},
"aliases": ["<string>"],
"admins": ["<string>"]
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(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/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domains' => [
[
'domain' => '<string>',
'downstreamAddress' => [
[
'priority' => 1,
'weight' => 1,
'port' => 1,
'target' => '<string>'
]
],
'settings' => [
'abusePolicyOverride' => true,
'spamHeaderName' => '<string>',
'spamHeaderValue' => '<string>'
],
'aliases' => [
'<string>'
],
'admins' => [
'<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 POST \
--url https://api.mailchannels.net/inbound/v1/domains/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"domains": [
{
"domain": "<string>",
"downstreamAddress": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"settings": {
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
},
"aliases": [
"<string>"
],
"admins": [
"<string>"
]
}
]
}
'{
"successes": [
{
"domain": {
"domain": "<string>",
"subscriptionHandle": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
],
"settings": {
"abusePolicy": "block",
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
}
},
"code": 201,
"comment": "<string>"
}
],
"errors": [
{
"domain": {
"domain": "<string>",
"subscriptionHandle": "<string>",
"admins": [
"<string>"
],
"downstreamAddresses": [
{
"priority": 1,
"weight": 1,
"port": 1,
"target": "<string>"
}
],
"aliases": [
"<string>"
],
"settings": {
"abusePolicy": "block",
"abusePolicyOverride": true,
"spamHeaderName": "<string>",
"spamHeaderValue": "<string>"
}
},
"code": 201,
"comment": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Authorizations
Query Parameters
The subscription 'handle' that identifies the subscription that domains should be
provisioned against. Subscription handles can be retrieved from the /subscriptions
endpoint.
If present and set to true, the domains will be associated with the api-key in the header. This means that this api-key must be used for inbound-api actions involving these domains (for example adding safe/block list entries, etc).
If present and set to true, the settings (domain settings, downstream addresses, aliases and admins) for any existing domains will be overwritten with the ones in the request, unless a section is not included in the request or there is problem updating a setting in which case the previous settings are carried forward.
Body
1000Show child attributes
Show child attributes
Was this page helpful?

