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

# Delete Vectors

> Delete documents from a vector store by document IDs or metadata filter criteria.

**Delete by IDs:** Provide an array of document IDs to delete specific documents. Non-existent documents
are silently skipped.

**Delete by Filter:** Use metadata filters to delete all documents matching the specified criteria (e.g.,
delete all documents where `status: "archived"`). The filter must specify at least one condition and cannot
be empty. To delete all documents, use the drop endpoint instead.

**Filter Operators:** Supports MongoDB-style operators including equality (`{"field": "value"}`),
comparison (`$gt`, `$gte`, `$lt`, `$lte`, `$eq`, `$ne`), logical (`$and`, `$or`, `$not`),
and membership (`$in`, `$nin`). Only indexed metadata fields can be used for filtering.

**Best Practice:** Use the count endpoint with the same filter to preview the number of documents that
will be deleted before executing the deletion operation.



## OpenAPI

````yaml https://api.dev-sgp.scale.com/openapi-versions/v5/openapi.json post /v5/vector-stores/{vector_store_name}/delete
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/vector-stores/{vector_store_name}/delete:
    post:
      tags:
        - Vector Stores
      summary: Delete Vectors
      description: >-
        Delete documents from a vector store by document IDs or metadata filter
        criteria.


        **Delete by IDs:** Provide an array of document IDs to delete specific
        documents. Non-existent documents

        are silently skipped.


        **Delete by Filter:** Use metadata filters to delete all documents
        matching the specified criteria (e.g.,

        delete all documents where `status: "archived"`). The filter must
        specify at least one condition and cannot

        be empty. To delete all documents, use the drop endpoint instead.


        **Filter Operators:** Supports MongoDB-style operators including
        equality (`{"field": "value"}`),

        comparison (`$gt`, `$gte`, `$lt`, `$lte`, `$eq`, `$ne`), logical
        (`$and`, `$or`, `$not`),

        and membership (`$in`, `$nin`). Only indexed metadata fields can be used
        for filtering.


        **Best Practice:** Use the count endpoint with the same filter to
        preview the number of documents that

        will be deleted before executing the deletion operation.
      operationId: POST-V5-/v5/vector-stores/vector_store_name/delete
      parameters:
        - name: vector_store_name
          in: path
          required: true
          schema:
            type: string
            description: The name of the vector store
            title: Vector Store Name
          description: The name of the vector store
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteVectorsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteVectorsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    DeleteVectorsRequest:
      properties:
        ids:
          title: Ids
          description: Array of document IDs to delete
          items:
            type: string
          type: array
        filter:
          title: Filter
          description: Metadata filter expression for deletion
          additionalProperties: true
          type: object
      type: object
      title: DeleteVectorsRequest
      description: Request to delete documents by IDs or filter.
    DeleteVectorsResponse:
      properties:
        deleted_count:
          type: integer
          title: Deleted Count
          description: Number of documents deleted
      type: object
      required:
        - deleted_count
      title: DeleteVectorsResponse
      description: Response for delete operation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````