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

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




## OpenAPI

````yaml /enterspeed/enterspeedv1Api.yaml post /v1/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}
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/sourceGroupAlias/{sourceGroupAlias}/type/{sourceEntityType}:
    servers:
      - url: https://query.enterspeed.com
        description: Query API
    post:
      tags:
        - Query
      summary: 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.
      operationId: queryAutoIndengPost
      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 uses the same format as the [Query items
          endpoint](#tag/Query/operation/queryContentPost) with the only
          exeption that `aliases` is not supported here.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryRequestAutoIndexing'
      responses:
        '200':
          description: Valid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueryAutoIndexingResponse'
                type: object
        '400':
          description: >-
            Invalid request. Server responded but the request was in an invalid
            format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Query400Response'
        '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:
    QueryRequestAutoIndexing:
      type: object
      example:
        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
    QueryAutoIndexingResponse:
      type: object
      properties:
        status:
          type: number
          example: 0
        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-5427
              stockAmount: 20
              locationId: warehouse-01
              _originId: p-5427
              _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: Location
              field: locationId
              groups:
                - value: warehouse-01
                  count: 95
                - value: warehouse-02
                  count: 78
              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
    Query403Response:
      type: object
      properties:
        error:
          type: string
          example: Forbidden

````