Share DNS Records
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/domains/{id}/share \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
"dns-admin@example.com"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/domains/{id}/share"
payload = { "recipients": ["dns-admin@example.com"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({recipients: ['dns-admin@example.com']})
};
fetch('https://cloudapi.mailercloud.com/v1/domains/{id}/share', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloudapi.mailercloud.com/v1/domains/{id}/share",
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([
'recipients' => [
'dns-admin@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloudapi.mailercloud.com/v1/domains/{id}/share"
payload := strings.NewReader("{\n \"recipients\": [\n \"dns-admin@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "DNS records sent",
"recipients": [
"dns-admin@example.com"
]
}Share DNS Records
Email the domain’s DNS records to up to 10 people (for example, whoever manages your DNS) — the same as Share in Account Settings → Domains.
POST
/
domains
/
{id}
/
share
Share DNS Records
curl --request POST \
--url https://cloudapi.mailercloud.com/v1/domains/{id}/share \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
"dns-admin@example.com"
]
}
'import requests
url = "https://cloudapi.mailercloud.com/v1/domains/{id}/share"
payload = { "recipients": ["dns-admin@example.com"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({recipients: ['dns-admin@example.com']})
};
fetch('https://cloudapi.mailercloud.com/v1/domains/{id}/share', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloudapi.mailercloud.com/v1/domains/{id}/share",
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([
'recipients' => [
'dns-admin@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloudapi.mailercloud.com/v1/domains/{id}/share"
payload := strings.NewReader("{\n \"recipients\": [\n \"dns-admin@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "DNS records sent",
"recipients": [
"dns-admin@example.com"
]
}Authorizations
Your Mailercloud API key (plain text, no Bearer prefix). Create keys in Settings → API.
Path Parameters
Domain ID (from Add a Domain or List Domains)
Body
application/json
Email addresses to send the DNS records to.
Minimum: 1 Maximum: 10
Required array length:
1 - 10 elements