List voice designs
Returns a paginated list of voice designs belonging to the authenticated account.
GET
/
voice_designs
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 voiceDesignListResponse of client.voiceDesigns.list()) {
console.log(voiceDesignListResponse.id);
}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.voice_designs.list()
page = page.data[0]
print(page.id)
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"),
)
page, err := client.VoiceDesigns.List(context.TODO(), telnyx.VoiceDesignListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignListPage;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VoiceDesignListPage page = client.voiceDesigns().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.voice_designs.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->voiceDesigns->list(
filterName: 'filter[name]', pageNumber: 1, pageSize: 1, sort: 'name'
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx voice-designs list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/voice_designs \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "voice_design",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"provider": "telnyx",
"provider_supported_models": [
"<string>"
]
}
],
"meta": {
"page_number": 1,
"page_size": 20,
"total_results": 42,
"total_pages": 3
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Page number for pagination (1-based).
Required range:
x >= 1Number of results per page.
Required range:
1 <= x <= 250Case-insensitive substring filter on the name field.
Sort order. Prefix with - for descending. Defaults to -created_at.
Available options:
name, -name, created_at, -created_at Response
A paginated list of voice designs.
Was this page helpful?
⌘I
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 voiceDesignListResponse of client.voiceDesigns.list()) {
console.log(voiceDesignListResponse.id);
}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.voice_designs.list()
page = page.data[0]
print(page.id)
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"),
)
page, err := client.VoiceDesigns.List(context.TODO(), telnyx.VoiceDesignListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignListPage;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VoiceDesignListPage page = client.voiceDesigns().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.voice_designs.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->voiceDesigns->list(
filterName: 'filter[name]', pageNumber: 1, pageSize: 1, sort: 'name'
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx voice-designs list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/voice_designs \
--header 'Authorization: Bearer <token>'{
"data": [
{
"record_type": "voice_design",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"provider": "telnyx",
"provider_supported_models": [
"<string>"
]
}
],
"meta": {
"page_number": 1,
"page_size": 20,
"total_results": 42,
"total_pages": 3
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}