Update a custom avatar
Updates the customer-facing name of a custom avatar owned by the authenticated organization. Stock avatars cannot be modified. To replace the image, create a new custom avatar so existing references keep their original content.
PATCH
/
ai
/
avatars
/
{avatar_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 Avatar = await client.ai.avatars.update('avatar_id', {
name: 'Updated portrait',
});
console.log(Avatar.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
)
avatar = client.ai.avatars.update(
avatar_id="avatar_id",
name="Updated portrait",
)
print(avatar.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"),
)
avatar, err := client.AI.Avatars.Update(
context.TODO(),
"avatar_id",
telnyx.AIAvatarUpdateParams{
Name: "Updated portrait",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", avatar.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.avatars.AvatarUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AvatarUpdateParams params = AvatarUpdateParams.builder()
.name("Updated portrait")
.build();
var response = client.ai().avatars().update("avatar_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
avatar = telnyx.ai.avatars.update("avatar_id", name: "Updated portrait")
puts(avatar)<?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 {
$avatar = $client->ai->avatars->update(
'avatar_id',
name: 'Updated portrait',
);
var_dump($avatar);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:avatars update \
--api-key 'My API Key' \
--avatar-id elena \
--name 'Updated portrait'curl --request PATCH \
--url https://api.telnyx.com/v2/ai/avatars/{avatar_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated portrait"
}
'{
"data": {
"id": "avatar_0123456789abcdef0123456789abcdef",
"name": "Customer portrait",
"provider": "telnyx",
"avatar_type": "stock",
"hosted": true,
"image_url": "https://example.com/avatar.png",
"image_url_expires_at": "2026-10-13T15:00:00Z",
"content_type": "image/jpeg",
"size_bytes": 248512,
"width_px": 1920,
"height_px": 1080,
"created_at": "2026-10-13T14:00:00Z",
"updated_at": "2026-10-13T14:00:00Z"
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "Telnyx stock avatars cannot be modified.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Avatar avatar_0123456789abcdef0123456789abcdef does not exist.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The image must be between 256 and 8192 pixels on each side.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10027"
}
}
]
}{
"errors": [
{
"code": "10037",
"title": "Service unavailable",
"detail": "Avatar storage is temporarily unavailable. Try again.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10037"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Stable identifier of a Telnyx stock avatar or an organization-owned custom avatar.
Stable identifier of a Telnyx stock avatar or an organization-owned custom avatar. Custom avatar IDs are returned by the Avatars API and use the avatar_ prefix.
Available options:
elena, ben, jordan, lin, avery, raphael Example:
"avatar_0123456789abcdef0123456789abcdef"
Body
application/json
New customer-facing name of the custom avatar.
Required string length:
1 - 255Example:
"Updated portrait"
Response
The custom avatar was updated.
Show child attributes
Show child attributes
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
});
const Avatar = await client.ai.avatars.update('avatar_id', {
name: 'Updated portrait',
});
console.log(Avatar.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
)
avatar = client.ai.avatars.update(
avatar_id="avatar_id",
name="Updated portrait",
)
print(avatar.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"),
)
avatar, err := client.AI.Avatars.Update(
context.TODO(),
"avatar_id",
telnyx.AIAvatarUpdateParams{
Name: "Updated portrait",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", avatar.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.avatars.AvatarUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AvatarUpdateParams params = AvatarUpdateParams.builder()
.name("Updated portrait")
.build();
var response = client.ai().avatars().update("avatar_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
avatar = telnyx.ai.avatars.update("avatar_id", name: "Updated portrait")
puts(avatar)<?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 {
$avatar = $client->ai->avatars->update(
'avatar_id',
name: 'Updated portrait',
);
var_dump($avatar);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:avatars update \
--api-key 'My API Key' \
--avatar-id elena \
--name 'Updated portrait'curl --request PATCH \
--url https://api.telnyx.com/v2/ai/avatars/{avatar_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated portrait"
}
'{
"data": {
"id": "avatar_0123456789abcdef0123456789abcdef",
"name": "Customer portrait",
"provider": "telnyx",
"avatar_type": "stock",
"hosted": true,
"image_url": "https://example.com/avatar.png",
"image_url_expires_at": "2026-10-13T15:00:00Z",
"content_type": "image/jpeg",
"size_bytes": 248512,
"width_px": 1920,
"height_px": 1080,
"created_at": "2026-10-13T14:00:00Z",
"updated_at": "2026-10-13T14:00:00Z"
}
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "Telnyx stock avatars cannot be modified.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10015"
}
}
]
}{
"errors": [
{
"code": "10005",
"title": "Resource not found",
"detail": "Avatar avatar_0123456789abcdef0123456789abcdef does not exist.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10005"
}
}
]
}{
"errors": [
{
"code": "10027",
"title": "Unprocessable Entity",
"detail": "The image must be between 256 and 8192 pixels on each side.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10027"
}
}
]
}{
"errors": [
{
"code": "10037",
"title": "Service unavailable",
"detail": "Avatar storage is temporarily unavailable. Try again.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10037"
}
}
]
}