Add a domain
Add a sending domain.
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.
Headers
Bearer followed by your API key.
Errors
The name is not a valid domain name, 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.
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"
}
]
}