Preview a candidate note before saving it
Try a candidate note on one profile and see how that profile’s summary would read under it, without saving the note and without touching the stored summary. Composes the same source query the apply path (PATCH /ai/memory/namespaces/{namespace}/settings) would use, so a preview cannot drift from what saving the note would produce. Reads the candidate alone — the namespace’s current instructions and the profile’s stored summary are neither read nor replaced. Bounded at 120 seconds: the summary is generated on the spot rather than read from a stored one. Nothing about the request is stored.
curl --request POST \
--url https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": "Lead with billing status. Prefer plain language over jargon."
}
'import requests
url = "https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview"
payload = { "instructions": "Lead with billing status. Prefer plain language over jargon." }
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({instructions: 'Lead with billing status. Prefer plain language over jargon.'})
};
fetch('https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview', 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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview",
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([
'instructions' => 'Lead with billing status. Prefer plain language over jargon.'
]),
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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview"
payload := strings.NewReader("{\n \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview")
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 \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"profile_id": "user-42",
"text": "## Profile Summary\n\n- Billing: current, autopay on.\n- Prefers Slack over email."
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "namespace_not_found",
"detail": "no such namespace"
}
]
}{
"errors": [
{
"code": "invalid_instructions",
"detail": "instructions must be at most 2000 characters"
}
]
}{
"errors": [
{
"code": "upstream_error",
"detail": "the memory dataplane is unavailable"
}
]
}Authorizations
Telnyx API key
Path Parameters
The namespace. default exists for every organization.
The profile: your identifier for the user, caller or agent this memory is about.
Body
A candidate note to preview against one profile. The field is optional; omitting it, or sending null/empty/whitespace, previews the neutral default.
The candidate note to try. null, empty, or whitespace-only previews the neutral default -- the summary a profile returns to when instructions are cleared. Capped at 2000 characters, the same cap PATCH /settings applies on save; a longer note is refused with 422 before anything is generated.
2000Response
The summary this profile would carry under the candidate note. data.text is null when nothing was generated -- the same signal GET /summary uses for a profile with no card yet.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": "Lead with billing status. Prefer plain language over jargon."
}
'import requests
url = "https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview"
payload = { "instructions": "Lead with billing status. Prefer plain language over jargon." }
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({instructions: 'Lead with billing status. Prefer plain language over jargon.'})
};
fetch('https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview', 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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview",
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([
'instructions' => 'Lead with billing status. Prefer plain language over jargon.'
]),
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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview"
payload := strings.NewReader("{\n \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\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.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telnyx.com/v2/ai/memory/namespaces/{namespace}/profiles/{profile_id}/summary/preview")
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 \"instructions\": \"Lead with billing status. Prefer plain language over jargon.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"profile_id": "user-42",
"text": "## Profile Summary\n\n- Billing: current, autopay on.\n- Prefers Slack over email."
}
}{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "Could not find any usable credentials in the request.",
"source": {
"pointer": "/"
},
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "namespace_not_found",
"detail": "no such namespace"
}
]
}{
"errors": [
{
"code": "invalid_instructions",
"detail": "instructions must be at most 2000 characters"
}
]
}{
"errors": [
{
"code": "upstream_error",
"detail": "the memory dataplane is unavailable"
}
]
}