curl
curl -X POST "https://api.deliveryman.ai/api/v1/domain/" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 12,
"domain": "draftss.com"
}'import requests
url = "https://api.deliveryman.ai/api/v1/domain/"
payload = {
"workspace_id": 123,
"domain": "example.com"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: 123, domain: 'example.com'})
};
fetch('https://api.deliveryman.ai/api/v1/domain/', 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://api.deliveryman.ai/api/v1/domain/",
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([
'workspace_id' => 123,
'domain' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://api.deliveryman.ai/api/v1/domain/"
payload := strings.NewReader("{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://api.deliveryman.ai/api/v1/domain/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryman.ai/api/v1/domain/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"workspace_id": 123,
"domain": "<string>",
"warmup_days_remaining": 123,
"status": "creating",
"nameservers": [
"<string>"
],
"email_account_count": 123,
"created_on": "2023-11-07T05:31:56Z",
"deletion_started_on": "2023-11-07T05:31:56Z",
"setup_complete": true,
"naming_strategy": "random",
"custom_name": "<string>",
"redirect_subdomains_to": "<string>",
"warmup_active_days": 1073741823,
"current_setup_stage": -1,
"domain_usable_from": "2023-11-07T05:31:56Z",
"warmup_running": true,
"is_blocked": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Domains
Add Domain
Adds a domain to a workspace and returns the 2 nameservers you need to add as NS records for it at your DNS provider. Connecting a domain takes 3 steps:
- Add the domain with this request.
- Add the returned
nameserversas NS records at your DNS provider, then callCheck Domain Nameserversuntil itsstateisverified. DNS changes can take a while to propagate. - Call
Start Domain Setupto create the domain’s email accounts. Setup runs in the background;setup_completebecomes true once it’s done and the domain moves into warmup.
Returns 403 if the workspace has reached its domain limit.
POST
/
api
/
v1
/
domain
/
curl
curl -X POST "https://api.deliveryman.ai/api/v1/domain/" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 12,
"domain": "draftss.com"
}'import requests
url = "https://api.deliveryman.ai/api/v1/domain/"
payload = {
"workspace_id": 123,
"domain": "example.com"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspace_id: 123, domain: 'example.com'})
};
fetch('https://api.deliveryman.ai/api/v1/domain/', 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://api.deliveryman.ai/api/v1/domain/",
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([
'workspace_id' => 123,
'domain' => 'example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://api.deliveryman.ai/api/v1/domain/"
payload := strings.NewReader("{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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://api.deliveryman.ai/api/v1/domain/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryman.ai/api/v1/domain/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": 123,\n \"domain\": \"example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"workspace_id": 123,
"domain": "<string>",
"warmup_days_remaining": 123,
"status": "creating",
"nameservers": [
"<string>"
],
"email_account_count": 123,
"created_on": "2023-11-07T05:31:56Z",
"deletion_started_on": "2023-11-07T05:31:56Z",
"setup_complete": true,
"naming_strategy": "random",
"custom_name": "<string>",
"redirect_subdomains_to": "<string>",
"warmup_active_days": 1073741823,
"current_setup_stage": -1,
"domain_usable_from": "2023-11-07T05:31:56Z",
"warmup_running": true,
"is_blocked": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Body
application/json
Response
Domain Added
Current status of the domain. creating while the domain is being set up, warmup once setup is done and
the domain is warming up, active once warmup is complete, deleting while it's being removed, error
if setup or deletion failed, and ns_mismatch if the domain's nameserver records no longer point to us.
Available options:
creating, error, warmup, active, deleting, ns_mismatch