curl --request POST \
--url https://app.pixie.ai/api/email/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://app.pixie.ai/api/email/domains"
payload = { "domain": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://app.pixie.ai/api/email/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pixie.ai/api/email/domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/email/domains"
payload := strings.NewReader("{\n \"domain\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/email/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/email/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"domain": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "<string>",
"agentmail_domain_id": "<string>",
"status": "pending",
"dns_records": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123
}
],
"verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Create Sending Domain
Register a new custom sending domain and auto-sync DKIM/SPF/DMARC records when possible.
curl --request POST \
--url https://app.pixie.ai/api/email/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "<string>"
}
'import requests
url = "https://app.pixie.ai/api/email/domains"
payload = { "domain": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: '<string>'})
};
fetch('https://app.pixie.ai/api/email/domains', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.pixie.ai/api/email/domains",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'domain' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.pixie.ai/api/email/domains"
payload := strings.NewReader("{\n \"domain\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.pixie.ai/api/email/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.pixie.ai/api/email/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"domain": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "<string>",
"agentmail_domain_id": "<string>",
"status": "pending",
"dns_records": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>",
"priority": 123
}
],
"verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}pixie email domain create --domain <domain>
Overview
Registers a new custom domain, auto-syncs the DKIM/SPF/DMARC records when Pixie can manage the DNS zone, triggers verification, and schedules thedomain-verify-poller background task to converge status as DNS propagates.
Sending domains unlock creating email inboxes under that domain via createEmailAccount. Until a domain is verified, no inboxes can be provisioned on it.
/api/email/domains with the list verb. See List sending domains to enumerate domains already registered.AI agent notes
createEmailDomain— Pixie receives DKIM/SPF/DMARC records; if managed DNS is available for the zone, records are written automatically and verification is triggered.- If DNS auto-sync was skipped,
statusstayspending— the user must add the DNS records manually, then callverifyEmailDomain(no?poll=true) once. - The
domain-verify-pollerbackground task re-checks the live domain status on an exponential-backoff schedule (10m, 20m, 40m, 80m, 160m, 320m) for up to 12 hours.
verified the domain, you get a 409.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Only domain is accepted. The handler provisions the domain, auto-syncs the DKIM/SPF/DMARC records when the zone is managed by Pixie, triggers verification if DNS was synced, and schedules the domain-verify-poller background task to converge status.
Apex domain or subdomain to register. Lowercased server-side. Must be a valid domain name.
Response
Domain created. status is verified if DNS was already in place, verifying if the poller has been scheduled, or pending if DNS auto-sync failed and the user must add records manually.
A custom sending domain. Domains are provisioned with backing mail infrastructure, optionally auto-synced to managed DNS, and then polled via the domain-verify-poller background task until DNS propagation is confirmed.
Show child attributes
Show child attributes
Was this page helpful?