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

# aggregate detectors

> !!!IMPORTANT!!! Use with caution, because usage with JOIN can require aggregate with 'distinct'



## OpenAPI

````yaml /openapi.json post /api/v1/detector/aggregation
openapi: 3.0.3
info:
  title: Extractor Project (dev)
  version: 0.0.649
servers: []
security: []
paths:
  /api/v1/detector/aggregation:
    post:
      tags:
        - Detector Route
      summary: aggregate detectors
      description: >-
        !!!IMPORTANT!!! Use with caution, because usage with JOIN can require
        aggregate with 'distinct'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryAggregationRequestDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: {}
      security:
        - SecurityScheme: []
components:
  schemas:
    QueryAggregationRequestDto:
      required:
        - agg
      type: object
      properties:
        agg:
          description: >-
            Aggregation functions with fields to aggregate. Represent SQL
            'select' in 'group by' query. !!!IMPORTANT!!! Use with caution,
            because usage with JOIN can require aggregate with 'distinct'
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/AggregationDto'
          example:
            - func:
                - count
                - '1'
        where:
          description: Query string to search for data. Represent SQL 'where'
          type: string
          example: field1='value' and field2<>'value2'
        groupBy:
          description: Group by parameter for aggregation query
          type: array
          items:
            type: string
        sort:
          description: Sorting for the search
          type: array
          items:
            $ref: '#/components/schemas/SortDto'
        from:
          format: int32
          description: Starting document offset
          minimum: 0
          type: integer
          example: 0
        size:
          format: int32
          description: The number of hits to return
          maximum: 10000
          minimum: 0
          type: integer
          example: 10
    AggregationDto:
      required:
        - func
      type: object
      properties:
        func:
          description: Aggregation functions
          minItems: 2
          type: array
          items:
            type: string
          example:
            - count
            - '1'
    SortDto:
      required:
        - field
      type: object
      properties:
        field:
          description: Field name for sorting
          pattern: \S
          type: string
          example: timestamp
        order:
          description: 'Order for the sorting. Default: ASC'
          type: string
          allOf:
            - $ref: '#/components/schemas/SortOrder'
    SortOrder:
      enum:
        - Asc
        - Desc
      type: string
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: bearer
      bearerFormat: JWT

````