Create a recipient
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({list_entries: {blocklist: ['<string>'], safelist: ['<string>']}})
};
fetch('https://api.mailchannels.net/inbound/v1/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/users"
payload = { "list_entries": {
"blocklist": ["<string>"],
"safelist": ["<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/users",
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([
'list_entries' => [
'blocklist' => [
'<string>'
],
'safelist' => [
'<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/users \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"list_entries": {
"blocklist": [
"<string>"
],
"safelist": [
"<string>"
]
}
}
'{
"recipient": {
"email_address": "<string>",
"roles": [
"<string>"
],
"filter": true
},
"list_entries": [
{
"item": "<string>",
"item_type": "<string>",
"action": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Create a recipient
PUT
/
users
Create a recipient
const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({list_entries: {blocklist: ['<string>'], safelist: ['<string>']}})
};
fetch('https://api.mailchannels.net/inbound/v1/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.mailchannels.net/inbound/v1/users"
payload = { "list_entries": {
"blocklist": ["<string>"],
"safelist": ["<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/users",
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([
'list_entries' => [
'blocklist' => [
'<string>'
],
'safelist' => [
'<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/users \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"list_entries": {
"blocklist": [
"<string>"
],
"safelist": [
"<string>"
]
}
}
'{
"recipient": {
"email_address": "<string>",
"roles": [
"<string>"
],
"filter": true
},
"list_entries": [
{
"item": "<string>",
"item_type": "<string>",
"action": "<string>"
}
]
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}{
"errors": [
"<string>"
],
"code": 123,
"message": "<string>"
}Query Parameters
Whether or not to filter mail for this recipient. There are three valid values.
- true - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, return an error.
- false - Filtering policy will not be applied to messages intended for this recipient.
- compute (default) - Filtering policy will be applied to messages intended for this recipient. If this would exceed the protected-addresses limit, filtering policy will not be applied, and no error will be returned.
Available options:
true, false, compute Body
application/json
Response
Returned in the case where the recipient already exists and in that case no changes will be made to the safe/block list entries.
Was this page helpful?

