Create Decision Engine Message
curl --request POST \
--url https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": true,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
]
}
'import requests
url = "https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages"
payload = {
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": True,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
]
}
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({
name: '<string>',
channelId: '<string>',
config: {},
tags: {},
guardrails: {
maxSendsPerUser: 123,
maxSendsPerUserWindowDays: 123,
minOtherMessagesInBetween: 123,
firstEligibleSendDate: '<string>',
lastEligibleSendDate: '<string>'
},
variables: [
{
name: '<string>',
variants: [
{
value: '<string>',
tags: {},
firstEligibleSendDate: '<string>',
lastEligibleSendDate: '<string>',
userAudienceFilter: '<unknown>',
localeValues: {}
}
],
config: {
localizationEnabled: true,
maxSendsPerUserWindowDays: 123,
maxSendsPerUser: 123
}
}
]
})
};
fetch('https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages', 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/decision-engine/flow/{flowId}/messages",
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([
'name' => '<string>',
'channelId' => '<string>',
'config' => [
],
'tags' => [
],
'guardrails' => [
'maxSendsPerUser' => 123,
'maxSendsPerUserWindowDays' => 123,
'minOtherMessagesInBetween' => 123,
'firstEligibleSendDate' => '<string>',
'lastEligibleSendDate' => '<string>'
],
'variables' => [
[
'name' => '<string>',
'variants' => [
[
'value' => '<string>',
'tags' => [
],
'firstEligibleSendDate' => '<string>',
'lastEligibleSendDate' => '<string>',
'userAudienceFilter' => '<unknown>',
'localeValues' => [
]
]
],
'config' => [
'localizationEnabled' => true,
'maxSendsPerUserWindowDays' => 123,
'maxSendsPerUser' => 123
]
]
]
]),
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/decision-engine/flow/{flowId}/messages"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\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))
}HttpResponse<String> response = Unirest.post("https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages")
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 \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": true,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed",
"details": {}
}"Internal Server Error"API Reference
Create Decision Engine Message
Create a message in a flow
POST
/
decision-engine
/
flow
/
{flowId}
/
messages
Create Decision Engine Message
curl --request POST \
--url https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": true,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
]
}
'import requests
url = "https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages"
payload = {
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": True,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
]
}
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({
name: '<string>',
channelId: '<string>',
config: {},
tags: {},
guardrails: {
maxSendsPerUser: 123,
maxSendsPerUserWindowDays: 123,
minOtherMessagesInBetween: 123,
firstEligibleSendDate: '<string>',
lastEligibleSendDate: '<string>'
},
variables: [
{
name: '<string>',
variants: [
{
value: '<string>',
tags: {},
firstEligibleSendDate: '<string>',
lastEligibleSendDate: '<string>',
userAudienceFilter: '<unknown>',
localeValues: {}
}
],
config: {
localizationEnabled: true,
maxSendsPerUserWindowDays: 123,
maxSendsPerUser: 123
}
}
]
})
};
fetch('https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages', 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/decision-engine/flow/{flowId}/messages",
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([
'name' => '<string>',
'channelId' => '<string>',
'config' => [
],
'tags' => [
],
'guardrails' => [
'maxSendsPerUser' => 123,
'maxSendsPerUserWindowDays' => 123,
'minOtherMessagesInBetween' => 123,
'firstEligibleSendDate' => '<string>',
'lastEligibleSendDate' => '<string>'
],
'variables' => [
[
'name' => '<string>',
'variants' => [
[
'value' => '<string>',
'tags' => [
],
'firstEligibleSendDate' => '<string>',
'lastEligibleSendDate' => '<string>',
'userAudienceFilter' => '<unknown>',
'localeValues' => [
]
]
],
'config' => [
'localizationEnabled' => true,
'maxSendsPerUserWindowDays' => 123,
'maxSendsPerUser' => 123
]
]
]
]),
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/decision-engine/flow/{flowId}/messages"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\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))
}HttpResponse<String> response = Unirest.post("https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/decision-engine/flow/{flowId}/messages")
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 \"name\": \"<string>\",\n \"channelId\": \"<string>\",\n \"config\": {},\n \"tags\": {},\n \"guardrails\": {\n \"maxSendsPerUser\": 123,\n \"maxSendsPerUserWindowDays\": 123,\n \"minOtherMessagesInBetween\": 123,\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\"\n },\n \"variables\": [\n {\n \"name\": \"<string>\",\n \"variants\": [\n {\n \"value\": \"<string>\",\n \"tags\": {},\n \"firstEligibleSendDate\": \"<string>\",\n \"lastEligibleSendDate\": \"<string>\",\n \"userAudienceFilter\": \"<unknown>\",\n \"localeValues\": {}\n }\n ],\n \"config\": {\n \"localizationEnabled\": true,\n \"maxSendsPerUserWindowDays\": 123,\n \"maxSendsPerUser\": 123\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"channelId": "<string>",
"config": {},
"tags": {},
"guardrails": {
"maxSendsPerUser": 123,
"maxSendsPerUserWindowDays": 123,
"minOtherMessagesInBetween": 123,
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>"
},
"variables": [
{
"name": "<string>",
"variants": [
{
"value": "<string>",
"tags": {},
"firstEligibleSendDate": "<string>",
"lastEligibleSendDate": "<string>",
"userAudienceFilter": "<unknown>",
"localeValues": {}
}
],
"config": {
"localizationEnabled": true,
"maxSendsPerUserWindowDays": 123,
"maxSendsPerUser": 123
}
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed",
"details": {}
}"Internal Server Error"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the flow
Body
application/json
Request body for creating a Decision Engine message
Response
Ok
Decision Engine Message (Public API)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Guardrail fields on a message (max sends, eligibility dates, etc.)
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?