> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a collection

> Soft-deletes a collection. Its `slug` is freed and may be reused by a new collection.



## OpenAPI

````yaml /openapi/source/external/collections/collections.json delete /ai/collections/{uuid}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Telnyx API
  x-latency-category: interactive
  x-endpoint-cost: light
  description: >-
    Create and manage AI Collections — logical, searchable groupings of your
    Telnyx product data (voice, meeting bot, and message sources).


    A collection defines *what* data is searchable and *how* it is retrieved.
    You create a collection, attach one or more sources to it, tune its
    retrieval settings, and then run vector or hybrid search scoped to that
    collection. Every collection is automatically scoped to your organization —
    identity is derived from your Telnyx API key and cannot be overridden.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Telnyx API v2
security:
  - bearerAuth: []
tags:
  - name: AI Collections
    description: >-
      Create and manage logical collections of your Telnyx data, tune retrieval
      settings, manage sources, and run collection-scoped semantic search.
paths:
  /ai/collections/{uuid}:
    delete:
      tags:
        - AI Collections
      summary: Delete a collection
      description: >-
        Soft-deletes a collection. Its `slug` is freed and may be reused by a
        new collection.
      operationId: DeleteCollection
      parameters:
        - $ref: '#/components/parameters/Uuid'
      responses:
        '204':
          description: Collection deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            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');
        - lang: Python
          source: |
            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",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.AI.Collections.Delete(\n\t\tcontext.TODO(),\n\t\t\"uuid\",\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: Java
          source: |-
            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");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.ai.collections.delete("uuid")

            puts(response)
        - lang: PHP
          source: >-
            <?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();
            }
        - lang: CLI
          source: |-
            telnyx ai:collections delete \
              --api-key 'My API Key' \
              --uuid 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e
components:
  parameters:
    Uuid:
      name: uuid
      in: path
      required: true
      description: The collection's unique identifier.
      schema:
        type: string
        format: uuid
        example: 6a09ccbd-8f9b-4c3a-9b0e-2f1d3c4b5a6e
  responses:
    Unauthorized:
      description: Missing or invalid authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          example:
            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
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          example:
            errors:
              - code: collection_not_found
                title: Collection not found
                detail: >-
                  No collection with uuid 'b3b1c8a2-9f4e-4d2a-9c1e-2f7a6d5b4c3a'
                  exists for this account.
  schemas:
    Errors:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        meta:
          type: object
          additionalProperties: true
          properties:
            pointer:
              type: string
              description: >-
                JSON Pointer to the request field that caused the error. Present
                on field-level validation and conflict errors.
              example: /slug
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Telnyx API key. Collections and results are automatically scoped to the
        authenticated user's organization.

````