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

# Preview Chart

> Execute an ad-hoc query without saving (for the chart builder preview).



## OpenAPI

````yaml /openapi.json post /api/analytics/charts/preview
openapi: 3.1.0
info:
  description: >-
    Build and run voice assistants: configure an assistant, give it tools,
    knowledge and playbooks, place and read calls, and manage contacts,
    campaigns and analytics.


    Authenticate every request with an API key as a bearer token. See the API
    introduction for the response envelope, pagination and error shapes.
  title: Qall API
  version: 0.1.0
servers:
  - description: Production
    url: https://qall.io
security: []
paths:
  /api/analytics/charts/preview:
    post:
      tags:
        - analytics
      summary: Preview Chart
      description: Execute an ad-hoc query without saving (for the chart builder preview).
      operationId: preview_chart_api_analytics_charts_preview_post
      parameters:
        - description: 'Period override: 7d, 30d, or custom:YYYY-MM-DD:YYYY-MM-DD'
          in: query
          name: period
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Period override: 7d, 30d, or custom:YYYY-MM-DD:YYYY-MM-DD'
            title: Period
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChartQueryRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    ChartQueryRequest:
      description: For preview — same as ChartConfig but standalone.
      properties:
        compare_previous_period:
          default: false
          title: Compare Previous Period
          type: boolean
        date_range:
          anyOf:
            - enum:
                - 1h
                - 24h
                - 7d
                - 30d
                - 90d
                - 12m
                - all
              type: string
            - $ref: '#/components/schemas/CustomDateRange'
          default: 30d
          title: Date Range
        granularity:
          anyOf:
            - enum:
                - hour
                - day
                - week
                - month
              type: string
            - type: 'null'
          default: day
          title: Granularity
        group_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Group By
        limit:
          default: 50
          maximum: 500
          minimum: 1
          title: Limit
          type: integer
        queries:
          items:
            $ref: '#/components/schemas/QueryDef'
          maxItems: 5
          minItems: 1
          title: Queries
          type: array
        sort:
          anyOf:
            - $ref: '#/components/schemas/SortConfig'
            - type: 'null'
      required:
        - queries
      title: ChartQueryRequest
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CustomDateRange:
      properties:
        from:
          title: From
          type: string
        to:
          title: To
          type: string
      required:
        - from
        - to
      title: CustomDateRange
      type: object
    QueryDef:
      properties:
        column:
          title: Column
          type: string
        filters:
          items:
            $ref: '#/components/schemas/QueryFilter'
          title: Filters
          type: array
        id:
          default: A
          maxLength: 5
          title: Id
          type: string
        operation:
          title: Operation
          type: string
        table:
          title: Table
          type: string
      required:
        - table
        - column
        - operation
      title: QueryDef
      type: object
    SortConfig:
      properties:
        by:
          default: value
          enum:
            - value
            - label
          title: By
          type: string
        direction:
          default: desc
          enum:
            - asc
            - desc
          title: Direction
          type: string
      title: SortConfig
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    QueryFilter:
      properties:
        column:
          title: Column
          type: string
        operator:
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - not_in
            - is_null
            - is_not_null
          title: Operator
          type: string
        value:
          anyOf:
            - {}
            - type: 'null'
          title: Value
        values:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Values
      required:
        - column
        - operator
      title: QueryFilter
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.