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



## OpenAPI

````yaml POST /analytics/records
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/records:
    post:
      tags:
        - analytics
      summary: >-
        Aggregate records by ObjectType. Supports sum/avg/min/max/count on JSONB
        fields, group_by, time bucketing (day/week/month/quarter/year), and
        filters.
      operationId: analytics.records
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                object_type:
                  type: string
                  description: ObjectType slug to aggregate
                metrics:
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                        description: Field slug or '*'
                      agg:
                        type: string
                        enum:
                          - count
                          - sum
                          - avg
                          - min
                          - max
                    required:
                      - field
                      - agg
                  description: Aggregation metrics
                filters:
                  type: object
                  description: 'Field filters (field__op: value)'
                group_by:
                  type: string
                  description: Field slug to group by
                time_field:
                  type: string
                  description: Date field slug for time filtering
                time_range:
                  type: object
                  properties:
                    from:
                      type: string
                      description: ISO date start
                    to:
                      type: string
                      description: ISO date end
                time_bucket:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                    - quarter
                    - year
              required:
                - object_type
                - metrics
      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_...'

````