Delete a collection
Soft-deletes a collection. Its slug is freed and may be reused by a new collection.
DELETE
/
ai
/
collections
/
{uuid}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
await client.ai.collections.delete('uuid');import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.ai.collections.delete(
"uuid",
)
package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.AI.Collections.Delete(
context.TODO(),
"uuid",
)
if err != nil {
panic(err.Error())
}
}
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();
client.ai().collections().delete("uuid");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.collections.delete("uuid")
puts(response)<?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 {
$response = $client->ai->collections->delete(
'uuid',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:collections delete \
--api-key 'My API Key' \
--uuid 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6ecurl --request DELETE \
--url https://api.telnyx.com/v2/ai/collections/{uuid} \
--header 'Authorization: Bearer <token>'{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "collection_not_found",
"title": "Collection not found",
"detail": "No collection with uuid 'b3b1c8a2-9f4e-4d2a-9c1e-2f7a6d5b4c3a' exists for this account."
}
]
}Authorizations
Telnyx API key. Collections and results are automatically scoped to the authenticated user's organization.
Path Parameters
The collection's unique identifier.
Example:
"6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e"
Response
Collection deleted.
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
});
await client.ai.collections.delete('uuid');import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
client.ai.collections.delete(
"uuid",
)
package main
import (
"context"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.AI.Collections.Delete(
context.TODO(),
"uuid",
)
if err != nil {
panic(err.Error())
}
}
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();
client.ai().collections().delete("uuid");
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.ai.collections.delete("uuid")
puts(response)<?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 {
$response = $client->ai->collections->delete(
'uuid',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx ai:collections delete \
--api-key 'My API Key' \
--uuid 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6ecurl --request DELETE \
--url https://api.telnyx.com/v2/ai/collections/{uuid} \
--header 'Authorization: Bearer <token>'{
"errors": [
{
"code": "10009",
"title": "Authentication failed",
"detail": "The required authentication headers were either invalid or not included in the request.",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10009"
}
}
]
}{
"errors": [
{
"code": "collection_not_found",
"title": "Collection not found",
"detail": "No collection with uuid 'b3b1c8a2-9f4e-4d2a-9c1e-2f7a6d5b4c3a' exists for this account."
}
]
}