Delete an assistant
Delete an AI Assistant by assistant_id.
By default this performs a soft delete: the assistant moves to the Recently Deleted list and stays restorable for 30 days, after which it is permanently deleted automatically. The assistant’s versions and TeXML application are preserved during the retention window.
Pass hard_delete=true to skip the retention window and permanently delete the assistant immediately. A hard delete erases the assistant and all of its versions, and deletes its TeXML application unless phone numbers are still assigned to it. It does not delete conversations, recordings, shared tools the assistant referenced, or knowledge-base embeddings.
Deletion fails with 400 if other assistants reference this one through a handoff tool or a conversation-flow edge — remove those references first.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const assistant = await client.ai.assistants.delete('assistant_id');
console.log(assistant.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
)
assistant = client.ai.assistants.delete(
"assistant_id",
)
print(assistant.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"),
)
assistant, err := client.AI.Assistants.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteParams;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantDeleteResponse assistant = client.ai().assistants().delete("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant = telnyx.ai.assistants.delete("assistant_id")
puts(assistant)<?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 {
$assistant = $client->ai->assistants->delete('assistant_id');
var_dump($assistant);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants delete \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request DELETE \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id} \
--header 'Authorization: Bearer <token>'{
"id": "assistant_7f3c2a1b",
"object": "assistant.deleted",
"deleted": true
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "Cannot delete assistant assistant_7f3c2a1b. The following assistant(s) have handoff tools pointing to it: 'Billing Bot' (assistant_9c1d2e3f). Please remove these handoff tools before deleting."
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the assistant.
Query Parameters
Permanently delete the assistant immediately instead of soft-deleting it to the Recently Deleted list, where it stays restorable for 30 days.
Response
Successful Response
Aligns with the OpenAI API: https://platform.openai.com/docs/api-reference/assistants/deleteAssistant
Was 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 assistant = await client.ai.assistants.delete('assistant_id');
console.log(assistant.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
)
assistant = client.ai.assistants.delete(
"assistant_id",
)
print(assistant.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"),
)
assistant, err := client.AI.Assistants.Delete(context.TODO(), "assistant_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", assistant.ID)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteParams;
import com.telnyx.sdk.models.ai.assistants.AssistantDeleteResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
AssistantDeleteResponse assistant = client.ai().assistants().delete("assistant_id");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
assistant = telnyx.ai.assistants.delete("assistant_id")
puts(assistant)<?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 {
$assistant = $client->ai->assistants->delete('assistant_id');
var_dump($assistant);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:assistants delete \
--api-key 'My API Key' \
--assistant-id assistant_idcurl --request DELETE \
--url https://api.telnyx.com/v2/ai/assistants/{assistant_id} \
--header 'Authorization: Bearer <token>'{
"id": "assistant_7f3c2a1b",
"object": "assistant.deleted",
"deleted": true
}{
"errors": [
{
"code": "10015",
"title": "Bad Request",
"detail": "Cannot delete assistant assistant_7f3c2a1b. The following assistant(s) have handoff tools pointing to it: 'Billing Bot' (assistant_9c1d2e3f). Please remove these handoff tools before deleting."
}
]
}{
"detail": [
{
"loc": [
"body",
"name"
],
"msg": "Field required",
"type": "missing"
}
]
}