Domains

Add and verify your domains to send emails with your own sender identity.

Why Verify Domains?

Domain verification improves email deliverability and protects your brand:

  • Better deliverability - Verified domains have higher inbox placement rates
  • Brand protection - DKIM signing prevents email spoofing
  • Professional appearance - Send from your own domain, not a shared sender

Add a Domain

Register a domain for verification.

POST /v1/domains
add-domain.ts
const domain = await client.domains.create({
  domain: 'mail.example.com',
});

console.log(domain.status); // 'pending'
console.log(domain.dnsRecords); // DNS records to configure

DNS Configuration

After adding a domain, you will receive DNS records to configure. Add these records to your DNS provider:

Required Records

TypeHostValuePurpose
TXTmailv=spf1 include:spf.veilmail.xyz ~allSPF (sender verification)
TXTveilmail._domainkeyk=rsa; p=MIGfMA0GCS...DKIM (signing)
CNAMEbouncebounce.veilmail.xyzBounce handling

DNS Propagation

DNS changes can take up to 48 hours to propagate. Most changes are visible within a few minutes to a few hours.

Verify Domain

After configuring DNS records, trigger verification to check the setup.

POST /v1/domains/:id/verify
verify-domain.ts
const domain = await client.domains.verify('domain_xxxxx');

if (domain.status === 'verified') {
  console.log('Domain verified successfully!');
} else {
  // Check which records are still pending
  for (const record of domain.dnsRecords) {
    console.log(`${record.type} ${record.host}: ${record.status}`);
  }
}

Domain Status

StatusDescription
pendingDNS records not yet verified
verifiedAll DNS records verified, ready to send
failedVerification failed (records may be incorrect)

List Domains

GET /v1/domains
list-domains.ts
const { data } = await client.domains.list();

for (const domain of data) {
  console.log(`${domain.domain}: ${domain.status}`);
}

Delete Domain

DELETE /v1/domains/:id
delete-domain.ts
await client.domains.delete('domain_xxxxx');