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.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.memory.namespaces.profiles.preview('namespace', 'profile_id', {
instructions: 'instructions',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.memory.namespaces.profiles.preview(
namespace="namespace",
profile_id="profile_id",
instructions="instructions",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Memory.Namespaces.Profiles.Preview(
context.TODO(),
"namespace",
"profile_id",
telnyx.AIMemoryNamespaceProfilePreviewParams{
Instructions: telnyx.String("instructions"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.memory.namespaces.profiles.ProfilePreviewParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ProfilePreviewParams params = ProfilePreviewParams.builder()
.instructions("instructions")
.build();
var response = client.ai().memory().namespaces().profiles().preview("namespace", "profile_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.memory.namespaces.profiles.preview("namespace", "profile_id", instructions: "instructions")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->memory->namespaces->profiles->preview(
'namespace',
'profile_id',
instructions: 'instructions',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:memory:namespaces:profiles preview \
--api-key 'My API Key' \
--namespace namespace \
--profile-id profile_id \
--instructions instructionscurl --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."
}
'{
"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"
}
]
}Path Parameters
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.
2000Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.memory.namespaces.profiles.preview('namespace', 'profile_id', {
instructions: 'instructions',
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.ai.memory.namespaces.profiles.preview(
namespace="namespace",
profile_id="profile_id",
instructions="instructions",
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.AI.Memory.Namespaces.Profiles.Preview(
context.TODO(),
"namespace",
"profile_id",
telnyx.AIMemoryNamespaceProfilePreviewParams{
Instructions: telnyx.String("instructions"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.memory.namespaces.profiles.ProfilePreviewParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
ProfilePreviewParams params = ProfilePreviewParams.builder()
.instructions("instructions")
.build();
var response = client.ai().memory().namespaces().profiles().preview("namespace", "profile_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.memory.namespaces.profiles.preview("namespace", "profile_id", instructions: "instructions")
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->ai->memory->namespaces->profiles->preview(
'namespace',
'profile_id',
instructions: 'instructions',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:memory:namespaces:profiles preview \
--api-key 'My API Key' \
--namespace namespace \
--profile-id profile_id \
--instructions instructionscurl --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."
}
'{
"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"
}
]
}