Skip to content

Domains

POST /domains/

Register a new email domain.

FieldTypeRequiredDescription
namestringYesDomain name (e.g. mycompany.com). Auto-lowercased.
partner_refstringNoMaster only. Attribute the domain to a tenant at creation time. Ignored when sent by a customer token (the caller’s own partner_ref always wins).
Terminal window
# Customer token — the API uses your token's partner_ref
curl -X POST https://api.emboux.com/domains/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "mycompany.com"}'
# Master token — attribute on creation
curl -X POST https://api.emboux.com/domains/ \
-H "Authorization: Bearer MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "mycompany.com", "partner_ref": "partner_42"}'
{
"id": 1,
"name": "mycompany.com",
"created_at": "2025-01-15T10:30:00"
}
StatusDetail
400Domain already exists
403Domain quota exceeded

GET /domains/

Returns all domains visible to the authenticated key.

  • Master token: returns all domains
  • Client token: returns only domains belonging to that partner
Terminal window
curl https://api.emboux.com/domains/ \
-H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": 2,
"name": "example.org",
"created_at": "2025-01-16T08:00:00"
},
{
"id": 1,
"name": "mycompany.com",
"created_at": "2025-01-15T10:30:00"
}
]

DELETE /domains/{domain_name}

Permanently removes a domain and all its mailboxes and aliases (cascade delete).

ParameterTypeDescription
domain_namestringThe domain name to delete
Terminal window
curl -X DELETE https://api.emboux.com/domains/mycompany.com \
-H "Authorization: Bearer YOUR_API_KEY"

No response body.

StatusDetail
404Domain not found

POST /domains/{domain_name}/register-subdomain

Complete provider-side setup for a subdomain whose parent is a verified wildcard domain. After a successful call the subdomain can send outbound mail using the parent’s DKIM identity.

Available to both master and customer tokens. Customer tokens may only register subdomains they own (filtered by partner_ref — a 404 is returned for any other domain).

Call this once, right after creating a subdomain under a verified wildcard parent. If you create domains via the Odoo module, this call is dispatched automatically and you do not need to invoke it yourself.

ParameterTypeDescription
domain_namestringSubdomain name (must have at least 3 parts, e.g. client1.example.com)
Terminal window
curl -X POST https://api.emboux.com/domains/client1.example.com/register-subdomain \
-H "Authorization: Bearer YOUR_API_KEY"
{
"name": "client1.example.com",
"verification_token": "",
"dkim_tokens": [],
"verified": true,
"dns_records": [],
"provider": "mailgun"
}
StatusDetail
400Name is not a subdomain (≤ 2 parts)
404Domain not found (or not owned by this customer token)

PUT /domains/{domain_name}/parent

Set parent_domain and/or is_wildcard for a domain. Master token only.

FieldTypeRequiredDescription
parent_domainstringNoName of the parent domain (or null to clear)
is_wildcardbooleanNoEnable wildcard mode for this domain
Terminal window
curl -X PUT https://api.emboux.com/domains/ganemo.com/parent \
-H "Authorization: Bearer YOUR_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{"is_wildcard": true}'
{
"name": "ganemo.com",
"parent_domain": null,
"is_wildcard": true
}

GET /domains/{domain_name}/dns-check

Verify that DNS records are configured correctly for a domain.

{
"name": "ganemo.com",
"all_ok": true,
"records": [
{"record_type": "MX", "name": "ganemo.com", "expected": "mx1.emboux.com", "status": "ok"},
{"record_type": "TXT", "name": "ganemo.com", "expected": "include:emboux.com", "status": "ok"}
]
}

Each record has a status of ok, missing, or incorrect.


PUT /domains/{domain_name}/owner

Reassign a domain to a different tenant. The endpoint atomically updates the domain’s partner_ref and adjusts the domains_used counter on both the previous and the new owner’s API keys.

Master token only.

FieldTypeRequiredDescription
partner_refstring | nullYesThe new owner’s partner_ref. Pass null to unassign (orphan) the domain.
  • Reassign (partner_ref: "P_new") — the API validates that at least one active API key exists for P_new (refusing with 400 otherwise so domains can’t be silently orphaned into a non-existent tenant). The previous owner’s domains_used is decremented and the new owner’s is incremented.
  • Unassign (partner_ref: null) — only the previous owner’s counter goes down; no new partner is credited.
  • No-op (target equals current owner) — no counters move; the response echoes current state.
Terminal window
curl -X PUT https://api.emboux.com/domains/client.example.com/owner \
-H "Authorization: Bearer MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"partner_ref": "partner_42"}'
{
"name": "client.example.com",
"partner_ref": "partner_42",
"previous_partner_ref": "partner_17"
}
StatusDetail
400No active api_key for partner_ref={value}
403Master token required
404Domain not found

PUT /domains/{name}/suspend and PUT /domains/{name}/activate toggle the suspended flag on a domain. Suspended domains reject inbound mail at Postfix/Dovecot.

Terminal window
curl -X PUT https://api.emboux.com/domains/client.example.com/activate \
-H "Authorization: Bearer YOUR_API_KEY"
{
"name": "client.example.com",
"suspended": false,
"message": "Domain activated"
}