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": "sales@draftss.com",
"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": "jsmith@example.com",
"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: 'jsmith@example.com',
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' => 'jsmith@example.com',
'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\": \"jsmith@example.com\",\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\": \"jsmith@example.com\",\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\": \"jsmith@example.com\",\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.
Bounce limit: a domain that gets too many bounces in a short time is paused from sending. While it’s paused, requests from it are rejected with 429 and the message says when sending resumes. Emails it had queued fail with a failed webhook.
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": "sales@draftss.com",
"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": "jsmith@example.com",
"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: 'jsmith@example.com',
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' => 'jsmith@example.com',
'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\": \"jsmith@example.com\",\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\": \"jsmith@example.com\",\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\": \"jsmith@example.com\",\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
Body
Address to forward replies to, such as a shared inbox. Replies still come back to the sending account and show up in Inbox and as reply webhooks as usual. A copy of each reply to this email is also forwarded here from the sending account, with Reply-To set to the person who replied.
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.
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.