Send an email to the store's people
curl --request POST \
--url https://api.salesive.com/api/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": "customers",
"subject": "Weekend sale starts now",
"title": "20% off everything",
"message": "For this weekend only, use code WEEKEND20 at checkout.",
"actionText": "Shop now",
"actionUrl": "https://mystore.salesive.com"
}
'import requests
url = "https://api.salesive.com/api/v1/emails"
payload = {
"audience": "customers",
"subject": "Weekend sale starts now",
"title": "20% off everything",
"message": "For this weekend only, use code WEEKEND20 at checkout.",
"actionText": "Shop now",
"actionUrl": "https://mystore.salesive.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({
audience: 'customers',
subject: 'Weekend sale starts now',
title: '20% off everything',
message: 'For this weekend only, use code WEEKEND20 at checkout.',
actionText: 'Shop now',
actionUrl: 'https://mystore.salesive.com'
})
};
fetch('https://api.salesive.com/api/v1/emails', 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.salesive.com/api/v1/emails",
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([
'audience' => 'customers',
'subject' => 'Weekend sale starts now',
'title' => '20% off everything',
'message' => 'For this weekend only, use code WEEKEND20 at checkout.',
'actionText' => 'Shop now',
'actionUrl' => 'https://mystore.salesive.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.salesive.com/api/v1/emails"
payload := strings.NewReader("{\n \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.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.salesive.com/api/v1/emails")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/emails")
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 \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Email queued for delivery",
"data": {
"audience": "customers",
"recipients": 342
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}Emails
Send an email to the store's people
Send a templated email to the merchant, the store’s customers, or its subscribers. Requires the SEND_EMAILS scope.
POST
/
emails
Send an email to the store's people
curl --request POST \
--url https://api.salesive.com/api/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience": "customers",
"subject": "Weekend sale starts now",
"title": "20% off everything",
"message": "For this weekend only, use code WEEKEND20 at checkout.",
"actionText": "Shop now",
"actionUrl": "https://mystore.salesive.com"
}
'import requests
url = "https://api.salesive.com/api/v1/emails"
payload = {
"audience": "customers",
"subject": "Weekend sale starts now",
"title": "20% off everything",
"message": "For this weekend only, use code WEEKEND20 at checkout.",
"actionText": "Shop now",
"actionUrl": "https://mystore.salesive.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({
audience: 'customers',
subject: 'Weekend sale starts now',
title: '20% off everything',
message: 'For this weekend only, use code WEEKEND20 at checkout.',
actionText: 'Shop now',
actionUrl: 'https://mystore.salesive.com'
})
};
fetch('https://api.salesive.com/api/v1/emails', 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.salesive.com/api/v1/emails",
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([
'audience' => 'customers',
'subject' => 'Weekend sale starts now',
'title' => '20% off everything',
'message' => 'For this weekend only, use code WEEKEND20 at checkout.',
'actionText' => 'Shop now',
'actionUrl' => 'https://mystore.salesive.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.salesive.com/api/v1/emails"
payload := strings.NewReader("{\n \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.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.salesive.com/api/v1/emails")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesive.com/api/v1/emails")
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 \"audience\": \"customers\",\n \"subject\": \"Weekend sale starts now\",\n \"title\": \"20% off everything\",\n \"message\": \"For this weekend only, use code WEEKEND20 at checkout.\",\n \"actionText\": \"Shop now\",\n \"actionUrl\": \"https://mystore.salesive.com\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"success": true,
"message": "Email queued for delivery",
"data": {
"audience": "customers",
"recipients": 342
}
}{
"status": 401,
"success": false,
"message": "Authentication required",
"data": null
}{
"status": 403,
"success": false,
"message": "Insufficient scope",
"data": null
}Sends a templated email to one of the store’s own audiences (
merchant, customers, or subscribers). Recipients are resolved server-side — an app can never email an arbitrary address. Customer and subscriber blasts are capped at 1000 recipients; rate limited to 10 send requests per hour per installation.Authorizations
Installed-app access token (prefix app_), issued by the OAuth install flow. The store is bound to the token server-side — never send a shop id.
Body
application/json
Who to send to. One of: "merchant" (the store owner), "customers" (the store's active customers), or "subscribers" (the store's newsletter subscribers).
Available options:
merchant, customers, subscribers Email subject line.
Headline rendered at the top of the email body.
Main body text of the email.
Optional call-to-action button label. Pair with actionUrl.
Optional URL the call-to-action button links to. Pair with actionText.
Response
The email was queued for the resolved audience.
Was this page helpful?

