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

# analytics.datalake



## OpenAPI

````yaml POST /analytics/datalake
openapi: 3.1.0
info:
  title: Supersonic CRM API
  description: 62 tools for managing your CRM data. Call via CLI, REST, or MCP.
  version: 1.0.0
servers:
  - url: https://api.supersonic.cv
    description: Production
security:
  - bearerAuth: []
paths:
  /analytics/datalake:
    post:
      tags:
        - analytics
      summary: >-
        Aggregate datalake models (activities, communications, meetings, tasks,
        documents, support_tickets, billing_records). Supports count/sum/avg,
        group_by model fields, and time bucketing.
      operationId: analytics.datalake
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - activities
                    - communications
                    - meetings
                    - tasks
                    - documents
                    - support_tickets
                    - billing_records
                  description: Datalake model to aggregate
                metrics:
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      agg:
                        type: string
                        enum:
                          - count
                          - sum
                          - avg
                          - min
                          - max
                    required:
                      - field
                      - agg
                filters:
                  type: object
                group_by:
                  type: string
                record_id:
                  type: string
                  description: Filter by linked record UUID
                time_field:
                  type: string
                time_range:
                  type: object
                  properties:
                    from:
                      type: string
                    to:
                      type: string
                time_bucket:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                    - quarter
                    - year
              required:
                - model
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Validation error
        '403':
          description: Permission denied
        '429':
          description: Rate limit exceeded
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key: supersonic_live_...'

````