Add a sending domain
curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "example.com"
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/domains"
payload = { "name": "example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'example.com'})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"example.com\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/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([
'name' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.instantly.ai/api/v2/email-marketing/domains"
payload := strings.NewReader("{\n \"name\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"id": "01a20d6a-b920-7107-9525-bb2548f6b005",
"name": "example.com",
"workspace_id": "01a20d6a-b920-7107-9525-bb268df15819",
"dns_records": [
{
"purpose": "DKIM",
"dns_type": "TXT",
"name": "instantly._domainkey",
"value": "p=PUBLIC_KEY_HERE",
"priority": 10,
"ttl": "Auto",
"required": true,
"description": "Verifies emails are from you"
}
],
"timestamp_created": "2026-11-24T11:57:07.744Z",
"timestamp_updated": "2026-11-24T11:57:07.744Z",
"created_by": "01a20d6a-b920-7107-9525-bb2724f7b4fe",
"actor_type": "user",
"verified_for_sending_status": false,
"dkim_status": "PENDING",
"verification_info": {
"last_checked_timestamp": "2026-11-24T11:57:07.744Z",
"last_success_timestamp": "2026-11-24T11:57:07.744Z",
"error_type": "TYPE_NOT_FOUND"
},
"is_warmed_up": false,
"open_tracking_enabled": false,
"click_tracking_enabled": false
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Domain not found",
"code": "DOMAIN_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}Inbound & Lifecycle: Domain
Add a sending domain
Adds a domain to send broadcasts from and returns the DNS records to publish at your DNS provider. A new domain is not warmed up; set is_warmed_up with an update. A domain that is already added is a 400 with code DOMAIN_EXISTS.
Requires one of the following scopes: email_marketing_domains:create, email_marketing_domains:all, all:create, all:all
POST
/
api
/
v2
/
email-marketing
/
domains
Add a sending domain
curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "example.com"
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/domains"
payload = { "name": "example.com" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'example.com'})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"example.com\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/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([
'name' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.instantly.ai/api/v2/email-marketing/domains"
payload := strings.NewReader("{\n \"name\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"id": "01a20d6a-b920-7107-9525-bb2548f6b005",
"name": "example.com",
"workspace_id": "01a20d6a-b920-7107-9525-bb268df15819",
"dns_records": [
{
"purpose": "DKIM",
"dns_type": "TXT",
"name": "instantly._domainkey",
"value": "p=PUBLIC_KEY_HERE",
"priority": 10,
"ttl": "Auto",
"required": true,
"description": "Verifies emails are from you"
}
],
"timestamp_created": "2026-11-24T11:57:07.744Z",
"timestamp_updated": "2026-11-24T11:57:07.744Z",
"created_by": "01a20d6a-b920-7107-9525-bb2724f7b4fe",
"actor_type": "user",
"verified_for_sending_status": false,
"dkim_status": "PENDING",
"verification_info": {
"last_checked_timestamp": "2026-11-24T11:57:07.744Z",
"last_success_timestamp": "2026-11-24T11:57:07.744Z",
"error_type": "TYPE_NOT_FOUND"
},
"is_warmed_up": false,
"open_tracking_enabled": false,
"click_tracking_enabled": false
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Domain not found",
"code": "DOMAIN_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}Authorizations
Body
application/json
The Domain to create
The Domain to create
Response
The Domain
An email sending domain. Optional fields with no value are left out of responses. Lists page with starting_after: pass the previous page's next_starting_after until there is none.