Domains
Register a custom domain
Returns the DNS records you need to set at your registrar. Domain starts in pending status until you call the verify endpoint.
Domains that already get mail elsewhere (Google Workspace, Microsoft 365). If the domain has MX records at another provider and you pass neither sharedWith nor replaceMailProvider, the call returns 422 DOMAIN_HAS_MAIL_PROVIDER with detectedProvider, mx and a fix string, because pointing the MX at Anjal would cut off that mail. You then have three options:
- Keep the provider (sharedWith: "google" | "microsoft" | "other"). No MX record is returned: the provider stays the main mail server. The SPF TXT record is merged into the domain's existing SPF (its note says to replace the existing record, since a domain may have only one). Anjal's DMARC record is only included if the domain has none. The response includes routingSteps for the provider's admin console: for Google, a Default routing rule that sends mail for non-recognized addresses to the Anjal host; for Microsoft, setting the Accepted domain to Internal relay plus an outbound connector to the Anjal smart host. In this setup the provider forwards mail for addresses it doesn't know, so it keeps its own users and Anjal receives mail only for addresses the provider doesn't have.
- Use a subdomain such as agents.example.com, which has no MX yet and can point at Anjal without touching the main domain's mail.
- Move all mail to Anjal (replaceMailProvider: true). The MX record returned replaces the current provider's.
post/v1/domains
Request
- Base URL: https://anjal.app
- URL: https://anjal.app/v1/domains
- Auth: API key in header X-API-Key
Request body
Example request
{
"domain": "mail.example.com"
}Response
Created
Changes
No recorded changes to this operation across all 1 revision of this API.