Rename a voice design
Updates the name of a voice design. All versions retain their other properties.
PATCH
/
voice_designs
/
{id}
JavaScript
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.voiceDesigns.rename('id', { name: 'updated-narrator' });
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.voice_designs.rename(
id="id",
name="updated-narrator",
)
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.VoiceDesigns.Rename(
context.TODO(),
"id",
telnyx.VoiceDesignRenameParams{
Name: "updated-narrator",
},
)
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.voicedesigns.VoiceDesignRenameParams;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignRenameResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VoiceDesignRenameParams params = VoiceDesignRenameParams.builder()
.id("id")
.name("updated-narrator")
.build();
VoiceDesignRenameResponse response = client.voiceDesigns().rename(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.voice_designs.rename("id", name: "updated-narrator")
puts(response)telnyx voice-designs rename \
--api-key 'My API Key' \
--id id \
--name updated-narratorcurl --request PATCH \
--url https://api.telnyx.com/v2/voice_designs/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "updated-narrator"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/voice_designs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'updated-narrator'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"record_type": "voice_design",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "updated-narrator",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-02T00:00:00Z"
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}Path Parameters
The voice design UUID or name.
Body
application/json
Request body for renaming a voice design.
New name for the voice design.
Required string length:
1 - 255Response
Voice design renamed successfully.
Response envelope for a voice design after a rename operation (no version-specific fields).
A summarized voice design object (without version-specific fields).
Show child attributes
Show child attributes
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
});
const response = await client.voiceDesigns.rename('id', { name: 'updated-narrator' });
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.voice_designs.rename(
id="id",
name="updated-narrator",
)
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.VoiceDesigns.Rename(
context.TODO(),
"id",
telnyx.VoiceDesignRenameParams{
Name: "updated-narrator",
},
)
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.voicedesigns.VoiceDesignRenameParams;
import com.telnyx.sdk.models.voicedesigns.VoiceDesignRenameResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
VoiceDesignRenameParams params = VoiceDesignRenameParams.builder()
.id("id")
.name("updated-narrator")
.build();
VoiceDesignRenameResponse response = client.voiceDesigns().rename(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.voice_designs.rename("id", name: "updated-narrator")
puts(response)telnyx voice-designs rename \
--api-key 'My API Key' \
--id id \
--name updated-narratorcurl --request PATCH \
--url https://api.telnyx.com/v2/voice_designs/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "updated-narrator"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telnyx.com/v2/voice_designs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'updated-narrator'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"record_type": "voice_design",
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "updated-narrator",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-02T00:00:00Z"
}
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Voice design not found"
}
]
}