List macro suggestion insights
curl --request GET \
--url http://localhost:8080/macros/suggestion-insights \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/macros/suggestion-insights"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/macros/suggestion-insights', 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/suggestion-insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/macros/suggestion-insights"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/macros/suggestion-insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/suggestion-insights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"saved_reply_id": "<string>",
"window_days": 30,
"state": "off",
"shown": 123,
"applied": 123,
"missed": 123,
"hit_rate": 123,
"threshold": 123,
"weekly": [
{
"week_start": "<string>",
"shown": 123,
"applied": 123,
"missed": 123
}
]
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Macros
List macro suggestion insights
See how each org-wide macro performs as a suggested macro over the last 30 days: times shown and used, hit rate, and its learning state.
GET
/
macros
/
suggestion-insights
List macro suggestion insights
curl --request GET \
--url http://localhost:8080/macros/suggestion-insights \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/macros/suggestion-insights"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/macros/suggestion-insights', 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/suggestion-insights",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/macros/suggestion-insights"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/macros/suggestion-insights")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/macros/suggestion-insights")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"saved_reply_id": "<string>",
"window_days": 30,
"state": "off",
"shown": 123,
"applied": 123,
"missed": 123,
"hit_rate": 123,
"threshold": 123,
"weekly": [
{
"week_start": "<string>",
"shown": 123,
"applied": 123,
"missed": 123
}
]
}
]
}{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Reading the numbers
Counts cover the last 30 days (window_days):
shown— times the macro was suggested to an agent.applied— times an agent used it from the suggestions.missed— times an agent reached for it through search instead.hit_rate—applieddivided byshown, ornullwhen it was never shown.threshold— how close a match the macro needs to be suggested right now.weekly— 12 weekly counts, oldest first, each with aweek_start(the Monday, UTC). Empty unless you passinclude_weekly=true.
state says where each one stands:
state | Meaning |
|---|---|
learning | Not enough use yet to tell. |
steady | Suggested at the usual bar. |
proven | Agents use it, so it is suggested a little earlier (a lower threshold). |
muted | Often suggested and never used, so it needs a closer match (a higher threshold). |
off | The macro is excluded from suggestions, or suggested macros are off for the workspace. |
exclude_from_suggestions with Update a macro.Was this page helpful?