Skip to main content

Managing Email Domains

Use your own custom domains to send emails, improving deliverability and maintaining brand consistency.

List All Domains

View all domains currently registered with your account.
const res = await contiguity.domains.list();

Parameters

No parameters required.

Response

domains
object[]
Array of all domains registered with your account, including their verification status and configuration details.
metadata
object
Request metadata including ID, timestamp, and API version.

Get Domain Details

Get detailed information about a specific domain, including verification status and DNS records.
const res = await contiguity.domains.get("example.com");

Parameters

domain
string
required
Domain name (e.g. "example.com"). Passed as first argument.

Response

status
string
Current verification status of the domain (e.g., “verified”, “pending”, “failed”).
records
object[]
Array of DNS records required for domain verification and email sending.
verifications
object
Detailed verification status for each DNS record type (DKIM, SPF, DMARC).
metadata
object
Request metadata including ID, timestamp, and API version.

Register a Domain

Add a new domain to your account for sending emails.
const res = await contiguity.domains.register("example.com", {
  region: "us-east-1",
  custom_return_path: "mail"
});
Minimal:
const res = await contiguity.domains.register("example.com");

Parameters

domain
string
required
Domain name to register (e.g. "example.com"). First argument.
options
object
Optional. region, custom_return_path, etc.

Response

status
string
Registration status of the domain (e.g., “registered”, “pending_verification”).
records
object[]
Array of DNS records that must be added to your domain’s DNS settings for verification.
metadata
object
Request metadata including ID, timestamp, and API version.

Delete a Domain

Remove a domain from your account when it’s no longer needed.
await contiguity.domains.delete("example.com");

Parameters

domain
string
required
Domain name to delete. Passed as first argument.

Response

success
boolean
Indicates whether the domain was successfully deleted.
message
string
Confirmation message about the deletion status.
metadata
object
Request metadata including ID, timestamp, and API version.

Using Custom Domains

Once your domain is verified, you can use it to send emails with your brand:
// Send email from your custom domain
const res = await contiguity.email.send({
  to: "user@example.com",
  from: "Your App <hello@yourdomain.com>", // Use your verified domain
  subject: "Welcome to our platform!",
  html: "<h1>Welcome!</h1><p>Thanks for joining us.</p>",
  text: "Welcome! Thanks for joining us.",
  reply_to: "support@yourdomain.com"
});

Domain Verification

After registering a domain, you’ll need to:
  1. Add DNS records provided in the registration response to your domain’s DNS settings
  2. Verify ownership by ensuring the DNS records are properly configured
  3. Wait for verification which typically takes a few minutes to complete
The verification status can be checked using the domains.get() method.
Make sure to add all required DNS records (DKIM, SPF, DMARC) to ensure optimal email deliverability and to prevent your emails from being marked as spam.
Deleting a domain will immediately stop all email sending from that domain. Make sure to update your email configurations before removing a domain.