curl --request POST \
--url http://localhost:8080/salesforce/ai-reply-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"template_html": "<string>",
"is_default": true,
"rules": {
"conditions": [
{
"type": "attribute",
"key": "<string>",
"value": "<string>"
}
]
},
"from_address": "<string>",
"to_address": "<string>"
}
'import requests
url = "http://localhost:8080/salesforce/ai-reply-templates"
payload = {
"name": "<string>",
"template_html": "<string>",
"is_default": True,
"rules": { "conditions": [
{
"type": "attribute",
"key": "<string>",
"value": "<string>"
}
] },
"from_address": "<string>",
"to_address": "<string>"
}
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>',
template_html: '<string>',
is_default: true,
rules: {conditions: [{type: 'attribute', key: '<string>', value: '<string>'}]},
from_address: '<string>',
to_address: '<string>'
})
};
fetch('http://localhost:8080/salesforce/ai-reply-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/salesforce/ai-reply-templates",
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>',
'template_html' => '<string>',
'is_default' => true,
'rules' => [
'conditions' => [
[
'type' => 'attribute',
'key' => '<string>',
'value' => '<string>'
]
]
],
'from_address' => '<string>',
'to_address' => '<string>'
]),
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 := "http://localhost:8080/salesforce/ai-reply-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\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("http://localhost:8080/salesforce/ai-reply-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/salesforce/ai-reply-templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"template_html": "<string>",
"is_default": true,
"rules": {
"conditions": [
{
"type": "attribute",
"key": "<string>",
"op": "exists",
"value": "<string>"
}
]
},
"from_address": "<string>",
"to_address": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Create an AI reply template
Create a reply template (Salesforce v2 integration only). Use when managing the reply templates the AI agent uses on Salesforce cases.
curl --request POST \
--url http://localhost:8080/salesforce/ai-reply-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"template_html": "<string>",
"is_default": true,
"rules": {
"conditions": [
{
"type": "attribute",
"key": "<string>",
"value": "<string>"
}
]
},
"from_address": "<string>",
"to_address": "<string>"
}
'import requests
url = "http://localhost:8080/salesforce/ai-reply-templates"
payload = {
"name": "<string>",
"template_html": "<string>",
"is_default": True,
"rules": { "conditions": [
{
"type": "attribute",
"key": "<string>",
"value": "<string>"
}
] },
"from_address": "<string>",
"to_address": "<string>"
}
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>',
template_html: '<string>',
is_default: true,
rules: {conditions: [{type: 'attribute', key: '<string>', value: '<string>'}]},
from_address: '<string>',
to_address: '<string>'
})
};
fetch('http://localhost:8080/salesforce/ai-reply-templates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/salesforce/ai-reply-templates",
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>',
'template_html' => '<string>',
'is_default' => true,
'rules' => [
'conditions' => [
[
'type' => 'attribute',
'key' => '<string>',
'value' => '<string>'
]
]
],
'from_address' => '<string>',
'to_address' => '<string>'
]),
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 := "http://localhost:8080/salesforce/ai-reply-templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\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("http://localhost:8080/salesforce/ai-reply-templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/salesforce/ai-reply-templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"template_html\": \"<string>\",\n \"is_default\": true,\n \"rules\": {\n \"conditions\": [\n {\n \"type\": \"attribute\",\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"from_address\": \"<string>\",\n \"to_address\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"template_html": "<string>",
"is_default": true,
"rules": {
"conditions": [
{
"type": "attribute",
"key": "<string>",
"op": "exists",
"value": "<string>"
}
]
},
"from_address": "<string>",
"to_address": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Authorizations
Body
From address of the AI agent's autopilot Case email: a literal address, a {{session attribute}} such as {{sf_case_LatestPOSEmail__c}}, or an {{#if …}} branch, resolved per session. Used only when it resolves to an email address; otherwise Salesforce's default sender applies. Empty or null clears it.
500To address of the AI agent's autopilot Case email: a literal address, a {{session attribute}} such as {{reservation_email}}, or an {{#if …}} branch, resolved per session. Used only when it resolves to an email address; otherwise the Case contact's address applies. Empty or null clears it.
500Response
Default Response
From address of the AI agent's autopilot Case email: a literal address, a {{session attribute}} such as {{sf_case_LatestPOSEmail__c}}, or an {{#if …}} branch, resolved per session. Used only when it resolves to an email address; otherwise Salesforce's default sender applies. Empty or null clears it.
To address of the AI agent's autopilot Case email: a literal address, a {{session attribute}} such as {{reservation_email}}, or an {{#if …}} branch, resolved per session. Used only when it resolves to an email address; otherwise the Case contact's address applies. Empty or null clears it.
Was this page helpful?