Add item to customer list
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({item: '<string>'})
};
fetch('https://api.mailchannels.net/inbound/v1/lists/{listname}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/lists/{listname}"
payload = { "item": "<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/lists/{listname}",
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([
'item' => '<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/lists/{listname} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"item": "<string>"
}
'{
"item": "<string>",
"item_type": "<string>",
"action": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Add item to customer list
POST
/
lists
/
{listname}
Add item to customer list
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({item: '<string>'})
};
fetch('https://api.mailchannels.net/inbound/v1/lists/{listname}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/lists/{listname}"
payload = { "item": "<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/lists/{listname}",
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([
'item' => '<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/lists/{listname} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"item": "<string>"
}
'{
"item": "<string>",
"item_type": "<string>",
"action": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Authorizations
Path Parameters
The name of the list to add an entry to. One of 'safelist' or 'blocklist'. 'whitelist' and 'blacklist' are deprecated
Available options:
blocklist, safelist, blacklist, whitelist Body
application/json
The value of the entry. The type of the entry is automatically determined based on the value.
Was this page helpful?

