> ## 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 documents

> Delete documents from a namespace. Exactly one of `ids` or `delete_all` must be specified.

- `ids`: Delete documents with the given IDs.
- `delete_all`: Delete all documents in the namespace.

<Note>
  [Full-text search](/guides/search/full-text-search) is in [public
  preview](/release-notes/feature-availability) and uses API version
  `2026-01.alpha`. APIs may continue to evolve before general availability.
</Note>

Deletes schema-defined documents from a namespace. You must specify exactly one of `ids` or `delete_all`.

<Warning>
  Delete does not accept a `filter` parameter — text match operators (`$match_phrase`, `$match_all`, `$match_any`) and metadata filter expressions are rejected with a `400` error. To delete documents matching a metadata expression, use [`POST /namespaces/{namespace}/documents/search`](/reference/api/2026-01.alpha/data-plane/search_documents) with a `filter` to get IDs, then pass them to delete.
</Warning>

<RequestExample>
  ```python Python theme={null}
  # pip install --upgrade pinecone
  import os
  from pinecone import Pinecone

  pc = Pinecone(api_key=os.environ["PINECONE_API_KEY"])
  index = pc.preview.index(name="articles")

  NAMESPACE = "example-namespace"

  index.documents.delete(namespace=NAMESPACE, ids=["doc1", "doc2"])

  index.documents.delete(namespace=NAMESPACE, delete_all=True)
  ```

  ```shell curl theme={null}
  PINECONE_API_KEY="YOUR_API_KEY"
  INDEX_HOST="articles-abc123.svc.us-east-1.pinecone.io"

  # EXAMPLE REQUEST 1: Delete by IDs
  curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-Api-Version: 2026-01.alpha" \
    -d '{ "ids": ["doc1", "doc2"] }'

  # EXAMPLE REQUEST 2: Delete all documents in a namespace
  curl "https://$INDEX_HOST/namespaces/__default__/documents/delete" \
    -H "Api-Key: $PINECONE_API_KEY" \
    -H "Content-Type: application/json" \
    -H "X-Pinecone-Api-Version: 2026-01.alpha" \
    -d '{ "delete_all": true }'
  ```
</RequestExample>

<ResponseExample>
  ```jsonc curl theme={null}
  // Status: 202 Accepted
  {}
  ```
</ResponseExample>


## OpenAPI

````yaml https://raw.githubusercontent.com/pinecone-io/pinecone-api/refs/heads/main/2026-01.alpha/db_data_2026-01.alpha.oas.yaml post /namespaces/{namespace}/documents/delete
openapi: 3.0.3
info:
  title: Pinecone Data Plane API
  description: >-
    Pinecone is a vector database that makes it easy to search and retrieve
    billions of high-dimensional vectors.
  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
  version: 2026-01.alpha
servers:
  - url: https://{index_host}
    variables:
      index_host:
        default: unknown
        description: host of the index
security:
  - ApiKeyAuth: []
tags:
  - name: Vector Operations
  - name: Bulk Operations
  - name: Namespace Operations
  - name: Document Operations
externalDocs:
  description: More Pinecone.io API docs
  url: https://docs.pinecone.io/introduction
paths:
  /namespaces/{namespace}/documents/delete:
    post:
      tags:
        - Document Operations
      summary: Delete documents
      description: >-
        Delete documents from a namespace. Exactly one of `ids` or `delete_all`
        must be specified.


        - `ids`: Delete documents with the given IDs.

        - `delete_all`: Delete all documents in the namespace.
      operationId: deleteDocuments
      parameters:
        - in: header
          name: X-Pinecone-Api-Version
          description: Required date-based version header
          required: true
          schema:
            default: 2026-01.alpha
            type: string
          style: simple
        - in: path
          name: namespace
          description: The namespace to delete documents from.
          required: true
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteDocumentsRequest'
        required: true
      responses:
        '202':
          description: The delete request was successfully accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteDocumentsResponse'
        '400':
          description: Bad request. The request body included invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
        4XX:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
        5XX:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
components:
  schemas:
    DeleteDocumentsRequest:
      example:
        ids:
          - doc-1
          - doc-2
      description: >-
        The request for the `delete_documents` operation. Exactly one of `ids`
        or `delete_all` must be specified.
      type: object
      properties:
        ids:
          description: >-
            A list of document IDs to delete. Mutually exclusive with
            `delete_all`.
          type: array
          items:
            type: string
          minItems: 1
          maxItems: 1000
        delete_all:
          description: >-
            If `true`, delete all documents in the namespace. Mutually exclusive
            with `ids`.
          type: boolean
    DeleteDocumentsResponse:
      example: {}
      description: The response for the `delete_documents` operation.
      type: object
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    protobufAny:
      type: object
      properties:
        typeUrl:
          type: string
        value:
          type: string
          format: byte
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: >-
        An API Key is required to call Pinecone APIs. Get yours from the
        [console](https://app.pinecone.io/).

````