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

# Multi query items from Auto Indexing source groups

> Note: This endpoint is currently in preview

The Query API is used to query items in an index, this endpoint lets you query items ingested to Auto Indexing source groups with up to 5 queries requested in a single payload, each query defining the source groups alias and source entity type to perform the lookup in.




## OpenAPI

````yaml /enterspeed/enterspeedv1Api.yaml post /v1/source
openapi: 3.0.0
info:
  version: 0.4.0
  title: API documentation
  description: >-
    The Enterspeed API are based on REST principles.


    Before you start you will need to [create an
    Enterspeed-account](https://app.enterspeed.com) and set up a tenant (a
    property for your website). Here you can create

    - A data source (provides you with an API key for the **Ingest API**).

    - An environment client (provides you with an API key for the **Delivery
    API** and **Query API**).

    - A domain (ensure the correct data gets fetched).


    🎉 Have fun using our API. Make sure to [contact
    us](https://www.enterspeed.com/contact) if you need any help. We're happy
    assist!
  x-logo:
    url: https://docs.enterspeed.com/img/logo.svg
    altText: Enterspeed Logo
  license:
    name: See Enterspeed Terms of service
    url: https://www.enterspeed.com/terms-of-service
servers:
  - url: https://api.enterspeed.com
    description: General API
security: []
tags:
  - name: Delivery
    description: >-
      The Delivery API is what you use to `GET` your data from Enterspeed to
      your frontend project. Before you can fetch your content from Enterspeed,
      you first need to create an **Environment client** which generates an API
      key. This is done under *Settings --> Environment settings*.


      You can find an example of how to fetch data [Umbraco & Next.js
      tutorial](https://docs.enterspeed.com/tutorials/umbraco-nextjs/fetching-data-in-nextjs).
  - name: Ingest
    description: >-
      The Ingest API is used to `POST` your current data sources into
      Enterspeed. Before you can start ingesting data, you'll need to create a
      **Data source** inside Enterspeed, which generates an API key. This is
      done under *Settings --> Data sources*.


      The Ingest API can also be used to `DELETE` already ingested data from
      Enterspeed.
  - name: Routes
    description: >-
      The Routes API is what you use to `GET` all available URL routes for a
      specific environment, which can be helpful for SSG (Static Site
      Generation) or creating a sitemap.


      Before you can fetch your routes from Enterspeed, you first need to create
      an **Environment client** which generates an API key. This is done under
      *Settings --> Environment settings*.


      **ℹ NOTE:** The `first` or `last` parameter is required and must be set
      between 100 - 500 (e.g. `first=250`). Both are not allowed at the same
      time.
  - name: Query
    description: >-
      The Query API is what you use to query items from your indexes.


      Before you can query your indexes from Enterspeed, you first need to
      create an **Environment client** which generates an API key. This is done
      under *Settings --> Environment settings*.
paths:
  /v1/source:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      tags:
        - Query
      summary: Multi query items from Auto Indexing source groups
      description: >
        Note: This endpoint is currently in preview


        The Query API is used to query items in an index, this endpoint lets you
        query items ingested to Auto Indexing source groups with up to 5 queries
        requested in a single payload, each query defining the source groups
        alias and source entity type to perform the lookup in.
      operationId: queryMultiAutoIndexingPost
      parameters:
        - name: X-Api-Key
          required: true
          in: header
          description: Api key to validate your environment.
          schema:
            type: string
            example: environment-1637c4d0-e878-4738-b866-152106a4f88c
        - name: Content-Length
          required: true
          in: header
          description: >
            The length of the message body, in bytes (this header is
            automatically added by most clients).
          schema:
            type: number
      requestBody:
        description: >
          The query consists of a list of query objects, on the format just like
          when [quering items in a single
          index](#tag/Query/operation/queryContentPost), so refer to this
          section when looking into `filters`, `sorting`, `pagination` etc.


          The only thing that differs with these query objects, is an addition
          of an `sourceGroupAlias`, `sourceEntityType` and a `name` fields, so
          you per query can define which index you want to perform the query
          against and also name the individual query. This means that this
          service can perform multiple queries on the same index, or perform
          queries on multiple indicies in one request, and also give you the
          ability to name queries for easier identification of the resulting
          result sets.


          ### Note

          The request payload can at most take 5 queries in one request. 
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestMultiAutoIndexing'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryMultiAutoIndexingListResponse'
                type: object
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400AutoIndexingResponseList'
        '401':
          description: Unauthorized. Missing X-Api-Key header or the X-Api-Key is invalid.
        '403':
          description: Forbidden. The API key does not have the necessary permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query403Response'
components:
  schemas:
    QueryRequestMultiAutoIndexing:
      type: array
      description: >-
        List consisting of multiple queries using the extended query object
        format.
      example:
        - sourceGroupAlias: erp
          sourceEntityType: price
          name: priceData
          filters:
            and:
              - field: sku
                operator: equals
                value: p-1234
                caseInsensitive: true
          facets:
            - name: Is promotional
              field: isPromotional
              size: 20
          sort:
            - field: salesPrice
              order: desc
          pagination:
            page: 0
            pageSize: 20
        - sourceGroupAlias: erp
          sourceEntityType: inventory
          name: inventoryData
          filters:
            and:
              - field: locationId
                operator: equals
                value: warehouse-01
                caseInsensitive: true
          facets:
            - name: Location
              field: locationId
              size: 20
          sort:
            - field: stockAmount
              order: desc
          pagination:
            page: 0
            pageSize: 20
    QueryMultiAutoIndexingListResponse:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/QueryMultiAutoIndexingResponse'
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtendedMultiAutoIndexing'
          - $ref: '#/components/schemas/Query403ResponseExtendedMultiAutoIndexing'
    Query400AutoIndexingResponseList:
      type: array
      items:
        oneOf:
          - $ref: '#/components/schemas/Query400Response'
          - $ref: '#/components/schemas/Query400ResponseExtendedMultiAutoIndexing'
    Query403Response:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
    QueryMultiAutoIndexingResponse:
      type: object
      properties:
        status:
          type: number
          example: 0
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        totalResults:
          type: number
          example: 200
          description: The total number of results matched by query.
        results:
          type: array
          description: |
            List of items from the index matched by the query provided.

            Built in fields are prefixed with underscore (`_`).
          items:
            type: object
            example:
              sku: p-1234
              salesPrice: 20.5
              isPromotional: true
              _originId: p-1234
              _sourceGuid: 9f741916-19e3-4791-9ebd-701634ba9b75
              _updatedAt: '2025-01-07T08:43:15.7351089Z'
        facets:
          type: array
          description: List of aggregated field values based on the requested facet fields.
          items:
            type: object
            example:
              name: Is promotional
              field: isPromotional
              groups:
                - value: true
                  count: 85
                - value: false
                  count: 115
              isValid: true
        nextPageToken:
          type: string
          nullable: true
          description: >-
            Continuation token for the next page of results. Pass this value in
            the `pagination.nextPageToken` field of the next request. `null`
            when no further results exist.
          example: WyIyMDI0LTAxLTAxIiwiYWJjMTIzIl0=
    Query400Response:
      type: object
      properties:
        message:
          type: string
          description: Erros message
          example: Query is not valid
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: 'Operator not implemented: equal'
        status:
          type: number
          example: 0
    Query400ResponseExtendedMultiAutoIndexing:
      type: object
      properties:
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Query is not valid
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: 'Operator not implemented: equal'
        status:
          type: number
          example: 0
    Query403ResponseExtendedMultiAutoIndexing:
      type: object
      properties:
        sourceGroupAlias:
          type: string
          example: erp
          description: >-
            The source group alias which were given for the query in the
            request.
        sourceEntityType:
          type: string
          example: price
          description: >-
            The source entity type which were given for the query in the
            request.
        name:
          type: string
          example: productData
          description: The query name which were given for the query in the request.
        message:
          type: string
          description: Erros message
          example: Forbidden
        errors:
          type: array
          description: List of errors
          items:
            type: string
            example: Forbidden
        status:
          type: number
          example: 1

````