curl --request POST \
--url https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"handle": "<string>",
"properties": {},
"locale": "<string>"
}
],
"properties": {},
"draft": "false"
}
'import requests
url = "https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger"
payload = {
"recipients": [
{
"handle": "<string>",
"properties": {},
"locale": "<string>"
}
],
"properties": {},
"draft": "false"
}
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: [{handle: '<string>', properties: {}, locale: '<string>'}],
properties: {},
draft: 'false'
})
};
fetch('https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger', 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.hightouch.com/api/v1/campaigns/{campaignId}/trigger",
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' => [
[
'handle' => '<string>',
'properties' => [
],
'locale' => '<string>'
]
],
'properties' => [
],
'draft' => 'false'
]),
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.hightouch.com/api/v1/campaigns/{campaignId}/trigger"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\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.hightouch.com/api/v1/campaigns/{campaignId}/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger")
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 \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"status": "accepted",
"handle": "<string>",
"id": "<string>",
"sendId": "<string>",
"reason": "invalid_handle",
"missingVariables": [
"<string>"
]
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"message": "Validation failed",
"details": {}
}{
"error": "<string>"
}"Internal Server Error"Trigger an API campaign send
Start an API-triggered campaign: send to the given recipients.
curl --request POST \
--url https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipients": [
{
"handle": "<string>",
"properties": {},
"locale": "<string>"
}
],
"properties": {},
"draft": "false"
}
'import requests
url = "https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger"
payload = {
"recipients": [
{
"handle": "<string>",
"properties": {},
"locale": "<string>"
}
],
"properties": {},
"draft": "false"
}
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: [{handle: '<string>', properties: {}, locale: '<string>'}],
properties: {},
draft: 'false'
})
};
fetch('https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger', 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.hightouch.com/api/v1/campaigns/{campaignId}/trigger",
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' => [
[
'handle' => '<string>',
'properties' => [
],
'locale' => '<string>'
]
],
'properties' => [
],
'draft' => 'false'
]),
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.hightouch.com/api/v1/campaigns/{campaignId}/trigger"
payload := strings.NewReader("{\n \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\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.hightouch.com/api/v1/campaigns/{campaignId}/trigger")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/campaigns/{campaignId}/trigger")
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 \"recipients\": [\n {\n \"handle\": \"<string>\",\n \"properties\": {},\n \"locale\": \"<string>\"\n }\n ],\n \"properties\": {},\n \"draft\": \"false\"\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"status": "accepted",
"handle": "<string>",
"id": "<string>",
"sendId": "<string>",
"reason": "invalid_handle",
"missingVariables": [
"<string>"
]
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}{
"message": "Validation failed",
"details": {}
}{
"error": "<string>"
}"Internal Server Error"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request body for triggering an API campaign send.
List of recipients to send to. Each entry must include either a handle
(delivery address) or an id (Personalization API based profile ID).
1 - 100 elementsA single send target. Provide either handle (inline delivery address) or
id (Personalization API profile ID), but not both.
- Option 1
- Option 2
Show child attributes
Show child attributes
Shared personalization properties applied to all recipients. Keys must
match the variable names shown in the message editor. Per-recipient
properties take precedence when a key appears in both.
Show child attributes
Show child attributes
When true, sends the campaign even if it has not been activated.
Intended for test sends against draft campaigns only.
Response
Ok
- Option 1
- Option 2
Response body for a campaign trigger request. Results are returned in the
same order as the input recipients array.
Per-recipient outcomes. Accepted recipients are queued for delivery; rejected recipients were not sent.
Show child attributes
Show child attributes
Was this page helpful?