Send a test email
curl --request POST \
--url https://api.instantly.ai/api/v2/emails/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eaccount": "jondoe@example.com",
"to_address_email_list": "recipient@example.com,recipient2@example.com",
"subject": "Test email subject",
"body": {
"html": "<p>This is a test email</p>"
}
}
'import requests
url = "https://api.instantly.ai/api/v2/emails/test"
payload = {
"eaccount": "jondoe@example.com",
"to_address_email_list": "recipient@example.com,recipient2@example.com",
"subject": "Test email subject",
"body": { "html": "<p>This is a test email</p>" }
}
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({
eaccount: 'jondoe@example.com',
to_address_email_list: 'recipient@example.com,recipient2@example.com',
subject: 'Test email subject',
body: JSON.stringify({html: '<p>This is a test email</p>'})
})
};
fetch('https://api.instantly.ai/api/v2/emails/test', 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/emails/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eaccount\": \"jondoe@example.com\",\n \"to_address_email_list\": \"recipient@example.com,recipient2@example.com\",\n \"subject\": \"Test email subject\",\n \"body\": {\n \"html\": \"<p>This is a test email</p>\"\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/emails/test",
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([
'eaccount' => 'jondoe@example.com',
'to_address_email_list' => 'recipient@example.com,recipient2@example.com',
'subject' => 'Test email subject',
'body' => [
'html' => '<p>This is a test email</p>'
]
]),
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/emails/test"
payload := strings.NewReader("{\n \"eaccount\": \"jondoe@example.com\",\n \"to_address_email_list\": \"recipient@example.com,recipient2@example.com\",\n \"subject\": \"Test email subject\",\n \"body\": {\n \"html\": \"<p>This is a test email</p>\"\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))
}{
"status": "success"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Email
Send a test email
Send a preview/test email without creating an email entity in Unibox. Rate limit: 10 requests per minute per workspace.
Requires one of the following scopes: emails:create, emails:all, all:create, all:all
POST
/
api
/
v2
/
emails
/
test
Send a test email
curl --request POST \
--url https://api.instantly.ai/api/v2/emails/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"eaccount": "jondoe@example.com",
"to_address_email_list": "recipient@example.com,recipient2@example.com",
"subject": "Test email subject",
"body": {
"html": "<p>This is a test email</p>"
}
}
'import requests
url = "https://api.instantly.ai/api/v2/emails/test"
payload = {
"eaccount": "jondoe@example.com",
"to_address_email_list": "recipient@example.com,recipient2@example.com",
"subject": "Test email subject",
"body": { "html": "<p>This is a test email</p>" }
}
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({
eaccount: 'jondoe@example.com',
to_address_email_list: 'recipient@example.com,recipient2@example.com',
subject: 'Test email subject',
body: JSON.stringify({html: '<p>This is a test email</p>'})
})
};
fetch('https://api.instantly.ai/api/v2/emails/test', 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/emails/test")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"eaccount\": \"jondoe@example.com\",\n \"to_address_email_list\": \"recipient@example.com,recipient2@example.com\",\n \"subject\": \"Test email subject\",\n \"body\": {\n \"html\": \"<p>This is a test email</p>\"\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/emails/test",
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([
'eaccount' => 'jondoe@example.com',
'to_address_email_list' => 'recipient@example.com,recipient2@example.com',
'subject' => 'Test email subject',
'body' => [
'html' => '<p>This is a test email</p>'
]
]),
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/emails/test"
payload := strings.NewReader("{\n \"eaccount\": \"jondoe@example.com\",\n \"to_address_email_list\": \"recipient@example.com,recipient2@example.com\",\n \"subject\": \"Test email subject\",\n \"body\": {\n \"html\": \"<p>This is a test email</p>\"\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))
}{
"status": "success"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The email account that will be used to send this email. It has to be an email account connected to your workspace.
Example:
"jondoe@example.com"
Comma-separated list of recipients that will receive the test email.
Example:
"recipient@example.com,recipient2@example.com"
Subject line of the test email.
Example:
"Test email subject"
HTML body of the test email.
Show child attributes
Show child attributes
Response
Default Response
- Option 1
- Option 2
Available options:
success Example:
"success"
⌘I