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

# Execute flexible dashboard widget query

> Default read scope includes all authorized companies when no company header is provided.



## OpenAPI

````yaml /openapi/openapi.yaml post /banks/dashboard/query
openapi: 3.1.0
info:
  title: Tahsil API
  version: 1.0.0
  description: >-
    Tahsil müşterilerinin web ve mobil uygulamalarda kullandığı tenant-scoped
    müşteri API sözleşmesi.
servers:
  - url: https://api.tahsil.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Operations - Health
    description: Public liveness and dependency readiness probes.
  - name: Identity - Auth
    description: User login, refresh and logout flows for token-based access.
  - name: Banking - Accounts
    description: Bank account aggregation endpoints available to customer tenants.
  - name: Banking - Transactions
    description: Bank transaction ingestion and retrieval endpoints.
  - name: Banking - Automation
    description: Tenant transaction matching rules, assignments and historical runs.
  - name: Banking - Polling
    description: Polling schedule definitions for bank connector queries.
  - name: Banking - Dashboard
    description: Flexible tenant dashboard analytics and widget query endpoints.
  - name: Audit - Connector Logs
    description: Customer-visible bank connector request/response audit trail.
  - name: Payments - Orchestration
    description: Tenant Virtual POS, rate plan and payment intent orchestration.
paths:
  /banks/dashboard/query:
    post:
      tags:
        - Banking - Dashboard
      summary: Execute flexible dashboard widget query
      description: >-
        Default read scope includes all authorized companies when no company
        header is provided.
      operationId: postBanksDashboardQuery
      parameters:
        - $ref: '#/components/parameters/XCompanyId'
        - $ref: '#/components/parameters/XCompanyIds'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardQueryRequest'
      responses:
        '200':
          $ref: '#/components/responses/ItemResponse'
        '400':
          $ref: '#/components/responses/StatusResponse'
        '403':
          $ref: '#/components/responses/StatusResponse'
        '422':
          $ref: '#/components/responses/StatusResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    XCompanyId:
      name: x-company-id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Target tenant company id. Required for write operations on customer
        banking endpoints.
    XCompanyIds:
      name: x-company-ids
      in: header
      required: false
      schema:
        type: string
      description: >-
        Optional comma-separated company ids for read scope filtering. If
        omitted, all authorized companies are used.
  schemas:
    DashboardQueryRequest:
      type: object
      required:
        - range
        - metrics
      example:
        range:
          preset: last_30d
          timezone: Europe/Istanbul
        groupBy:
          - currency
        metrics:
          - count
          - sum(amount)
        limit: 20
      properties:
        range:
          $ref: '#/components/schemas/DashboardRange'
        filters:
          $ref: '#/components/schemas/DashboardFilters'
        groupBy:
          type: array
          items:
            type: string
            enum:
              - bankCode
              - subAccountKey
              - currency
              - incoming
              - transactionDate:day
              - transactionDate:week
              - transactionDate:month
              - descriptionBucket
        metrics:
          type: array
          items:
            type: string
            enum:
              - count
              - sum(amount)
              - sum(balance)
              - avg(amount)
              - max(amount)
              - min(amount)
        sort:
          type: array
          items:
            $ref: '#/components/schemas/DashboardSort'
        limit:
          type: integer
          minimum: 1
          maximum: 500
    DashboardRange:
      type: object
      properties:
        preset:
          type: string
          enum:
            - last_7d
            - last_30d
            - today
            - custom
        from:
          type:
            - string
            - 'null'
          format: date-time
        to:
          type:
            - string
            - 'null'
          format: date-time
        timezone:
          type:
            - string
            - 'null'
    DashboardFilters:
      type: object
      properties:
        bankCode:
          type: array
          items:
            type: string
        currency:
          type: array
          items:
            type: string
        incoming:
          type: boolean
        accountId:
          type: array
          items:
            type: string
        subAccountKey:
          type: array
          items:
            type: string
        amountMin:
          type: number
        amountMax:
          type: number
    DashboardSort:
      type: object
      required:
        - field
        - direction
      properties:
        field:
          type: string
        direction:
          type: string
          enum:
            - asc
            - desc
  responses:
    ItemResponse:
      description: Single entity response
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: boolean
              result:
                type: object
                additionalProperties: true
          example:
            status: true
            result:
              id: 64f000000000000000000001
    StatusResponse:
      description: Operation completed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: boolean
          example:
            status: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

## Related topics

- [Dashboard sorguları](/rehberler/dashboard.md)
- [Return allowed dashboard DSL catalog](/api-reference/banking--dashboard/return-allowed-dashboard-dsl-catalog.md)
- [Zamanlanmış sorgular](/rehberler/zamanlanmis-sorgular.md)
- [Remove bank account connector](/api-reference/banking--accounts/remove-bank-account-connector.md)
- [List normalized provider connection field metadata](/api-reference/banking--accounts/list-normalized-provider-connection-field-metadata.md)
