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

# List billable metrics

> List aggregates with optional filtering, sorting, and pagination.



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /aggregates
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /aggregates:
    get:
      tags:
        - Billable Metrics
      summary: List billable metrics
      description: List aggregates with optional filtering, sorting, and pagination.
      operationId: List-billable-metrics
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The cursor indicating a unique set of results - this should be
              auto generated and you get it from the `next` and `previous`
              fields of the response
            examples:
              - V2VsbCBhcmV1IGN1cmlvdxM=
            title: Cursor
          description: >-
            The cursor indicating a unique set of results - this should be auto
            generated and you get it from the `next` and `previous` fields of
            the response
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: The number of results to return - defaults to 10
            examples:
              - 10
            title: Limit
          description: The number of results to return - defaults to 10
        - name: order
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            examples:
              - order=created_at
            title: Order
        - name: sort_key
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            examples:
              - sort_key=id
            default: created_at
            title: Sort Key
        - name: sort_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            examples:
              - sort_key=asc
            default: DESC
            title: Sort Type
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Id
        - name: id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Id  In
        - name: id__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Id  Isnull
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name
        - name: name__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name  Ilike
        - name: name__like
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name  Like
        - name: name__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name  In
        - name: name__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Name  Isnull
        - name: datasource
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Datasource
        - name: datasource__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Datasource  In
        - name: datasource__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Datasource  Isnull
        - name: created_at
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At
        - name: created_at__neq
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At  Neq
        - name: created_at__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At  Gt
        - name: created_at__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At  Gte
        - name: created_at__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At  Lt
        - name: created_at__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Created At  Lte
        - name: created_at__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Created At  Isnull
        - name: created_at__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created At  In
        - name: parent_aggregate_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Parent Aggregate Id
        - name: parent_aggregate_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Parent Aggregate Id  In
        - name: parent_aggregate_id__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Parent Aggregate Id  Isnull
        - name: aggregate_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AggregateType'
              - type: 'null'
            title: Aggregate Type
        - name: aggregate_type__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Aggregate Type  In
        - name: aggregate_type__isnull
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Aggregate Type  Isnull
        - name: version
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Version
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PaginatedResults_GetAggregateResponseSchema_
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AggregateType:
      type: string
      enum:
        - usage_report
      title: AggregateType
    PaginatedResults_GetAggregateResponseSchema_:
      properties:
        next:
          anyOf:
            - type: string
            - type: 'null'
          title: Next
          description: The cursor for the next page of results
          examples:
            - V2VsbCBhcmV1IGN1cmlvdxM=
        previous:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous
          description: The cursor for the previous page of results
          examples:
            - GmBsbCBhcmV1IGN1cmlvdxM=
        total_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Count
          description: The total count of rows
        results:
          items:
            $ref: '#/components/schemas/GetAggregateResponseSchema'
          type: array
          title: Results
          description: The results for the current page
      type: object
      required:
        - results
      title: PaginatedResults[GetAggregateResponseSchema]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GetAggregateResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: aggregate Id
        name:
          type: string
          title: Name
          description: name of the aggregate
        dataschema:
          type: string
          title: Dataschema
          description: data schema of aggregate
        aggregation_query:
          type: string
          title: Aggregation Query
          description: aggregate query
        cust_agg_query:
          type: string
          title: Cust Agg Query
          description: customer aggregate query
        visual_query_builder:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Visual Query Builder
          description: visual query builder
        datasource:
          type: string
          format: uuid
          title: Datasource
          description: data source uuid
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Created_at
      type: object
      required:
        - id
        - name
        - dataschema
        - aggregation_query
        - cust_agg_query
        - visual_query_builder
        - datasource
      title: GetAggregateResponseSchema
      description: Aggregate Response Schema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````