Add email domain
curl --request POST \
--url https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"domain": "mail.acme.com"
}
'import requests
url = "https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains"
payload = { "domain": "mail.acme.com" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'mail.acme.com'})
};
fetch('https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains', 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://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains",
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([
'domain' => 'mail.acme.com'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains"
payload := strings.NewReader("{\n \"domain\": \"mail.acme.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}HttpResponse<String> response = Unirest.post("https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"mail.acme.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"mail.acme.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ed_01xyz",
"workspace_id": "ws_01abc",
"domain": "mail.acme.com",
"provider": "resend",
"status": "pending",
"provider_domain_id": "d_01",
"region": "us-east-1",
"dns_records": [
{
"type": "TXT",
"name": "resend._domainkey.mail.acme.com",
"value": "p=MIGf…"
},
{
"type": "MX",
"name": "mail.acme.com",
"value": "feedback-smtp.us-east-1.amazonses.com"
}
],
"last_error": null,
"verified_at": null,
"created_at": "2026-07-15T10:00:00.000Z",
"updated_at": "2026-07-15T10:00:00.000Z"
}{
"error": "Use a custom subdomain such as support.yourdomain.com or mail.yourdomain.com."
}{
"error": "Unauthorized"
}{
"error": "Invalid request"
}{
"error": "Upgrade to Developer to add custom email domains."
}{
"error": "Too many requests"
}Domains
Add email domain
Plans: Developer · Enterprise
Starts custom domain provisioning with Resend. Domain must be a subdomain with ≥3 labels (for example mail.acme.com or support.yourdomain.com) — apex domains are rejected. Requires workspace admin. Subject to plan custom-domain limits. Developer or Enterprise required. Returns 201. Costs provision credits (10).
API credits: 10 (provision).
POST
https://console.mermail.app
/
api
/
v1
/
workspaces
/
{workspaceId}
/
email-domains
Add email domain
curl --request POST \
--url https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"domain": "mail.acme.com"
}
'import requests
url = "https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains"
payload = { "domain": "mail.acme.com" }
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'mail.acme.com'})
};
fetch('https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains', 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://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains",
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([
'domain' => 'mail.acme.com'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains"
payload := strings.NewReader("{\n \"domain\": \"mail.acme.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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))
}HttpResponse<String> response = Unirest.post("https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"mail.acme.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.mermail.app/api/v1/workspaces/{workspaceId}/email-domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"mail.acme.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "ed_01xyz",
"workspace_id": "ws_01abc",
"domain": "mail.acme.com",
"provider": "resend",
"status": "pending",
"provider_domain_id": "d_01",
"region": "us-east-1",
"dns_records": [
{
"type": "TXT",
"name": "resend._domainkey.mail.acme.com",
"value": "p=MIGf…"
},
{
"type": "MX",
"name": "mail.acme.com",
"value": "feedback-smtp.us-east-1.amazonses.com"
}
],
"last_error": null,
"verified_at": null,
"created_at": "2026-07-15T10:00:00.000Z",
"updated_at": "2026-07-15T10:00:00.000Z"
}{
"error": "Use a custom subdomain such as support.yourdomain.com or mail.yourdomain.com."
}{
"error": "Unauthorized"
}{
"error": "Invalid request"
}{
"error": "Upgrade to Developer to add custom email domains."
}{
"error": "Too many requests"
}Authorizations
API key (sk-proj-…) from Settings → API Keys. Required for sold API calls outside the Mermail console.
Path Parameters
Workspace id
Body
application/json
Custom subdomain used for agent mailboxes
Example:
"mail.acme.com"
Response
Domain created (DNS verification pending)
Example:
"resend"
Provider/local status such as pending, verified, deleting, deleted
⌘I