Add a domain
Add a sending domain.
On this page
https://app.usenotix.dev/api/v1/domainsNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Add a sending domain. The response carries the SPF, DKIM and DMARC records to publish at your DNS provider.
Body parameters
The domain to send from, such as mail.example.com. Stored in lower case without a trailing dot.
At most 254 characters.
Usually left out: new domains go to Notix's current default region, and the response's region says which one was used. Choosing another region is open only to some accounts for now; for the rest, any region other than the default answers 400 naming the region that is open. An unknown region answers 400.
At most 32 characters.
The custom return-path (MAIL FROM) label: bounces come back to <label>.<name>, and SPF aligns on it. One DNS label, such as send. Left out (or mail), it is mail.<name>. Set when the domain is added and fixed after; reserved names such as www, inbound, mx and postmaster answer 400. The domain's DNS records name the host to publish.
At most 63 characters.
Use your own tracking domain: one label such as links, so tracked links and the open pixel use https://links.<name>. The answer's trackingDomain.record is the CNAME to add. Left out, tracked links use the shared host. Needs a key made by a team admin.
At most 63 characters.
Headers
Bearer followed by your API key.
Errors
The name is not a valid domain name, the custom return-path is not one allowed DNS label, the tracking subdomain is not one label (or custom tracking domains are not available), the region is unknown, the region is not open to this account (the message names the region that is), or the domain does not exist in public DNS (its registered domain answers NXDOMAIN: check the spelling and that it is registered). A DNS lookup that times out or fails on our side does not refuse the domain.
`trackingSubdomain` was given with a key not made by a current team admin.
The domain can't be added: it is already on Notix. The answer is the same whichever team holds it.
No sending region is available right now, so the domain was not added. Try again in a few minutes.
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/domains" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "mail.example.com"
}'
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.domains.create({ name: "mail.acme.com", region: "eu-west-1" });
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
domain, _ = notix.domains.create({"name": "mail.acme.com", "region": "eu-west-1"})
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$domain = $notix->domains->create(['name' => 'mail.acme.com', 'region' => 'eu-west-1']);
{
"id": 1,
"name": "example.com",
"teamId": 1,
"status": "NOT_STARTED",
"publicKey": "string",
"createdAt": "string",
"updatedAt": "string",
"dnsRecords": [
{
"type": "TXT",
"name": "mail",
"value": "v=spf1 include:_spf.usenotix.dev ~all",
"ttl": "Auto",
"status": "NOT_STARTED"
}
]
}