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

# ListLogAggregations



## OpenAPI

````yaml /docs/api/openapi/logs_openapi.json post /core.v1.LogsService/ListLogAggregations
openapi: 3.1.0
info:
  title: core.v1.LogsService
  version: 0.0.1
servers:
  - url: https://api.joinformal.com
    description: Production API
security: []
tags:
  - name: core.v1.LogsService
paths:
  /core.v1.LogsService/ListLogAggregations:
    post:
      tags:
        - core.v1.LogsService
      summary: ListLogAggregations
      operationId: core.v1.LogsService.ListLogAggregations
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/core.v1.ListLogAggregationsRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.v1.ListLogAggregationsResponse'
        '400':
          description: Bad Request - Invalid request parameters or body
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: invalid_request
                  message:
                    type: string
                    example: Invalid request parameters
                  details:
                    type: object
        '401':
          description: Unauthorized - Missing or invalid authentication
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: unauthorized
                  message:
                    type: string
                    example: Authentication required
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: forbidden
                  message:
                    type: string
                    example: Insufficient permissions to perform this action
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: not_found
                  message:
                    type: string
                    example: Resource not found
        '500':
          description: Internal Server Error - An error occurred processing the request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: internal_error
                  message:
                    type: string
                    example: An internal error occurred
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: cURL
          source: >-
            curl -X POST
            "https://api.joinformal.com/core.v1.LogsService/ListLogAggregations"
            \
              -H "X-API-KEY: YOUR_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "example": "value"
              }'
        - lang: javascript
          label: JavaScript (fetch)
          source: >-
            fetch("https://api.joinformal.com/core.v1.LogsService/ListLogAggregations",
            {
              method: "POST",
              headers: {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
              },
              body: JSON.stringify({
                example: "value"
              })
            })
              .then(response => response.json())
              .then(data => console.log(data))
              .catch(error => console.error(error));
        - lang: python
          label: Python
          source: >-
            import requests


            url =
            "https://api.joinformal.com/core.v1.LogsService/ListLogAggregations"

            headers = {
                "X-API-KEY": "YOUR_API_KEY",
                "Content-Type": "application/json"
            }

            data = {
                "example": "value"
            }


            response = requests.post(url, headers=headers, json=data)

            print(response.json())
        - lang: go
          label: Go
          source: |-
            package main

            import (
                "bytes"
                "encoding/json"
                "fmt"
                "io"
                "net/http"
            )

            func main() {
                url := "https://api.joinformal.com/core.v1.LogsService/ListLogAggregations"

                body := map[string]string{
                    "example": "value",
                }

                jsonData, _ := json.Marshal(body)

                req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
                req.Header.Set("X-API-KEY", "YOUR_API_KEY")
                req.Header.Set("Content-Type", "application/json")

                client := &http.Client{}
                resp, err := client.Do(req)
                if err != nil {
                    panic(err)
                }
                defer resp.Body.Close()

                responseBody, _ := io.ReadAll(resp.Body)
                fmt.Println(string(responseBody))
            }
