Emails
Send an email preview
Sends a preview/test copy of an email to the specified address without recording it as a contact engagement. If a from address is provided it is resolved to a connected email account; otherwise the user’s default account is used.
POST
/
emails
/
preview
Send an email preview
curl --request POST \
--url https://api.seamless.ai/api/client/v2/emails/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "rep@acme.com",
"subject": "Preview - Quick question",
"body": "Hi there, I wanted to reach out...",
"templateId": 678,
"from": "rep@acme.com"
}
'import requests
url = "https://api.seamless.ai/api/client/v2/emails/preview"
payload = {
"to": "rep@acme.com",
"subject": "Preview - Quick question",
"body": "Hi there, I wanted to reach out...",
"templateId": 678,
"from": "rep@acme.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: 'rep@acme.com',
subject: 'Preview - Quick question',
body: JSON.stringify('Hi there, I wanted to reach out...'),
templateId: 678,
from: 'rep@acme.com'
})
};
fetch('https://api.seamless.ai/api/client/v2/emails/preview', 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.seamless.ai/api/client/v2/emails/preview",
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' => 'rep@acme.com',
'subject' => 'Preview - Quick question',
'body' => 'Hi there, I wanted to reach out...',
'templateId' => 678,
'from' => 'rep@acme.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.seamless.ai/api/client/v2/emails/preview"
payload := strings.NewReader("{\n \"to\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\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.seamless.ai/api/client/v2/emails/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/emails/preview")
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\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
OAuth2ApiKeyAuth
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Recipient email address for the preview.
Example:
"rep@acme.com"
Email subject line.
Example:
"Preview - Quick question"
Email body content (HTML or plain text) to preview.
Example:
"Hi there, I wanted to reach out..."
ID of an email template to render in the preview.
Example:
678
Sender email address. Must match a connected email account on the user when provided.
Example:
"rep@acme.com"
Response
Preview email sent
Example:
true
Was this page helpful?
⌘I
Send an email preview
curl --request POST \
--url https://api.seamless.ai/api/client/v2/emails/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "rep@acme.com",
"subject": "Preview - Quick question",
"body": "Hi there, I wanted to reach out...",
"templateId": 678,
"from": "rep@acme.com"
}
'import requests
url = "https://api.seamless.ai/api/client/v2/emails/preview"
payload = {
"to": "rep@acme.com",
"subject": "Preview - Quick question",
"body": "Hi there, I wanted to reach out...",
"templateId": 678,
"from": "rep@acme.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: 'rep@acme.com',
subject: 'Preview - Quick question',
body: JSON.stringify('Hi there, I wanted to reach out...'),
templateId: 678,
from: 'rep@acme.com'
})
};
fetch('https://api.seamless.ai/api/client/v2/emails/preview', 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.seamless.ai/api/client/v2/emails/preview",
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' => 'rep@acme.com',
'subject' => 'Preview - Quick question',
'body' => 'Hi there, I wanted to reach out...',
'templateId' => 678,
'from' => 'rep@acme.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.seamless.ai/api/client/v2/emails/preview"
payload := strings.NewReader("{\n \"to\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\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.seamless.ai/api/client/v2/emails/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/emails/preview")
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\": \"rep@acme.com\",\n \"subject\": \"Preview - Quick question\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"templateId\": 678,\n \"from\": \"rep@acme.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}