Emails
Send an email
Creates and immediately sends an email to a contact in a single step. The sender (from) is resolved to a connected email account.
POST
/
emails
/
send
Send an email
curl --request POST \
--url https://api.seamless.ai/api/client/v2/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contactId": 12345,
"from": "rep@acme.com",
"to": "prospect@example.com",
"subject": "Quick question about your team",
"body": "Hi there, I wanted to reach out...",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"templateId": 678
}
'import requests
url = "https://api.seamless.ai/api/client/v2/emails/send"
payload = {
"contactId": 12345,
"from": "rep@acme.com",
"to": "prospect@example.com",
"subject": "Quick question about your team",
"body": "Hi there, I wanted to reach out...",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"templateId": 678
}
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({
contactId: 12345,
from: 'rep@acme.com',
to: 'prospect@example.com',
subject: 'Quick question about your team',
body: JSON.stringify('Hi there, I wanted to reach out...'),
cc: 'manager@example.com',
bcc: 'archive@acme.com',
templateId: 678
})
};
fetch('https://api.seamless.ai/api/client/v2/emails/send', 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/send",
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([
'contactId' => 12345,
'from' => 'rep@acme.com',
'to' => 'prospect@example.com',
'subject' => 'Quick question about your team',
'body' => 'Hi there, I wanted to reach out...',
'cc' => 'manager@example.com',
'bcc' => 'archive@acme.com',
'templateId' => 678
]),
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/send"
payload := strings.NewReader("{\n \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\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/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/emails/send")
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 \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"emailId": "90001",
"contactId": "12345",
"from": "rep@acme.com",
"to": "prospect@example.com",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"subject": "Quick question about your team",
"body": "<string>",
"status": "SCHEDULED",
"scheduledAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"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
ID of the contact to send the email to.
Example:
12345
Sender email address. Must match a connected email account on the user.
Example:
"rep@acme.com"
Recipient email address.
Example:
"prospect@example.com"
Email subject line.
Example:
"Quick question about your team"
Email body content (HTML or plain text).
Example:
"Hi there, I wanted to reach out..."
CC recipient email address(es).
Example:
"manager@example.com"
BCC recipient email address(es).
Example:
"archive@acme.com"
ID of an email template to apply before sending.
Example:
678
Was this page helpful?
⌘I
Send an email
curl --request POST \
--url https://api.seamless.ai/api/client/v2/emails/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contactId": 12345,
"from": "rep@acme.com",
"to": "prospect@example.com",
"subject": "Quick question about your team",
"body": "Hi there, I wanted to reach out...",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"templateId": 678
}
'import requests
url = "https://api.seamless.ai/api/client/v2/emails/send"
payload = {
"contactId": 12345,
"from": "rep@acme.com",
"to": "prospect@example.com",
"subject": "Quick question about your team",
"body": "Hi there, I wanted to reach out...",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"templateId": 678
}
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({
contactId: 12345,
from: 'rep@acme.com',
to: 'prospect@example.com',
subject: 'Quick question about your team',
body: JSON.stringify('Hi there, I wanted to reach out...'),
cc: 'manager@example.com',
bcc: 'archive@acme.com',
templateId: 678
})
};
fetch('https://api.seamless.ai/api/client/v2/emails/send', 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/send",
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([
'contactId' => 12345,
'from' => 'rep@acme.com',
'to' => 'prospect@example.com',
'subject' => 'Quick question about your team',
'body' => 'Hi there, I wanted to reach out...',
'cc' => 'manager@example.com',
'bcc' => 'archive@acme.com',
'templateId' => 678
]),
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/send"
payload := strings.NewReader("{\n \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\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/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.seamless.ai/api/client/v2/emails/send")
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 \"contactId\": 12345,\n \"from\": \"rep@acme.com\",\n \"to\": \"prospect@example.com\",\n \"subject\": \"Quick question about your team\",\n \"body\": \"Hi there, I wanted to reach out...\",\n \"cc\": \"manager@example.com\",\n \"bcc\": \"archive@acme.com\",\n \"templateId\": 678\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"emailId": "90001",
"contactId": "12345",
"from": "rep@acme.com",
"to": "prospect@example.com",
"cc": "manager@example.com",
"bcc": "archive@acme.com",
"subject": "Quick question about your team",
"body": "<string>",
"status": "SCHEDULED",
"scheduledAt": "2023-11-07T05:31:56Z",
"sentAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}