curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"email": "test@example.com",
"first_name": "John",
"last_name": "Doe"
}
]
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview"
payload = { "recipients": [
{
"email": "test@example.com",
"first_name": "John",
"last_name": "Doe"
}
] }
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({
recipients: [{email: 'test@example.com', first_name: 'John', last_name: 'Doe'}]
})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"email\": \"test@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-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([
'recipients' => [
[
'email' => 'test@example.com',
'first_name' => 'John',
'last_name' => 'Doe'
]
]
]),
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.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"email\": \"test@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\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))
}{
"results": [
{
"email": "test@example.com",
"success": true,
"error": "Failed to send preview email"
}
],
"successful": 1,
"failed": 0
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Broadcast not found",
"code": "BROADCAST_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Preview limit reached: a workspace can send 1,000 preview emails an hour. Try again later."
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}Send a broadcast preview
Sends preview emails to specified recipients to verify template rendering, subject line, from name, and reply-to behavior before sending the real broadcast. Each recipient accepts only email, first_name and last_name, and recipients are deduplicated by email. Only draft, scheduled or paused broadcasts can be previewed (400 with code BROADCAST_NOT_PREVIEWABLE otherwise); a suspended workspace gets 403. Does not affect broadcast status or tracking. A refused preview is a 400 with code FROM_DOMAIN_MISMATCH, UNFILLED_PLACEHOLDER, MISSING_UNSUBSCRIBE_URL when the template has no {{unsubscribe_url}} link, and ASSETS_PENDING_MODERATION or ASSETS_REJECTED when an image in it is still being checked or was refused. A 404 names what was deleted or never existed: SUBSCRIBERS_NOT_FOUND, SEGMENT_NOT_FOUND, DOMAIN_NOT_FOUND or TEMPLATE_NOT_FOUND.
Requires one of the following scopes: email_marketing_broadcasts:update, email_marketing_broadcasts:all, all:update, all:all
curl --request POST \
--url https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"email": "test@example.com",
"first_name": "John",
"last_name": "Doe"
}
]
}
'import requests
url = "https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview"
payload = { "recipients": [
{
"email": "test@example.com",
"first_name": "John",
"last_name": "Doe"
}
] }
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({
recipients: [{email: 'test@example.com', first_name: 'John', last_name: 'Doe'}]
})
};
fetch('https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"email\": \"test@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\n ]\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-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([
'recipients' => [
[
'email' => 'test@example.com',
'first_name' => 'John',
'last_name' => 'Doe'
]
]
]),
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.instantly.ai/api/v2/email-marketing/broadcasts/{id}/send-preview"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"email\": \"test@example.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\"\n }\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))
}{
"results": [
{
"email": "test@example.com",
"success": true,
"error": "Failed to send preview email"
}
],
"successful": 1,
"failed": 0
}{
"statusCode": 400,
"error": "Bad Request",
"message": "limit: must be at most 50",
"code": "VALIDATION_ERROR"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "Workspace suspended due to a high bounce or spam complaint rate. Please contact support.",
"code": "WORKSPACE_SUSPENDED"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Broadcast not found",
"code": "BROADCAST_NOT_FOUND"
}{
"statusCode": 408,
"error": "Request Timeout",
"message": "An internal error occurred"
}{
"statusCode": 409,
"error": "Conflict",
"message": "The resource has changed. Reload it and try again.",
"code": "CONFLICT"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Preview limit reached: a workspace can send 1,000 preview emails an hour. Try again later."
}{
"statusCode": 500,
"error": "Internal Server Error",
"message": "An internal error occurred"
}