List your namespaces
Every namespace in your organization, default among them.
GET
/
ai
/
memory
/
namespaces
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const response of client.ai.memory.namespaces.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.ai.memory.namespaces.list()
print(page.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"),
)
namespaces, err := client.AI.Memory.Namespaces.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", namespaces.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var page = client.ai().memory().namespaces().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.ai.memory.namespaces.list
puts(page)<?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 {
$page = $client->ai->memory->namespaces->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:memory:namespaces list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/ai/memory/namespaces \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "1f815759-d4d8-5548-aa5b-077a60b9f8dd",
"name": "default"
},
{
"id": "b3c17d90-2e4f-5a1b-9c8d-6f0a2b3c4d5e",
"name": "staging"
}
]
}{
"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": "upstream_error",
"detail": "the memory dataplane is unavailable"
}
]
}Was this page helpful?
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const response of client.ai.memory.namespaces.list()) {
console.log(response);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.ai.memory.namespaces.list()
print(page.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"),
)
namespaces, err := client.AI.Memory.Namespaces.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", namespaces.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
var page = client.ai().memory().namespaces().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.ai.memory.namespaces.list
puts(page)<?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 {
$page = $client->ai->memory->namespaces->list();
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:memory:namespaces list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/ai/memory/namespaces \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "1f815759-d4d8-5548-aa5b-077a60b9f8dd",
"name": "default"
},
{
"id": "b3c17d90-2e4f-5a1b-9c8d-6f0a2b3c4d5e",
"name": "staging"
}
]
}{
"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": "upstream_error",
"detail": "the memory dataplane is unavailable"
}
]
}