curl --request POST \
--url https://api.openmail.sh/v1/inboxes/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"body": "<string>",
"subject": "<string>",
"bodyHtml": "<string>",
"threadId": "<string>",
"includeQuote": true,
"replyTo": "jsmith@example.com",
"cc": [
"jsmith@example.com"
],
"bcc": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.openmail.sh/v1/inboxes/{id}/send"
payload = {
"to": "jsmith@example.com",
"body": "<string>",
"subject": "<string>",
"bodyHtml": "<string>",
"threadId": "<string>",
"includeQuote": True,
"replyTo": "jsmith@example.com",
"cc": ["jsmith@example.com"],
"bcc": ["jsmith@example.com"]
}
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({
to: 'jsmith@example.com',
body: JSON.stringify('<string>'),
subject: '<string>',
bodyHtml: '<string>',
threadId: '<string>',
includeQuote: true,
replyTo: 'jsmith@example.com',
cc: ['jsmith@example.com'],
bcc: ['jsmith@example.com']
})
};
fetch('https://api.openmail.sh/v1/inboxes/{id}/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.openmail.sh/v1/inboxes/{id}/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([
'to' => 'jsmith@example.com',
'body' => '<string>',
'subject' => '<string>',
'bodyHtml' => '<string>',
'threadId' => '<string>',
'includeQuote' => true,
'replyTo' => 'jsmith@example.com',
'cc' => [
'jsmith@example.com'
],
'bcc' => [
'jsmith@example.com'
]
]),
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://api.openmail.sh/v1/inboxes/{id}/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\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://api.openmail.sh/v1/inboxes/{id}/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/inboxes/{id}/send")
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 \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"messageId": "<string>",
"threadId": "<string>",
"providerMessageId": "<string>",
"status": "pending"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Send email
Send an email from an inbox. Optionally pass an Idempotency-Key header to make retries safe: a repeat with the same key within 24 hours returns the original message instead of sending again. Without it the API generates a key and sends once. Use threadId to reply to an existing thread. When replying on a thread where your inbox was CC’d (deliveryRole cc), the original sender is automatically CC’d.
Every recipient this call can reach — to, cc (including any address auto-CC’d on a thread reply), bcc, and replyTo — is checked against the inbox’s outbound correspondent policy before anything is sent. A single denied recipient rejects the whole send with 403 recipient_not_permitted; there is no partial delivery.
bcc recipients are delivered and stored on the outbound message, but they are not listed on the copy To and Cc recipients receive. An address already in to or cc is not also blind-copied.
curl --request POST \
--url https://api.openmail.sh/v1/inboxes/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"body": "<string>",
"subject": "<string>",
"bodyHtml": "<string>",
"threadId": "<string>",
"includeQuote": true,
"replyTo": "jsmith@example.com",
"cc": [
"jsmith@example.com"
],
"bcc": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.openmail.sh/v1/inboxes/{id}/send"
payload = {
"to": "jsmith@example.com",
"body": "<string>",
"subject": "<string>",
"bodyHtml": "<string>",
"threadId": "<string>",
"includeQuote": True,
"replyTo": "jsmith@example.com",
"cc": ["jsmith@example.com"],
"bcc": ["jsmith@example.com"]
}
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({
to: 'jsmith@example.com',
body: JSON.stringify('<string>'),
subject: '<string>',
bodyHtml: '<string>',
threadId: '<string>',
includeQuote: true,
replyTo: 'jsmith@example.com',
cc: ['jsmith@example.com'],
bcc: ['jsmith@example.com']
})
};
fetch('https://api.openmail.sh/v1/inboxes/{id}/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.openmail.sh/v1/inboxes/{id}/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([
'to' => 'jsmith@example.com',
'body' => '<string>',
'subject' => '<string>',
'bodyHtml' => '<string>',
'threadId' => '<string>',
'includeQuote' => true,
'replyTo' => 'jsmith@example.com',
'cc' => [
'jsmith@example.com'
],
'bcc' => [
'jsmith@example.com'
]
]),
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://api.openmail.sh/v1/inboxes/{id}/send"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\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://api.openmail.sh/v1/inboxes/{id}/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openmail.sh/v1/inboxes/{id}/send")
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 \"to\": \"jsmith@example.com\",\n \"body\": \"<string>\",\n \"subject\": \"<string>\",\n \"bodyHtml\": \"<string>\",\n \"threadId\": \"<string>\",\n \"includeQuote\": true,\n \"replyTo\": \"jsmith@example.com\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"messageId": "<string>",
"threadId": "<string>",
"providerMessageId": "<string>",
"status": "pending"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional. Unique key (e.g. UUID) that makes retries safe: a repeat with the same key within 24 hours returns the original message instead of sending again. Generated server-side when omitted.
Path Parameters
Body
Email body. Plain text or HTML — HTML is auto-detected and rendered, with a plain-text fallback generated automatically.
1 - 100000Required for new threads. Optional when threadId is set — the thread subject is used automatically (with Re: prefix).
1 - 998Provide only when the plain-text and HTML versions must differ. Omit for normal sends — put HTML in body instead.
500000Thread ID for replies
When replying with threadId, append a quoted copy of the previous message to the body. Defaults to true. Set false to send only your reply text.
Optional. Address that replies should be routed to (set as the Reply-To MIME header). Free plan: must be the address of an inbox you own in OpenMail. Pro plan or higher: any valid email address.
Optional CC recipients. Visible to every recipient.
Optional BCC recipients. Delivered, but omitted from the message To and Cc recipients can read. Use this for CRM logging addresses (for example HubSpot or Salesforce) that only record the email when they are in BCC. Checked against the inbox's outbound recipient policy, same as to and cc.
Was this page helpful?