import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const domain = await commune.domains.create({
domain: 'mycompany.com',
});
console.log(domain.data.id); // domain ID
console.log(domain.data.status); // pending
from commune import CommuneClient
client = CommuneClient()
domain = client.domains.create(domain="mycompany.com")
print(domain.data.id)
print(domain.data.status)
create_domain(domain="mycompany.com")
curl -X POST https://api.commune.email/v1/domains \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"name": "mycompany.com"
}'
commune domains create --domain "mycompany.com"
{
"data": {
"id": "domain_xyz789",
"name": "mycompany.com",
"status": "pending",
"region": "us-east-1",
"records": [
{
"type": "MX",
"name": "mycompany.com",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10,
"ttl": 300,
"status": "not_started"
},
{
"type": "TXT",
"name": "resend._domainkey.mycompany.com",
"value": "p=MIGfMA0GCSq...",
"ttl": 300,
"status": "not_started"
}
],
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: name"
}
{
"error": "Custom domain limit reached (1/1). Upgrade your plan for more.",
"current_count": 1,
"limit": 1,
"current_tier": "free",
"upgrade_url": "/dashboard/billing"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Domains
Create domain
Register a custom domain for sending and receiving email.
POST
/
v1
/
domains
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const domain = await commune.domains.create({
domain: 'mycompany.com',
});
console.log(domain.data.id); // domain ID
console.log(domain.data.status); // pending
from commune import CommuneClient
client = CommuneClient()
domain = client.domains.create(domain="mycompany.com")
print(domain.data.id)
print(domain.data.status)
create_domain(domain="mycompany.com")
curl -X POST https://api.commune.email/v1/domains \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"name": "mycompany.com"
}'
commune domains create --domain "mycompany.com"
{
"data": {
"id": "domain_xyz789",
"name": "mycompany.com",
"status": "pending",
"region": "us-east-1",
"records": [
{
"type": "MX",
"name": "mycompany.com",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10,
"ttl": 300,
"status": "not_started"
},
{
"type": "TXT",
"name": "resend._domainkey.mycompany.com",
"value": "p=MIGfMA0GCSq...",
"ttl": 300,
"status": "not_started"
}
],
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: name"
}
{
"error": "Custom domain limit reached (1/1). Upgrade your plan for more.",
"current_count": 1,
"limit": 1,
"current_tier": "free",
"upgrade_url": "/dashboard/billing"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
import { CommuneClient } from 'commune-ai';
const commune = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY });
const domain = await commune.domains.create({
domain: 'mycompany.com',
});
console.log(domain.data.id); // domain ID
console.log(domain.data.status); // pending
from commune import CommuneClient
client = CommuneClient()
domain = client.domains.create(domain="mycompany.com")
print(domain.data.id)
print(domain.data.status)
create_domain(domain="mycompany.com")
curl -X POST https://api.commune.email/v1/domains \
-H "Authorization: Bearer comm_..." \
-H "Content-Type: application/json" \
-d '{
"name": "mycompany.com"
}'
commune domains create --domain "mycompany.com"
{
"data": {
"id": "domain_xyz789",
"name": "mycompany.com",
"status": "pending",
"region": "us-east-1",
"records": [
{
"type": "MX",
"name": "mycompany.com",
"value": "feedback-smtp.us-east-1.amazonses.com",
"priority": 10,
"ttl": 300,
"status": "not_started"
},
{
"type": "TXT",
"name": "resend._domainkey.mycompany.com",
"value": "p=MIGfMA0GCSq...",
"ttl": 300,
"status": "not_started"
}
],
"createdAt": "2026-02-25T10:00:00.000Z"
}
}
{
"error": "Missing required field: name"
}
{
"error": "Custom domain limit reached (1/1). Upgrade your plan for more.",
"current_count": 1,
"limit": 1,
"current_tier": "free",
"upgrade_url": "/dashboard/billing"
}
{
"error": "unauthorized",
"message": "Invalid or missing API key"
}
Body
string
required
The domain name to register (e.g.
"mycompany.com"). Must be a valid domain you control so you can add DNS records.string
AWS region for the domain’s sending infrastructure. One of:
us-east-1, eu-west-1. Defaults to us-east-1.Response
object
Hide properties
Hide properties
string
Unique domain identifier. Pass this as
domain_id when creating inboxes or sending email.string
The registered domain name.
string
Verification status.
"pending" until DNS records are verified. After calling Verify domain, this transitions to "verified" or remains "pending" if DNS hasn’t propagated yet.string
AWS region for this domain’s sending infrastructure.
object[]
DNS records you must add to your domain registrar to complete verification.
Show Record properties
Show Record properties
string
ISO 8601 creation timestamp.
Next steps
After creating a domain:- Add the DNS records shown in
data.recordsto your domain registrar. - Wait for DNS propagation (usually a few minutes to a few hours).
- Call Verify domain to trigger verification.
- Once
statusis"verified", create inboxes and start sending.
Last modified on March 19, 2026
Was this page helpful?

