curl --request POST \
--url https://api.sendx.io/api/v1/rest/send/email \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"from": {
"email": "from@example.com",
"name": "From Name"
},
"to": [
{
"email": "to@example.com",
"name": "To Name",
"customFields": {}
}
],
"subject": "Your Subject Here",
"htmlBody": "<h1>Your HTML Content</h1>",
"textBody": "Your Text Content",
"headers": {
"X-Custom-Header": "Value"
}
}
'import requests
url = "https://api.sendx.io/api/v1/rest/send/email"
payload = {
"from": {
"email": "from@example.com",
"name": "From Name"
},
"to": [
{
"email": "to@example.com",
"name": "To Name",
"customFields": {}
}
],
"subject": "Your Subject Here",
"htmlBody": "<h1>Your HTML Content</h1>",
"textBody": "Your Text Content",
"headers": { "X-Custom-Header": "Value" }
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: {email: 'from@example.com', name: 'From Name'},
to: [{email: 'to@example.com', name: 'To Name', customFields: {}}],
subject: 'Your Subject Here',
htmlBody: '<h1>Your HTML Content</h1>',
textBody: 'Your Text Content',
headers: {'X-Custom-Header': 'Value'}
})
};
fetch('https://api.sendx.io/api/v1/rest/send/email', 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.sendx.io/api/v1/rest/send/email",
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' => [
'email' => 'from@example.com',
'name' => 'From Name'
],
'to' => [
[
'email' => 'to@example.com',
'name' => 'To Name',
'customFields' => [
]
]
],
'subject' => 'Your Subject Here',
'htmlBody' => '<h1>Your HTML Content</h1>',
'textBody' => 'Your Text Content',
'headers' => [
'X-Custom-Header' => 'Value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <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.sendx.io/api/v1/rest/send/email"
payload := strings.NewReader("{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<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.sendx.io/api/v1/rest/send/email")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/send/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Email queued for delivery"
}Send transactional email
Sends transactional emails to specified recipients with support for personalization, attachments, and tracking.
The API validates the request synchronously and returns 202 Accepted when the email is queued. Actual sending and personalization happen asynchronously in a worker. A 202 does not guarantee delivery; it means the request was accepted and queued. Per-recipient success/failure is not returned in the API response.
Optional headers: List-Unsubscribe (passed through for list-unsubscribe), X-SendPost-Mock-Email: true (mock send, if supported).
curl --request POST \
--url https://api.sendx.io/api/v1/rest/send/email \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '
{
"from": {
"email": "from@example.com",
"name": "From Name"
},
"to": [
{
"email": "to@example.com",
"name": "To Name",
"customFields": {}
}
],
"subject": "Your Subject Here",
"htmlBody": "<h1>Your HTML Content</h1>",
"textBody": "Your Text Content",
"headers": {
"X-Custom-Header": "Value"
}
}
'import requests
url = "https://api.sendx.io/api/v1/rest/send/email"
payload = {
"from": {
"email": "from@example.com",
"name": "From Name"
},
"to": [
{
"email": "to@example.com",
"name": "To Name",
"customFields": {}
}
],
"subject": "Your Subject Here",
"htmlBody": "<h1>Your HTML Content</h1>",
"textBody": "Your Text Content",
"headers": { "X-Custom-Header": "Value" }
}
headers = {
"X-Team-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Team-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: {email: 'from@example.com', name: 'From Name'},
to: [{email: 'to@example.com', name: 'To Name', customFields: {}}],
subject: 'Your Subject Here',
htmlBody: '<h1>Your HTML Content</h1>',
textBody: 'Your Text Content',
headers: {'X-Custom-Header': 'Value'}
})
};
fetch('https://api.sendx.io/api/v1/rest/send/email', 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.sendx.io/api/v1/rest/send/email",
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' => [
'email' => 'from@example.com',
'name' => 'From Name'
],
'to' => [
[
'email' => 'to@example.com',
'name' => 'To Name',
'customFields' => [
]
]
],
'subject' => 'Your Subject Here',
'htmlBody' => '<h1>Your HTML Content</h1>',
'textBody' => 'Your Text Content',
'headers' => [
'X-Custom-Header' => 'Value'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Team-ApiKey: <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.sendx.io/api/v1/rest/send/email"
payload := strings.NewReader("{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Team-ApiKey", "<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.sendx.io/api/v1/rest/send/email")
.header("X-Team-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendx.io/api/v1/rest/send/email")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Team-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": {\n \"email\": \"from@example.com\",\n \"name\": \"From Name\"\n },\n \"to\": [\n {\n \"email\": \"to@example.com\",\n \"name\": \"To Name\",\n \"customFields\": {}\n }\n ],\n \"subject\": \"Your Subject Here\",\n \"htmlBody\": \"<h1>Your HTML Content</h1>\",\n \"textBody\": \"Your Text Content\",\n \"headers\": {\n \"X-Custom-Header\": \"Value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Email queued for delivery"
}- Send to multiple recipients with CC/BCC support
- HTML, plain text, and AMP content
- Custom headers and tracking options
- Webhook notifications for delivery events
- Account-based email sending limits apply
Authorizations
Team API key for authentication. Find your API key in SendX Settings → Team API Key.
Example:
X-Team-ApiKey: your_team_api_key_here
Body
Show child attributes
Show child attributes
1Show child attributes
Show child attributes
"Your Subject Here"
"<h1>Your HTML Content</h1>"
Show child attributes
Show child attributes
"Your Text Content"
Custom headers can be added to the email. These will be passed on when receving webhooks events for this email.
Show child attributes
Show child attributes
{ "X-Custom-Header": "Value" }
Was this page helpful?