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

# Create a time-series chart



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/charts/shortcuts/timeseries
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /api/v1/charts/shortcuts/timeseries:
    post:
      tags:
        - charts
        - charts
        - shortcuts
      summary: Create a time-series chart
      operationId: create_timeseries_api_v1_charts_shortcuts_timeseries_post
      parameters:
        - name: title
          in: query
          required: true
          schema:
            type: string
            title: Title
        - name: name
          in: query
          required: true
          schema:
            type: string
            title: Name
        - name: query
          in: query
          required: true
          schema:
            type: string
            title: Query
        - name: time_field
          in: query
          required: false
          schema:
            type: string
            default: ts
            title: Time Field
        - name: organization_id
          in: query
          required: true
          schema:
            type: string
            title: Organization Id
        - name: project_id
          in: query
          required: false
          schema:
            type: string
            title: Project Id
            default: thaink2
        - name: refresh_interval
          in: query
          required: false
          schema:
            type: integer
            exclusiveMinimum: 0
            default: 60
            title: Refresh Interval
        - name: created_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Created By
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ChartResponse:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        id:
          type: string
          title: Id
        title:
          type: string
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        chart_type:
          $ref: '#/components/schemas/ChartType'
        source:
          $ref: '#/components/schemas/DataSource'
        theme:
          $ref: '#/components/schemas/Theme'
        dimensions:
          $ref: '#/components/schemas/Dimensions'
        refresh_interval:
          anyOf:
            - type: integer
            - type: 'null'
          title: Refresh Interval
        filters:
          items:
            $ref: '#/components/schemas/Filter'
          type: array
          title: Filters
        permissions:
          items:
            type: string
          type: array
          title: Permissions
        config:
          additionalProperties: true
          type: object
          title: Config
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        organization_id:
          type: string
          title: Organization Id
        project_id:
          type: string
          title: Project Id
          default: thaink2
      type: object
      required:
        - name
        - id
        - title
        - description
        - chart_type
        - source
        - theme
        - dimensions
        - refresh_interval
        - filters
        - permissions
        - created_at
        - updated_at
        - created_by
        - organization_id
      title: ChartResponse
      description: Single chart returned by the API.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChartType:
      type: string
      enum:
        - bar
        - line
        - pie
        - donut
        - scatter
        - area
        - heatmap
        - table
        - stat
        - histogram
      title: ChartType
    DataSource:
      properties:
        source_type:
          $ref: '#/components/schemas/SourceType'
          default: database
        query:
          type: string
          title: Query
          description: SQL snippet, query key, or endpoint path
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/AggregationFunc'
            - type: 'null'
        group_by:
          items:
            type: string
          type: array
          title: Group By
        sort:
          anyOf:
            - $ref: '#/components/schemas/SortConfig'
            - type: 'null'
        limit:
          anyOf:
            - type: integer
              maximum: 100000
              exclusiveMinimum: 0
            - type: 'null'
          title: Limit
          default: 1000
        time_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Field
        connection_config_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Connection Config Id
        source_options:
          additionalProperties: true
          type: object
          title: Source Options
          description: Provider specific properties
      type: object
      required:
        - query
      title: DataSource
    Theme:
      properties:
        color_palette:
          items:
            type: string
          type: array
          title: Color Palette
          default:
            - '#6366f1'
            - '#22d3ee'
            - '#f59e0b'
            - '#10b981'
            - '#ef4444'
        font_family:
          type: string
          title: Font Family
          default: Inter, sans-serif
        dark_mode:
          type: boolean
          title: Dark Mode
          default: false
        show_legend:
          type: boolean
          title: Show Legend
          default: true
        show_grid:
          type: boolean
          title: Show Grid
          default: true
        show_tooltip:
          type: boolean
          title: Show Tooltip
          default: true
      type: object
      title: Theme
    Dimensions:
      properties:
        width:
          type: integer
          exclusiveMinimum: 0
          title: Width
          default: 600
        height:
          type: integer
          exclusiveMinimum: 0
          title: Height
          default: 400
        responsive:
          type: boolean
          title: Responsive
          default: true
      type: object
      title: Dimensions
    Filter:
      properties:
        field:
          type: string
          title: Field
        operator:
          $ref: '#/components/schemas/FilterOperator'
        value:
          title: Value
      type: object
      required:
        - field
        - operator
      title: Filter
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SourceType:
      type: string
      enum:
        - database
        - csv
        - google_drive
        - onedrive_excel
        - agent
      title: SourceType
    AggregationFunc:
      type: string
      enum:
        - count
        - sum
        - avg
        - min
        - max
        - p50
        - p95
        - p99
      title: AggregationFunc
    SortConfig:
      properties:
        field:
          type: string
          title: Field
        order:
          $ref: '#/components/schemas/SortOrder'
          default: desc
      type: object
      required:
        - field
      title: SortConfig
    FilterOperator:
      type: string
      enum:
        - eq
        - neq
        - gt
        - gte
        - lt
        - lte
        - in
        - not_in
        - contains
        - is_null
        - is_not_null
      title: FilterOperator
    SortOrder:
      type: string
      enum:
        - asc
        - desc
      title: SortOrder
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [Create a chart](/api-reference/charts/create-a-chart.md)
- [Create a KPI stat card](/api-reference/charts/create-a-kpi-stat-card.md)
- [Create a dashboard](/api-reference/dashboards/create-a-dashboard.md)
- [Schedule automatic refresh of a chart via an agent](/api-reference/chart-refresh/schedule-automatic-refresh-of-a-chart-via-an-agent.md)
- [List charts](/api-reference/charts/list-charts.md)
