curl --request PATCH \
--url http://localhost:8080/macros/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "<string>",
"title": "<string>",
"content": "<string>",
"options": [
{
"label": "<string>",
"id": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/macros/{id}"
payload = {
"category": "<string>",
"title": "<string>",
"content": "<string>",
"options": [
{
"label": "<string>",
"id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: '<string>',
title: '<string>',
content: '<string>',
options: [{label: '<string>', id: '<string>'}]
})
};
fetch('http://localhost:8080/macros/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'category' => '<string>',
'title' => '<string>',
'content' => '<string>',
'options' => [
[
'label' => '<string>',
'id' => '<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/macros/{id}"
payload := strings.NewReader("{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/macros/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"category": "<string>",
"title": "<string>",
"content": "<string>",
"attachments": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"type": "<string>",
"url": "<string>"
}
],
"options": [
{
"id": "<string>",
"label": "<string>",
"type": "text"
}
],
"user_id": 123,
"overrides_saved_reply_id": "<string>",
"exclude_from_suggestions": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Update a macro
Partially update an org-wide macro (saved reply): its title, body, options, or whether it can be suggested. Only the fields you send change.
curl --request PATCH \
--url http://localhost:8080/macros/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"category": "<string>",
"title": "<string>",
"content": "<string>",
"options": [
{
"label": "<string>",
"id": "<string>"
}
]
}
'import requests
url = "http://localhost:8080/macros/{id}"
payload = {
"category": "<string>",
"title": "<string>",
"content": "<string>",
"options": [
{
"label": "<string>",
"id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
category: '<string>',
title: '<string>',
content: '<string>',
options: [{label: '<string>', id: '<string>'}]
})
};
fetch('http://localhost:8080/macros/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/macros/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'category' => '<string>',
'title' => '<string>',
'content' => '<string>',
'options' => [
[
'label' => '<string>',
'id' => '<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/macros/{id}"
payload := strings.NewReader("{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/macros/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"category\": \"<string>\",\n \"title\": \"<string>\",\n \"content\": \"<string>\",\n \"options\": [\n {\n \"label\": \"<string>\",\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"org_id": "<string>",
"category": "<string>",
"title": "<string>",
"content": "<string>",
"attachments": [
{
"id": "<string>",
"name": "<string>",
"size": 123,
"type": "<string>",
"url": "<string>"
}
],
"options": [
{
"id": "<string>",
"label": "<string>",
"type": "text"
}
],
"user_id": 123,
"overrides_saved_reply_id": "<string>",
"exclude_from_suggestions": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}title, content, or options refreshes the macro’s translations in the background, so there is nothing to translate by hand. Translations are never edited directly; change the wording here instead. Set exclude_from_suggestions to true to keep the macro out of the suggestions agents see (they can still search for it).Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Macro ID
Body
Macro body as HTML, limited to what every channel can carry:
,
, , , , , [blocked]
- and inline images as
<img src="…">pointing at a file uploaded for this organization. Other markup is dropped (its text is kept); escape literal < and & as HTML entities, and use
orfor line breaks. Reference variables with {{variable}} syntax.
- /
20000Up to 3 options the customer can tap instead of typing, sent with the macro on channels that show them. Each label is up to 20 characters. type is text (the tap reaches the session as the customer's reply) or workflow (the tap runs the macro's Macro Option Clicked workflows and the AI doesn't reply). This is the full list: on update, pass an existing option's id to keep it (workflows branching on that id keep working); options left out are removed, [] removes all, and omitting the field leaves them untouched. A macro with options needs body text.
3Show child attributes
Show child attributes
Response
Default Response
Macro body as channel-safe HTML, with {{variable}} references.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?