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

# Query every namespace

> The same hybrid search as a namespace query, across the organization's namespaces (the
first 10; with `prefix`, the first 10 whose name starts with it; a scoped key, those it
reaches), merged and reranked once. Each result names its namespace. A passage that repeats
a higher-ranked one is dropped. Counts as one query.




## OpenAPI

````yaml /api/openapi.yaml post /query
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/dashboard/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). A key that cannot be checked (the key store
    is unavailable and

    the key was not seen in the last 15 minutes) answers 503 `unavailable`.

    A request that does not finish in time (searches, embeds and reranks in 60
    s, writes in 110 s)

    answers 503 `timeout` with `Retry-After`. A write that timed out may have
    applied in part; sending

    it again is safe (a document sent with `if_version` that already landed
    answers `version_conflict`).

    A successful response that lost something on the way (its rerank, a
    retriever, its primary

    embedding origin) says so in `Conare-Degraded`.


    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 and exists while it holds documents: a namespace whose documents are
      all deleted is not

      listed, and querying or listing it answers 404 `namespace_not_found`, like
      a name never written.
  - 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:
  /query:
    post:
      tags:
        - Query
      summary: Query every namespace
      description: >
        The same hybrid search as a namespace query, across the organization's
        namespaces (the

        first 10; with `prefix`, the first 10 whose name starts with it; a
        scoped key, those it

        reaches), merged and reranked once. Each result names its namespace. A
        passage that repeats

        a higher-ranked one is dropped. Counts as one query.
      operationId: queryAll
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  minLength: 1
                  maxLength: 8000
                  description: What to search for
                  in plain language.: null
                top_k:
                  type: integer
                  minimum: 1
                  maximum: 100
                  default: 10
                  description: How many results to return.
                filter:
                  $ref: '#/components/schemas/Filter'
                rerank:
                  type: boolean
                  default: true
                  description: Rerank the candidates with the reranking model.
                rerank_depth:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: As in a namespace query.
                retrievers:
                  type: array
                  minItems: 1
                  maxItems: 3
                  items:
                    type: string
                    enum:
                      - vector
                      - keyword
                      - sparse
                  default:
                    - vector
                    - keyword
                  description: As in a namespace query.
                prefix:
                  type: string
                  pattern: ^[a-z0-9][a-z0-9_-]{0,63}$
                  description: >-
                    Search only the namespaces whose name starts with this, e.g.
                    one user's.
            example:
              query: how do refunds work?
              top_k: 5
      responses:
        '200':
          description: Results, best first, and the namespaces searched.
          headers:
            Conare-Degraded:
              $ref: '#/components/headers/ConareDegraded'
          content:
            application/json:
              schema:
                type: object
                required:
                  - results
                  - namespaces
                  - took_ms
                properties:
                  results:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/QueryResult'
                        - type: object
                          required:
                            - namespace
                          properties:
                            namespace:
                              type: string
                  namespaces:
                    type: array
                    items:
                      type: string
                    description: The namespaces searched.
                  took_ms:
                    type: integer
                    description: Time spent in Conare, in milliseconds.
              example:
                results:
                  - namespace: support
                    id: refunds
                    text: Refunds are available for 30 days after purchase.
                    score: 0.91
                    reranked: true
                    metadata:
                      team: support
                namespaces:
                  - support
                  - wiki
                took_ms: 58
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '429':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Error'
components:
  schemas:
    Filter:
      type: object
      description: >
        A metadata filter. `{"key": value}` means equals (a string also matches
        an array holding

        it); `$eq` is the same and `$in` matches any listed value. Equality
        compares as text (`3`

        matches `"3"`). `$gt`, `$gte`, `$lt` and `$lte` (one per side) compare a
        number or string

        value, not an array item: number bounds compare numbers, string bounds
        compare strings by

        their UTF-8 bytes (ISO dates sort as dates); a value of the other type
        never matches.

        Strings longer than about 220 bytes cannot be compared. Combine filters
        with `$and` and

        `$or` arrays. `$ne` and `$nin` 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
        - year:
            $gte: 2020
            $lt: 2025
        - published_at:
            $gte: '2025-06-01'
    QueryResult:
      type: object
      required:
        - id
        - text
        - score
        - reranked
        - metadata
      properties:
        id:
          $ref: '#/components/schemas/DocumentId'
        text:
          type: string
          description: The document's best matching passage.
        score:
          type: number
          description: >-
            Higher is better. With `reranked` it is the reranking model's score;
            otherwise it is the fused rank score of the hybrid search. The two
            scales do not compare.
        reranked:
          type: boolean
          description: >-
            The reranking model scored this result. False for results past the
            rerank window (the first 20 passages of the fused candidates, of
            which the model reads what fits 6,656 tokens), when the query asked
            for no rerank, or when reranking failed or ran out of time and the
            fused order stands.
        metadata:
          $ref: '#/components/schemas/Metadata'
    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: 255
          description: >-
            Counts one condition per value plus one for the list, toward the
            filter's 256: at most 255 values alone, fewer next to other
            conditions.
          items:
            $ref: '#/components/schemas/FilterValue'
        $gt:
          $ref: '#/components/schemas/RangeBound'
        $gte:
          $ref: '#/components/schemas/RangeBound'
        $lt:
          $ref: '#/components/schemas/RangeBound'
        $lte:
          $ref: '#/components/schemas/RangeBound'
    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
    Metadata:
      type: object
      maxProperties: 32
      description: >-
        Up to 32 keys and 256 tags in all (each array item and boolean counts
        one, each number or string two, one to match and one to compare). Values
        are strings, numbers, booleans or arrays of strings.
      additionalProperties:
        oneOf:
          - type: string
          - type: number
          - type: boolean
          - type: array
            items:
              type: string
    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`, `namespace_forbidden`. 404:
                `namespace_not_found`, `document_not_found`, `source_not_found`,

                `not_found`. 405: `method_not_allowed`. 409: `version_conflict`,
                `conflict`.

                413: `payload_too_large`. 429: `rate_limited`. 500:
                `internal_error`.

                502: `upstream_error`. 503: `unavailable`,
                `sources_unavailable`, `timeout`.
            message:
              type: string
            request_id:
              type: string
    RangeBound:
      description: >-
        A number, or a string of at most about 220 bytes; one key's bounds are
        all numbers or all strings.
      oneOf:
        - type: number
        - type: string
  headers:
    ConareDegraded:
      description: >-
        Present only when this request degraded: a comma-separated list of
        `rerank` (reranking failed or timed out; the results are in fused order
        and carry `reranked: false`), `embed` (the query could not be embedded;
        searched without the `vector` retriever), `sparse` (the query could not
        be sparse-encoded; searched without the `sparse` retriever) and
        `embed-fallback` (a fallback origin of the same embedding model embedded
        the request: the vectors are identical, the primary was unavailable).
        New values may be added.
      schema:
        type: string
      example: rerank,embed-fallback
  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/dashboard/keys. A key reaches every namespace
        in its organization, unless it was made scoped to some namespaces (exact
        names, or prefixes ending in `*` such as `tenant-*`): then every other
        namespace answers 403 `namespace_forbidden`, lists and cross-namespace
        queries leave them out, and the sources routes answer 403 `forbidden`.

````

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