components:
  schemas:
    core.v1.ListLogAggregationsRequest:
      type: object
      properties:
        query:
          type: string
          title: query
        startTimestamp:
          type: string
          title: start_timestamp
          minLength: 1
        endTimestamp:
          type: string
          title: end_timestamp
          minLength: 1
        histogramInterval:
          type: string
          title: histogram_interval
        histogramGroupByFields:
          type: array
          items:
            type: string
            maxItems: 3
          title: histogram_group_by_fields
          maxItems: 3
        mode:
          type: string
          title: mode
          enum:
            - field_aggregations_only
            - logs_over_time_only
          nullable: true
      title: ListLogAggregationsRequest
      additionalProperties: false
    core.v1.ListLogAggregationsResponse:
      type: object
      properties:
        aggregations:
          $ref: '#/components/schemas/core.v1.ListLogsResponse.Aggregations'
          title: aggregations
        numHits:
          type:
            - integer
            - string
          title: num_hits
          format: int64
      title: ListLogAggregationsResponse
      additionalProperties: false
    core.v1.ListLogsResponse.Aggregations:
      type: object
      properties:
        logsOverTime:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.DateBucket'
          title: logs_over_time
        sessionTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: session_types
        sessionIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: session_ids
        sessionApplicationNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: session_application_names
        sessionClientIpAddresses:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: session_client_ip_addresses
        sessionServerIpAddresses:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: session_server_ip_addresses
        queryFingerprints:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: query_fingerprints
        queryNormalized:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: query_normalized
        queryReceived:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: query_received
        querySent:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: query_sent
        resourceIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: resource_ids
        resourceNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: resource_names
        resourceTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: resource_types
        resourceHostnames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: resource_hostnames
        resourceTechnologies:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: resource_technologies
        connectorNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: connector_names
        connectorIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: connector_ids
        spaceNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: space_names
        spaceIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: space_ids
        userTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_types
        userSubTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_sub_types
        userEmails:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_emails
        userUsernames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_usernames
        userIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_ids
        endUserTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: end_user_types
        endUserNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: end_user_names
        endUserEmails:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: end_user_emails
        triggeredPolicyIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: triggered_policy_ids
        triggeredPolicyNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: triggered_policy_names
        triggeredPolicyStatuses:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: triggered_policy_statuses
        triggeredPolicyTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: triggered_policy_types
        responseDataVolumes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_data_volumes
        responseReturnedColumnNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_returned_column_names
        responseReturnedColumnPaths:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_returned_column_paths
        responseReturnedColumnDataLabels:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_returned_column_data_labels
        responseRowsSent:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_rows_sent
        responseRowsReceived:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: response_rows_received
        deviceSystemVersions:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_system_versions
        deviceKernelVersions:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_kernel_versions
        deviceComputerNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_computer_names
        deviceUserNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_user_names
        deviceModelNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_model_names
        deviceModelIdentifiers:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_model_identifiers
        deviceModelNumbers:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_model_numbers
        deviceSerialNumbers:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: device_serial_numbers
        userGroups:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: user_groups
        endUserGroups:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: end_user_groups
        controlPlaneCommandNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_command_names
        controlPlaneCommandTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_command_types
        controlPlanePolicyActions:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_policy_actions
        controlPlaneServices:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_services
        controlPlaneMethods:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_methods
        controlPlaneUserEmails:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_user_emails
        controlPlaneUserTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_user_types
        controlPlaneUserIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_user_ids
        controlPlaneUserAwsPrincipalArns:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_user_aws_principal_arns
        controlPlaneUserAwsAccountIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: control_plane_user_aws_account_ids
        workflowIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: workflow_ids
          description: Workflow fields
        workflowNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: workflow_names
        stepNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: step_names
        stepTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: step_types
        triggerTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: trigger_types
        triggerNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: trigger_names
        triggerUserEmails:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: trigger_user_emails
        triggerUserTypes:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: trigger_user_types
        triggerUserIds:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: trigger_user_ids
        llmToolCallNames:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: llm_tool_call_names
          description: LLM / Agent fields
        llmModels:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: llm_models
        llmProviders:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: llm_providers
        llmStopReasons:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.Bucket'
          title: llm_stop_reasons
      title: Aggregations
      additionalProperties: false
    core.v1.ListLogsResponse.DateBucket:
      type: object
      properties:
        datetime:
          type: string
          title: datetime
        count:
          type: integer
          title: count
          format: int32
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.GroupByBucket'
          title: buckets
      title: DateBucket
      additionalProperties: false
    core.v1.ListLogsResponse.Bucket:
      type: object
      properties:
        key:
          type: string
          title: key
        count:
          type: integer
          title: count
          format: int32
      title: Bucket
      additionalProperties: false
    core.v1.ListLogsResponse.GroupByBucket:
      type: object
      properties:
        key:
          type: string
          title: key
        count:
          type: integer
          title: count
          format: int32
        buckets:
          type: array
          items:
            $ref: '#/components/schemas/core.v1.ListLogsResponse.GroupByBucket'
          title: buckets
      title: GroupByBucket
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key authentication. Get your API key from the Formal console.

````