Add a domain
const url = 'https://api.vaartix.com/domains';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"acme.in"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vaartix.com/domains \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "acme.in" }'Registers a domain and returns the DNS records to publish. Vaartix checks the records
every 10 minutes for 72 hours; call POST /domains/{id}/verify to check immediately.
A domain can belong to one team only. The Free plan allows one domain.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The domain or subdomain you will send from.
Example
acme.inResponses
Section titled “Responses”The domain, with its DNS records.
object
3 DKIM CNAMEs, the MAIL FROM MX and SPF TXT, and a recommended DMARC TXT.
object
MX records only.
Not set for the recommended DMARC record.
Example
{ "id": "dom_5bvatg1v837anztd", "name": "acme.in", "status": "pending", "region": "ap-south-1", "records": [ { "type": "CNAME", "name": "send.acme.in", "value": "feedback-smtp.ap-south-1.amazonses.com", "status": "pending" } ]}validation_error: the request is invalid. The message says which field and why.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error", "message": "to: \"priya@\" is not a valid email address." }}unauthorized: the API key is missing, invalid or revoked.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}forbidden: your plan does not allow more domains, or the key is send-only.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}conflict: the domain is already registered with Vaartix.
object
object
Stable, machine-readable error type.
Human-readable explanation, safe to show to developers.
Example
{ "error": { "type": "validation_error" }}