PlatformXeDocs
Get API Key

Domains

SDK methods for managing sending domains and DNS verification.

The client.domains namespace provides typed methods for registering, verifying, and managing sending domains used for email delivery. Available in TypeScript, Python, and Go SDKs.

SDKInstallNamespace
TypeScriptnpm install @caldera/platformxe-sdkclient.domains
Pythonpip install platformxeclient.domains
Gogo get github.com/calderaxe/platformxe-goclient.Domains

Register a domain

Register a new sending domain. PlatformXe returns DNS records that must be configured with your DNS provider before the domain can be verified.

const domain = await client.domains.register({
  domain: 'notifications.myapp.com',
});

console.log(domain.id);         // "dom_abc123"
console.log(domain.status);     // "PENDING"
console.log(domain.dnsRecords); // Array of required DNS records
domain = client.domains.register(domain="notifications.myapp.com")
domain, err := client.Domains.Add("notifications.myapp.com")

DNS records response

After registration, the response includes DNS records to configure. Each record contains:

FieldDescription
typeRecord type (CNAME, TXT, MX)
nameDNS record name
valueDNS record value
priorityPriority (for MX records)

List domains

const { domains } = await client.domains.list();

for (const d of domains) {
  console.log(`${d.domain}: ${d.status}`);
}
result = client.domains.list()
result, err := client.Domains.List()

Get a domain

const domain = await client.domains.get('dom_abc123');
domain = client.domains.get("dom_abc123")
domain, err := client.Domains.Get("dom_abc123")

Verify a domain

Trigger DNS verification for a registered domain. Call this after you have configured the required DNS records.

const result = await client.domains.verify('dom_abc123');

console.log(result.verified); // true or false
console.log(result.checks);   // { spf: true, dkim: true, returnPath: true }
result = client.domains.verify("dom_abc123")
result, err := client.Domains.Verify("dom_abc123")

DNS propagation can take up to 48 hours. If verification fails, wait and retry. The checks field indicates which specific DNS records have been confirmed.

Delete a domain

Remove a registered sending domain. Emails can no longer be sent from this domain after deletion.

await client.domains.delete('dom_abc123');
client.domains.delete("dom_abc123")
result, err := client.Domains.Delete("dom_abc123")

Registration errors

domains.register() (POST /api/v1/domains) can be refused with these codes. Nothing is registered in any of them.

CodeHTTPMeaning
DOMAIN_ALREADY_REGISTERED409The domain is already registered, by your organisation or by another one. The message is the same in every case and never says who holds the domain.
DOMAIN_LIMIT_REACHED503No domain can be added at the moment. Retrying does not help: contact support. The Go SDK returns it at once, without retrying.
PROVIDER_ERROR502The registration failed for another reason. Try again later.

Scopes required

MethodScope
domains.register()domains:manage
domains.list()domains:manage
domains.get()domains:manage
domains.verify()domains:manage
domains.delete()domains:manage