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

# Delete a collection

> This operation deletes an existing collection.

Serverless indexes do not support collections.


<RequestExample>
  ```python Python theme={null}
  # pip install "pinecone[grpc]"
  from pinecone.grpc import PineconeGRPC as Pinecone

  pc = Pinecone(api_key='API_KEY')
  pc.delete_collection("example-collection")
  ```

  ```javascript JavaScript theme={null}
  // npm install @pinecone-database/pinecone
  import { Pinecone } from '@pinecone-database/pinecone'

  const pc = new Pinecone({ apiKey: 'YOUR_API_KEY' })

  await pc.deleteCollection("example-collection");
  ```

  ```java Java theme={null}
  import io.pinecone.clients.Pinecone;

  public class DeleteCollectionExample {
      public static void main(String[] args) {
          Pinecone pc = new Pinecone.Builder("YOUR_API_KEY").build();
          pc.deleteCollection("example-collection");
      }
  }
  ```

  ```shell curl theme={null}
  PINECONE_API_KEY="YOUR_API_KEY"

  curl -i -X DELETE "https://api.pinecone.io/collections/example-collection" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "X-Pinecone-Api-Version: 2024-04"
  ```
</RequestExample>

<ResponseExample />


## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2024-04/control_2024-04.oas.yaml delete /collections/{collection_name}
openapi: 3.0.3
info:
  title: Pinecone Control Plane API
  description: >-
    Pinecone is a vector database that makes it easy to search and retrieve
    billions of high-dimensional vectors.
  version: 2024-04
  contact:
    name: Pinecone Support
    url: https://support.pinecone.io
    email: support@pinecone.io
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.pinecone.io
    description: Production API endpoints
security:
  - ApiKeyAuth: []
tags:
  - name: Manage Indexes
    description: Actions that manage indexes
externalDocs:
  description: More Pinecone.io API docs
  url: https://docs.pinecone.io/introduction
paths:
  /collections/{collection_name}:
    servers:
      - url: https://api.pinecone.io
    delete:
      tags:
        - Manage Indexes
      summary: Delete a collection
      description: |
        This operation deletes an existing collection.

        Serverless indexes do not support collections.
      operationId: delete_collection
      parameters:
        - name: collection_name
          required: true
          in: path
          schema:
            type: string
          description: The name of the collection.
          example: test-collection
      responses:
        '202':
          description: The collection has been successfully deleted.
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          $ref: '#/components/responses/404CollectionNotFound'
        '500':
          $ref: '#/components/responses/500InternalServerError'
components:
  responses:
    401Unauthorized:
      description: 'Unauthorized. Possible causes: Invalid API key.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            unauthorized:
              summary: Unauthorized
              value:
                status: 401
                error:
                  code: UNAUTHENTICATED
                  message: Invalid API key.
    404CollectionNotFound:
      description: Collection not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            collection-not-found:
              summary: Collection not found.
              value:
                status: 404
                error:
                  code: NOT_FOUND
                  message: Collection example-collection not found.
    500InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal-server-error:
              summary: Internal server error
              value:
                status: 500
                error:
                  code: UNKNOWN
                  message: Internal server error
  schemas:
    ErrorResponse:
      type: object
      description: The response shape used for all error responses.
      required:
        - status
        - error
      properties:
        status:
          type: integer
          description: The HTTP status code of the error.
          example: 500
        error:
          type: object
          description: Detailed information about the error that occurred.
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - OK
                - UNKNOWN
                - INVALID_ARGUMENT
                - DEADLINE_EXCEEDED
                - QUOTA_EXCEEDED
                - NOT_FOUND
                - ALREADY_EXISTS
                - PERMISSION_DENIED
                - UNAUTHENTICATED
                - RESOURCE_EXHAUSTED
                - FAILED_PRECONDITION
                - ABORTED
                - OUT_OF_RANGE
                - UNIMPLEMENTED
                - INTERNAL
                - UNAVAILABLE
                - DATA_LOSS
                - FORBIDDEN
            message:
              type: string
              example: >-
                Index name must contain only lowercase alphanumeric characters
                or hyphens, and must not begin or end with a hyphen.
            details:
              description: >-
                Additional information about the error. This field is not
                guaranteed to be present.
              type: object
          example:
            code: INVALID_ARGUMENT
            message: >-
              Index name must contain only lowercase alphanumeric characters or
              hyphens, and must not begin or end with a hyphen.
      example:
        status: 429
        error:
          code: QUOTA_EXCEEDED
          message: >-
            The index exceeds the project quota of 5 pods by 2 pods. Upgrade
            your account or change the project settings to increase the quota.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Api-Key
      description: >-
        An API Key is required to call Pinecone APIs. Get yours from the
        [console](https://app.pinecone.io/).
      in: header

````