import sendpost_python_sdk
from sendpost_python_sdk.apis.tags import domain_api
with sendpost_python_sdk.ApiClient() as api_client:
api_instance = domain_api.DomainApi(api_client)
x_sub_account_api_key = "your_api_key"
try:
domains = api_instance.get_all_domains(
header_params={ 'X-SubAccount-ApiKey': x_sub_account_api_key }
)
print(domains)
except sendpost_python_sdk.ApiException as e:
print(f"Exception: {e}")const { DomainApi } = require('sendpost_js');
const domain = new DomainApi();
const apiKey = 'your_api_key';
(async function() {
try {
const data = await domain.getAllDomains(apiKey);
console.log('API called successfully. Returned data: ', data);
} catch (error) {
console.error(error);
}
})();
curl --request GET \
--url https://api.sendpost.io/api/v1/subaccount/domain \
--header 'X-SubAccount-ApiKey: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendpost.io/api/v1/subaccount/domain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SubAccount-ApiKey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.sendpost.io/api/v1/subaccount/domain"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SubAccount-ApiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendpost.io/api/v1/subaccount/domain")
.header("X-SubAccount-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/subaccount/domain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SubAccount-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 117,
"name": "piedpiper.com",
"dkim": {
"host": "sp-dkim._domainkey.piedpiper.com",
"type": "TXT",
"textValue": "v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3D..."
},
"returnPath": {
"host": "sp-bounces.piedpiper.com",
"type": "CNAME",
"textValue": "sp.sendpost.email"
},
"track": {
"host": "track.piedpiper.com",
"type": "CNAME",
"textValue": "api.sendpost.io"
},
"dmarc": {
"host": "_dmarc.piedpiper.com",
"type": "TXT",
"textValue": "v=DMARC1; p=quarantine; rua=mailto:dmarc@piedpiper.com"
},
"dkimVerified": true,
"dmarcVerified": true,
"returnPathVerified": true,
"trackVerified": true,
"verified": true,
"domainRegisteredDate": "2014-04-12",
"created": 1704067200000000000
}
]List Domains
Retrieve all sending domains configured for this sub-account. Use this endpoint to audit your domain setup, check verification status, or retrieve DNS records for configuration.
Each domain record includes:
- Domain name and unique ID
- DNS records to configure (DKIM, Return-Path, Track, DMARC)
- Verification status for each record type
- Failure messages for troubleshooting
- Creation timestamp
Verification Status Values:
true- Record verified and activefalse- Record not verified (check DNS configuration)
Use Cases:
- Audit all configured sending domains
- Export DNS records for documentation
- Identify domains pending verification
- Monitor domain health across multiple domains
Pagination: Use limit and offset for large domain lists.
import sendpost_python_sdk
from sendpost_python_sdk.apis.tags import domain_api
with sendpost_python_sdk.ApiClient() as api_client:
api_instance = domain_api.DomainApi(api_client)
x_sub_account_api_key = "your_api_key"
try:
domains = api_instance.get_all_domains(
header_params={ 'X-SubAccount-ApiKey': x_sub_account_api_key }
)
print(domains)
except sendpost_python_sdk.ApiException as e:
print(f"Exception: {e}")const { DomainApi } = require('sendpost_js');
const domain = new DomainApi();
const apiKey = 'your_api_key';
(async function() {
try {
const data = await domain.getAllDomains(apiKey);
console.log('API called successfully. Returned data: ', data);
} catch (error) {
console.error(error);
}
})();
curl --request GET \
--url https://api.sendpost.io/api/v1/subaccount/domain \
--header 'X-SubAccount-ApiKey: <api-key>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sendpost.io/api/v1/subaccount/domain",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-SubAccount-ApiKey: <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"
"net/http"
"io"
)
func main() {
url := "https://api.sendpost.io/api/v1/subaccount/domain"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SubAccount-ApiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendpost.io/api/v1/subaccount/domain")
.header("X-SubAccount-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/subaccount/domain")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SubAccount-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 117,
"name": "piedpiper.com",
"dkim": {
"host": "sp-dkim._domainkey.piedpiper.com",
"type": "TXT",
"textValue": "v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3D..."
},
"returnPath": {
"host": "sp-bounces.piedpiper.com",
"type": "CNAME",
"textValue": "sp.sendpost.email"
},
"track": {
"host": "track.piedpiper.com",
"type": "CNAME",
"textValue": "api.sendpost.io"
},
"dmarc": {
"host": "_dmarc.piedpiper.com",
"type": "TXT",
"textValue": "v=DMARC1; p=quarantine; rua=mailto:dmarc@piedpiper.com"
},
"dkimVerified": true,
"dmarcVerified": true,
"returnPathVerified": true,
"trackVerified": true,
"verified": true,
"domainRegisteredDate": "2014-04-12",
"created": 1704067200000000000
}
]Authorizations
This api key can be used only for sub account level operations
Query Parameters
Number of records to return per request. Default is 20.
x >= 120
Number of initial records to skip for pagination.
x >= 00
Case insensitive search against domain names. Useful for finding specific domains in large lists.
"mycompany"
Response
List of domains retrieved successfully
Unique identifier for the domain
117
The domain name (e.g., "example.com"). This is the domain portion of your sending email addresses.
"piedpiper.com"
Auto-detected DNS provider for this domain (e.g. "cloudflare", "other"), used to tailor DNS-setup instructions. Read-only.
"cloudflare"
DKIM (DomainKeys Identified Mail) DNS record configuration. DKIM cryptographically signs your emails to verify they haven't been tampered with. This is REQUIRED for sending emails.
Show child attributes
Show child attributes
Return-Path (bounce handling) DNS record configuration. Configuring this allows bounce notifications to be properly routed through SendPost. RECOMMENDED for better deliverability.
Show child attributes
Show child attributes
Tracking domain DNS record configuration. When configured, click tracking links use your domain instead of SendPost's domain. RECOMMENDED for brand consistency and improved click-through rates.
Show child attributes
Show child attributes
DMARC (Domain-based Message Authentication, Reporting & Conformance) DNS record. DMARC builds on DKIM and SPF to provide email authentication and reporting. RECOMMENDED for enterprise senders.
Show child attributes
Show child attributes
Whether the DKIM DNS record has been verified successfully
true
Whether the DMARC DNS record has been verified successfully
false
Whether the Return-Path DNS record has been verified successfully
true
Whether the tracking domain DNS record has been verified successfully
true
Overall verification status. True only if DKIM is verified (minimum requirement). For full verification, configure all DNS records.
true
Date when this domain was originally registered (from WHOIS). Newer domains may have lower sender reputation initially.
"1995-08-14"
UNIX epoch timestamp in nanoseconds when the domain was added to SendPost
1704067200000000000
Detailed reason if DKIM verification failed (empty if verified or not attempted)
"DNS record not found. Please add the TXT record to your DNS provider."
Detailed reason if DMARC verification failed
""
Detailed reason if tracking domain verification failed
""
Detailed reason if Return-Path verification failed
""
Was this page helpful?