Update an email domain
PATCH
/
email_domains
/
{id}
Update an email domain
curl --request PATCH \
--url https://api.telnyx.com/v2/email_domains/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inbound_enabled": true,
"tracking": {
"open_tracking": false
}
}
'import requests
url = "https://api.telnyx.com/v2/email_domains/{id}"
payload = {
"inbound_enabled": True,
"tracking": { "open_tracking": False }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inbound_enabled: true, tracking: {open_tracking: false}})
};
fetch('https://api.telnyx.com/v2/email_domains/{id}', 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://api.telnyx.com/v2/email_domains/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'inbound_enabled' => true,
'tracking' => [
'open_tracking' => false
]
]),
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.telnyx.com/v2/email_domains/{id}"
payload := strings.NewReader("{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.telnyx.com/v2/email_domains/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/email_domains/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"record_type": "email_domain",
"domain": "example.com",
"type": "custom",
"status": "pending",
"usable_for_sending": false,
"usable_for_inbound": false,
"verification": {
"ownership": "pending",
"spf": "missing_optional",
"dkim": "pending",
"dmarc": "missing_optional",
"mx": "not_required"
},
"dns_records": [],
"dkim": {
"selector": null,
"algorithm": null,
"key_length": null,
"active": false,
"rotated_at": null
},
"inbound": {
"enabled": false,
"catch_all": false,
"mx_required": false
},
"dmarc_policy": {
"p": "none",
"pct": 100,
"rua": "mailto:dmarc@telnyx.com"
},
"tracking": {
"open_tracking": false,
"click_tracking": false,
"unsubscribe_tracking": false
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"verified_at": null
}
}{
"errors": [
{
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "domain is invalid",
"source": {
"pointer": "/data/attributes/domain"
}
}
]
}{
"errors": [
{
"code": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Email domain UUID
Body
application/json
Response
Email domain updated
Show child attributes
Show child attributes
Example:
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"record_type": "email_domain",
"domain": "example.com",
"type": "custom",
"status": "pending",
"usable_for_sending": false,
"usable_for_inbound": false,
"verification": {
"ownership": "pending",
"spf": "missing_optional",
"dkim": "pending",
"dmarc": "missing_optional",
"mx": "not_required"
},
"dns_records": [],
"dkim": {
"selector": null,
"algorithm": null,
"key_length": null,
"active": false,
"rotated_at": null
},
"inbound": {
"enabled": false,
"catch_all": false,
"mx_required": false
},
"dmarc_policy": {
"p": "none",
"pct": 100,
"rua": "mailto:dmarc@telnyx.com"
},
"tracking": {
"open_tracking": false,
"click_tracking": false,
"unsubscribe_tracking": false
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"verified_at": null
}
Was this page helpful?
⌘I
Update an email domain
curl --request PATCH \
--url https://api.telnyx.com/v2/email_domains/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inbound_enabled": true,
"tracking": {
"open_tracking": false
}
}
'import requests
url = "https://api.telnyx.com/v2/email_domains/{id}"
payload = {
"inbound_enabled": True,
"tracking": { "open_tracking": False }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({inbound_enabled: true, tracking: {open_tracking: false}})
};
fetch('https://api.telnyx.com/v2/email_domains/{id}', 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://api.telnyx.com/v2/email_domains/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'inbound_enabled' => true,
'tracking' => [
'open_tracking' => false
]
]),
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.telnyx.com/v2/email_domains/{id}"
payload := strings.NewReader("{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}HttpResponse<String> response = Unirest.patch("https://api.telnyx.com/v2/email_domains/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/email_domains/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inbound_enabled\": true,\n \"tracking\": {\n \"open_tracking\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"record_type": "email_domain",
"domain": "example.com",
"type": "custom",
"status": "pending",
"usable_for_sending": false,
"usable_for_inbound": false,
"verification": {
"ownership": "pending",
"spf": "missing_optional",
"dkim": "pending",
"dmarc": "missing_optional",
"mx": "not_required"
},
"dns_records": [],
"dkim": {
"selector": null,
"algorithm": null,
"key_length": null,
"active": false,
"rotated_at": null
},
"inbound": {
"enabled": false,
"catch_all": false,
"mx_required": false
},
"dmarc_policy": {
"p": "none",
"pct": 100,
"rua": "mailto:dmarc@telnyx.com"
},
"tracking": {
"open_tracking": false,
"click_tracking": false,
"unsubscribe_tracking": false
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"verified_at": null
}
}{
"errors": [
{
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested email domain was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "domain is invalid",
"source": {
"pointer": "/data/attributes/domain"
}
}
]
}{
"errors": [
{
"code": "500",
"title": "Internal Server Error",
"detail": "An unexpected error occurred"
}
]
}