Python SDK
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
}
]Domain
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.
GET
/
subaccount
/
domain
Python SDK
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
Query Parameters
Response
200 - application/json
List of domains retrieved successfully
Was this page helpful?