SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const message = await cloud.email.sendMessage({
idempotencyKey: "email-attempt-123",
...{
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}
});curl --request POST \
--url https://api.voyant.travel/email/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: email-attempt-123' \
--header 'Content-Type: application/json' \
--data '{
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}'const response = await fetch("https://api.voyant.travel/email/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>",
"Idempotency-Key": "email-attempt-123"
},
body: JSON.stringify({
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/email/v1/messages",
headers={
"Authorization": "Bearer <token>",
"Idempotency-Key": "email-attempt-123"
},
json={
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/email/v1/messages",
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' => 'noreply@updates.example.com',
'to' => [
'jsmith@example.com'
],
'subject' => '<string>',
'cc' => [
'jsmith@example.com'
],
'bcc' => [
'jsmith@example.com'
],
'replyTo' => [
'jsmith@example.com'
],
'html' => '<string>',
'text' => '<string>',
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'path' => '<string>',
'contentType' => '<string>',
'contentId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.voyant.travel/email/v1/messages"
payload := strings.NewReader("{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.voyant.travel/email/v1/messages")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/email/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"protocolVersion": "voyant-cloud-email-idempotency/v1",
"operationId": "<string>",
"backendIdentity": "<string>",
"accountIdentity": "<string>",
"acceptedCount": 1,
"message": {
"id": "<string>",
"organizationId": "<string>",
"fromAddress": "<string>",
"toAddresses": [
"<string>"
],
"subject": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"ccAddresses": [
"<string>"
],
"bccAddresses": [
"<string>"
],
"replyTo": [
"<string>"
],
"openCount": 123,
"clickCount": 123,
"providerEmailId": "<string>",
"providerStatus": "<string>",
"errorMessage": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"lastEventAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Email
Send an email
Sends a transactional email through the durable organization-scoped idempotency ledger. Exact retries return the persisted canonical result; payload drift returns 409. Each attachment must include exactly one of content (base64) or path (URL). Requires scope: emails:send
POST
/
email
/
v1
/
messages
SDK
import { createVoyantCloudClient } from "@voyant-travel/cloud-sdk";
const cloud = createVoyantCloudClient({ apiKey: process.env.VOYANT_API_KEY });
const message = await cloud.email.sendMessage({
idempotencyKey: "email-attempt-123",
...{
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}
});curl --request POST \
--url https://api.voyant.travel/email/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: email-attempt-123' \
--header 'Content-Type: application/json' \
--data '{
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}'const response = await fetch("https://api.voyant.travel/email/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <token>",
"Idempotency-Key": "email-attempt-123"
},
body: JSON.stringify({
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}),
});
const data = await response.json();import requests
response = requests.post(
"https://api.voyant.travel/email/v1/messages",
headers={
"Authorization": "Bearer <token>",
"Idempotency-Key": "email-attempt-123"
},
json={
"from": "noreply@updates.example.com",
"to": [
"<string>"
],
"cc": "<string>",
"bcc": "<string>",
"replyTo": "<string>",
"subject": "<string>",
"html": "<string>",
"text": "<string>",
"attachments": "<string>"
}
)
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voyant.travel/email/v1/messages",
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' => 'noreply@updates.example.com',
'to' => [
'jsmith@example.com'
],
'subject' => '<string>',
'cc' => [
'jsmith@example.com'
],
'bcc' => [
'jsmith@example.com'
],
'replyTo' => [
'jsmith@example.com'
],
'html' => '<string>',
'text' => '<string>',
'attachments' => [
[
'filename' => '<string>',
'content' => '<string>',
'path' => '<string>',
'contentType' => '<string>',
'contentId' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-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.voyant.travel/email/v1/messages"
payload := strings.NewReader("{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.voyant.travel/email/v1/messages")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voyant.travel/email/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"noreply@updates.example.com\",\n \"to\": [\n \"jsmith@example.com\"\n ],\n \"subject\": \"<string>\",\n \"cc\": [\n \"jsmith@example.com\"\n ],\n \"bcc\": [\n \"jsmith@example.com\"\n ],\n \"replyTo\": [\n \"jsmith@example.com\"\n ],\n \"html\": \"<string>\",\n \"text\": \"<string>\",\n \"attachments\": [\n {\n \"filename\": \"<string>\",\n \"content\": \"<string>\",\n \"path\": \"<string>\",\n \"contentType\": \"<string>\",\n \"contentId\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"protocolVersion": "voyant-cloud-email-idempotency/v1",
"operationId": "<string>",
"backendIdentity": "<string>",
"accountIdentity": "<string>",
"acceptedCount": 1,
"message": {
"id": "<string>",
"organizationId": "<string>",
"fromAddress": "<string>",
"toAddresses": [
"<string>"
],
"subject": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"ccAddresses": [
"<string>"
],
"bccAddresses": [
"<string>"
],
"replyTo": [
"<string>"
],
"openCount": 123,
"clickCount": 123,
"providerEmailId": "<string>",
"providerStatus": "<string>",
"errorMessage": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"lastEventAt": "2023-11-07T05:31:56Z"
}
}
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"retryAfterMs": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Voyant Cloud API token, passed as Authorization: Bearer <token>. Each token carries a fixed set of scopes; an operation rejects tokens missing its required scope.
Headers
Required string length:
1 - 256Body
application/json
Required string length:
3 - 320Example:
"noreply@updates.example.com"
Required array length:
1 - 50 elementsRequired string length:
1 - 998Maximum array length:
50Maximum array length:
50Maximum array length:
5Maximum string length:
1000000Maximum string length:
1000000Maximum array length:
20Show child attributes
Show child attributes
Response
Email queued
Show child attributes
Show child attributes
⌘I