Send an email to an address
curl --request POST \
--url https://api.salescaptain.com/v1/send-email/{company_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_email": "[email protected]",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"subject": "Your appointment is confirmed",
"message_body": "Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!",
"contact_name": "John Smith"
}
'import requests
url = "https://api.salescaptain.com/v1/send-email/{company_id}"
payload = {
"to_email": "[email protected]",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"subject": "Your appointment is confirmed",
"message_body": "Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!",
"contact_name": "John Smith"
}
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_email: '[email protected]',
conversation_profile_id: 'c3d4e5f6-a7b8-9012-cdef-123456789012',
subject: 'Your appointment is confirmed',
message_body: 'Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!',
contact_name: 'John Smith'
})
};
fetch('https://api.salescaptain.com/v1/send-email/{company_id}', 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.salescaptain.com/v1/send-email/{company_id}",
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_email' => '[email protected]',
'conversation_profile_id' => 'c3d4e5f6-a7b8-9012-cdef-123456789012',
'subject' => 'Your appointment is confirmed',
'message_body' => 'Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!',
'contact_name' => 'John Smith'
]),
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.salescaptain.com/v1/send-email/{company_id}"
payload := strings.NewReader("{\n \"to_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\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.salescaptain.com/v1/send-email/{company_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/send-email/{company_id}")
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_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Email sent successfully!",
"data": {
"contact_id": "e5f6a7b8-c9d0-1234-ef12-345678901234",
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"from_email": "[email protected]",
"to_email": "[email protected]",
"message": {}
}
}Messages
Send email
Sends an email to an email address from the email connected to the conversation profile you choose.
- If no contact exists for
to_email, a contact is created. - If the contact has no conversation on the chosen conversation profile yet, one is created.
- The email is sent through the profile’s connected mailbox (Gmail / Outlook) or SalesCaptain’s mail delivery, and is threaded into the conversation like any inbox email.
message_body may contain HTML; plain-text line breaks are converted to <br/>.
The conversation profile must have an email address configured (see /v1/list-conversation-profiles/{company_id}).
Subject to the company’s hourly and per-minute email limits.
account_id is resolved from the authenticated user’s account that matches company_id.
POST
/
v1
/
send-email
/
{company_id}
Send an email to an address
curl --request POST \
--url https://api.salescaptain.com/v1/send-email/{company_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to_email": "[email protected]",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"subject": "Your appointment is confirmed",
"message_body": "Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!",
"contact_name": "John Smith"
}
'import requests
url = "https://api.salescaptain.com/v1/send-email/{company_id}"
payload = {
"to_email": "[email protected]",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"subject": "Your appointment is confirmed",
"message_body": "Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!",
"contact_name": "John Smith"
}
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_email: '[email protected]',
conversation_profile_id: 'c3d4e5f6-a7b8-9012-cdef-123456789012',
subject: 'Your appointment is confirmed',
message_body: 'Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!',
contact_name: 'John Smith'
})
};
fetch('https://api.salescaptain.com/v1/send-email/{company_id}', 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.salescaptain.com/v1/send-email/{company_id}",
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_email' => '[email protected]',
'conversation_profile_id' => 'c3d4e5f6-a7b8-9012-cdef-123456789012',
'subject' => 'Your appointment is confirmed',
'message_body' => 'Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!',
'contact_name' => 'John Smith'
]),
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.salescaptain.com/v1/send-email/{company_id}"
payload := strings.NewReader("{\n \"to_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\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.salescaptain.com/v1/send-email/{company_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/send-email/{company_id}")
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_email\": \"[email protected]\",\n \"conversation_profile_id\": \"c3d4e5f6-a7b8-9012-cdef-123456789012\",\n \"subject\": \"Your appointment is confirmed\",\n \"message_body\": \"Hi John,<br/>Your appointment is confirmed for Friday at 10 AM.<br/>Thanks!\",\n \"contact_name\": \"John Smith\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Email sent successfully!",
"data": {
"contact_id": "e5f6a7b8-c9d0-1234-ef12-345678901234",
"conversation_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"conversation_profile_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"from_email": "[email protected]",
"to_email": "[email protected]",
"message": {}
}
}Authorizations
Path Parameters
Body
application/json
Recipient email address
Example:

