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

# Delete documents by id or filter

> Send `ids` (1-1000 document ids) or `filter` (the query's metadata filter, with at least one
condition). Ids that do not exist are skipped. A filter call deletes whole documents, up to
10,000 chunks of them, and answers `more: true` while matches remain: call again until it is
false. Separate filters can run in parallel. To delete every document, delete the namespace.
A document rewritten during a filter call (and perhaps no longer matching) is not deleted; 409
`conflict` means that happened repeatedly. Any failed call is safe to retry.




## OpenAPI

````yaml /api/openapi.yaml post /namespaces/{namespace}/documents/delete
openapi: 3.1.0
info:
  title: Conare API
  version: '1'
  summary: Store your data, keep it in sync, and return the right context to your AI.
  description: >
    Write documents into namespaces, query them with hybrid search, and connect
    apps that keep

    syncing into a namespace.


    Authenticate with an API key from conare.ai/console/keys:

    `Authorization: Bearer sk-conare-…`. Bodies are JSON with snake_case keys;
    timestamps are

    RFC 3339 strings. Every response carries `X-Request-Id`, and every error has
    the shape

    `{"error": {"code", "message", "request_id"}}`. A 429, and a 503 that clears
    on its own,

    carry `Retry-After` (seconds).


    Conare is also an MCP server at `https://api.conare.ai/mcp` (streamable
    HTTP, same bearer key)

    with the tools `search`, `fetch`, `save`, `delete` and `list_namespaces`.
  contact:
    name: Conare
    url: https://conare.ai
servers:
  - url: https://api.conare.ai
security:
  - apiKey: []
tags:
  - name: Namespaces
    description: >-
      A namespace is a named set of documents, e.g. `docs` or `user-42`. It is
      created by its first write.
  - name: Documents
    description: >-
      A document is `{ id, text, metadata }`. Conare chunks and embeds it.
      Writing the same id replaces it.
  - name: Query
    description: >-
      Hybrid search (vector and keyword) over one namespace, with an optional
      metadata filter, reranked.
  - name: Models
    description: The embedding and reranking models Conare searches with.
  - name: Sources
    description: >
      Apps connected to Conare. Each keeps syncing into one namespace. While
      sources are not

      available, every sources route answers 503 with code
      `sources_unavailable`.
  - name: Health
    description: Service health.
paths:
  /namespaces/{namespace}/documents/delete:
    parameters:
      - $ref: '#/components/parameters/Namespace'
    post:
      tags:
        - Documents
      summary: Delete documents by id or filter
      description: >
        Send `ids` (1-1000 document ids) or `filter` (the query's metadata
        filter, with at least one

        condition). Ids that do not exist are skipped. A filter call deletes
        whole documents, up to

        10,000 chunks of them, and answers `more: true` while matches remain:
        call again until it is

        false. Separate filters can run in parallel. To delete every document,
        delete the namespace.

        A document rewritten during a filter call (and perhaps no longer
        matching) is not deleted; 409

        `conflict` means that happened repeatedly. Any failed call is safe to
        retry.
      operationId: deleteDocuments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    $ref: '#/components/schemas/DocumentId'
                filter:
                  $ref: '#/components/schemas/Filter'
            examples:
              ids:
                value:
                  ids:
                    - refunds
                    - returns
              filter:
                value:
                  filter:
                    team: support
      responses:
        '200':
          description: >-
            How many documents this call deleted, and whether more match the
            filter.
          content:
            application/json:
              schema:
                type: object
                required:
                  - deleted
                  - more
                properties:
                  deleted:
                    type: integer
                  more:
                    type: boolean
                    description: Only a filter call answers true.
              example:
                deleted: 2
                more: false
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
components:
  parameters:
    Namespace:
      name: namespace
      in: path
      required: true
      description: The namespace name.
      schema:
        $ref: '#/components/schemas/NamespaceName'
  schemas:
    DocumentId:
      type: string
      pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$
      description: >-
        1-256 characters of `A-Z a-z 0-9 . _ : -`, starting with a letter or
        digit.
      examples:
        - refunds
        - hubspot:contacts:1042
    Filter:
      type: object
      description: >
        A metadata filter; it matches values exactly. `{"key": value}` means
        equals (a string also

        matches an array holding it); `$eq` is the same and `$in` matches any
        listed value. Combine

        filters with `$and` and `$or` arrays. Values compare as text (`3`
        matches `"3"`). `$ne`,

        `$nin` and the range operators are not supported (400 `invalid_filter`).
      properties:
        $and:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
        $or:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
      additionalProperties:
        oneOf:
          - $ref: '#/components/schemas/FilterValue'
          - $ref: '#/components/schemas/FilterOperators'
      examples:
        - team: support
        - $or:
            - team: support
            - year:
                $in:
                  - 2024
                  - 2025
    NamespaceName:
      type: string
      pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
      description: 1-64 characters of `a-z 0-9 _ -`, starting with a letter or digit.
      examples:
        - docs
        - user-42
    FilterValue:
      oneOf:
        - type: string
        - type: number
        - type: boolean
    FilterOperators:
      type: object
      minProperties: 1
      additionalProperties: false
      properties:
        $eq:
          $ref: '#/components/schemas/FilterValue'
        $in:
          type: array
          minItems: 1
          maxItems: 256
          items:
            $ref: '#/components/schemas/FilterValue'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              description: >
                Stable and machine-readable. 400: `invalid_request`,
                `invalid_json`, `invalid_namespace`,

                `invalid_id`, `invalid_metadata`, `invalid_filter`,
                `invalid_cursor`. 401: `unauthorized`.

                403: `forbidden`. 404: `namespace_not_found`,
                `document_not_found`, `source_not_found`,

                `not_found`. 405: `method_not_allowed`. 413:
                `payload_too_large`. 429: `rate_limited`. 500: `internal_error`.

                502: `upstream_error`. 503: `unavailable`,
                `sources_unavailable`. 504: `timeout`.
            message:
              type: string
            request_id:
              type: string
  responses:
    Error:
      description: An error. `X-Request-Id` is also in the response headers.
      headers:
        X-Request-Id:
          schema:
            type: string
        Retry-After:
          description: >-
            On 429, and on a 503 that clears on its own, seconds to wait before
            retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: text is required
              request_id: 7d0f4c1e-2b8a-4e39-9a61-3c5e8b2f9d04
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sk-conare-…
      description: >-
        An API key from conare.ai/console/keys. It can read and write every
        namespace in its organization.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.