curl -X POST "https://api.deliveryman.ai/api/v2/send/" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "draftss.com",
"to": "alex@draftss.com",
"subject": "Quick question about your onboarding flow",
"html_content": "<p>Hi Alex, do you have 15 minutes this week?</p>",
"open_tracking": true,
"click_tracking": true,
"reply_to_message_id": "em_9f2c4a7b1e0d3c5a8b6f4e21"
}'import requests
url = "https://api.deliveryman.ai/api/v2/send/"
payload = {
"from": "<string>",
"to": "jsmith@example.com",
"subject": "<string>",
"html_content": "<string>",
"plain_text_content": "<string>",
"open_tracking": False,
"click_tracking": True,
"reply_to_message_id": "<string>"
}
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({
from: '<string>',
to: 'jsmith@example.com',
subject: '<string>',
html_content: '<string>',
plain_text_content: '<string>',
open_tracking: false,
click_tracking: true,
reply_to_message_id: '<string>'
})
};
fetch('https://api.deliveryman.ai/api/v2/send/', 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/v2/send/",
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([
'from' => '<string>',
'to' => 'jsmith@example.com',
'subject' => '<string>',
'html_content' => '<string>',
'plain_text_content' => '<string>',
'open_tracking' => false,
'click_tracking' => true,
'reply_to_message_id' => '<string>'
]),
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/v2/send/"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\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/v2/send/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryman.ai/api/v2/send/")
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 \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"from": "<string>",
"message_id": "<string>",
"to": "<string>",
"status": "queued",
"subject": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"sent_on": "2023-11-07T05:31:56Z"
}{
"from": "<string>",
"message_id": "<string>",
"to": "<string>",
"status": "queued",
"subject": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"sent_on": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Send Email
Sends a single email from one of your connected domains and returns its message_id.
from can be a full email address or just a domain. With a domain, one of the domain’s email accounts is picked for you. The domain must be connected to your account, set up, and past its initial warmup period.
Each email uses 1 credit from the sending workspace. Emails to addresses on your suppression list, or that have previously hard bounced, are rejected with 422.
Use the returned message_id to fetch the email with Retrieve Sent Email, to match webhook events, and as reply_to_message_id to continue the conversation. It’s also sent with the email in the X-Deliveryman-Message-Id header.
Every email includes one-click unsubscribe headers. Unsubscribes are added to your suppression list and sent to your webhook as unsubscribe events.
Strongly recommended: leave 5 to 10 minutes between emails sent from the same domain. Sending many emails from one domain in a short time can hurt your domain and IP reputation.
Send pacing: emails from one sending domain go out at least a minimum interval apart. If you send before that interval has passed, the email is queued instead of rejected. The response has status 202, status: "scheduled" and the time it will go out in scheduled_for. You get a sent webhook when it goes out, or check it with Retrieve Sent Email. A scheduled email can’t be replied to until it’s been sent. If it can’t be sent at all, you get a failed webhook. Each domain’s queue holds a limited number of emails. Once it’s full, requests are rejected with 429.
curl -X POST "https://api.deliveryman.ai/api/v2/send/" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "draftss.com",
"to": "alex@draftss.com",
"subject": "Quick question about your onboarding flow",
"html_content": "<p>Hi Alex, do you have 15 minutes this week?</p>",
"open_tracking": true,
"click_tracking": true,
"reply_to_message_id": "em_9f2c4a7b1e0d3c5a8b6f4e21"
}'import requests
url = "https://api.deliveryman.ai/api/v2/send/"
payload = {
"from": "<string>",
"to": "jsmith@example.com",
"subject": "<string>",
"html_content": "<string>",
"plain_text_content": "<string>",
"open_tracking": False,
"click_tracking": True,
"reply_to_message_id": "<string>"
}
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({
from: '<string>',
to: 'jsmith@example.com',
subject: '<string>',
html_content: '<string>',
plain_text_content: '<string>',
open_tracking: false,
click_tracking: true,
reply_to_message_id: '<string>'
})
};
fetch('https://api.deliveryman.ai/api/v2/send/', 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/v2/send/",
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([
'from' => '<string>',
'to' => 'jsmith@example.com',
'subject' => '<string>',
'html_content' => '<string>',
'plain_text_content' => '<string>',
'open_tracking' => false,
'click_tracking' => true,
'reply_to_message_id' => '<string>'
]),
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/v2/send/"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\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/v2/send/")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deliveryman.ai/api/v2/send/")
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 \"from\": \"<string>\",\n \"to\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"html_content\": \"<string>\",\n \"plain_text_content\": \"<string>\",\n \"open_tracking\": false,\n \"click_tracking\": true,\n \"reply_to_message_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"from": "<string>",
"message_id": "<string>",
"to": "<string>",
"status": "queued",
"subject": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"sent_on": "2023-11-07T05:31:56Z"
}{
"from": "<string>",
"message_id": "<string>",
"to": "<string>",
"status": "queued",
"subject": "<string>",
"scheduled_for": "2023-11-07T05:31:56Z",
"sent_on": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Your API key. In the dashboard, go to Integrations and open Deliveryman API Keys to create one.
Body
Sender. Either a full email address from one of your connected domains (jane@draftss.com), or just the domain (draftss.com), in which case one of the domain's email accounts is picked for you. The domain must be connected to your account and ready to send.
Recipient email address.
Email subject line. Can't be empty.
1 - 998\SHTML body of the email. Provide exactly one of html_content or plain_text_content.
Plain text body of the email. Provide exactly one of html_content or plain_text_content. Open and click tracking are not available for plain text emails.
Track when the recipient opens the email. Only applies to HTML emails. Defaults to false.
Track clicks on links in the email. Only applies to HTML emails. Defaults to true.
Send this email as a reply in an existing conversation. Pass the message_id of an email you sent, or of a reply you received (from Inbox or the reply webhook). The email is threaded under the original conversation in the recipient's mail client, and its replies show up in the same Inbox thread.
40Response
Email Sent
The email that was sent or scheduled.
Email account the email was sent from. When from was a domain, this is the account picked.
Unique ID of the email, available as soon as it's accepted, including while it's scheduled. Use it to look the email up with Retrieve Sent Email, to match webhook events, and as reply_to_message_id to reply in the same conversation. It's also sent with the email in the X-Deliveryman-Message-Id header.
Recipient email address.
queued: handed to the mail server now (HTTP 201). scheduled: your sending domain's send interval hasn't passed yet, so the email waits in a queue and goes out at scheduled_for (HTTP 202).
queued- queuedscheduled- scheduled
queued, scheduled Subject line of the email.
When a scheduled email will be handed to the mail server, or null if it was sent right away. ISO 8601, UTC.
When the recipient's mail server accepted the email. Null until delivery is confirmed. ISO 8601, UTC.