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

# Run Data For Visualisation



## OpenAPI

````yaml https://api.truestate.io/openapi.json post /dashboards/data-sources/run-query/
openapi: 3.1.0
info:
  title: TrueState Backend API
  summary: >-
    TrueState is an AI platform for business users to create high-impact AI
    solutions.
  description: >

    This **[TrueState](https://www.truestate.io/)** backend API allows our
    clients to automate and more powerfully retrieve and modify data from the
    TrueState platform.


    Example use cases include:


    - Accessing embeddings for a dataset.

    - Automating the process of dataset creation and model retraining as your
    data changes.

    - Much more.


    Our backend is built using the [FastAPI](https://fastapi.tiangolo.com/)
    framework in python

    using [Auth0](https://auth0.com/) and [Client API
    Keys](https://docs.truestate.io/docs/api/client-api-keys) for internal an
    external authentication, respectively.

    Our backend is designed to be secure, scalable, easy to use and well
    documented _(each router with its own linked docs page)_.

    Clients can only access data from their own organisation, as setup in Auth0
    our the Client API Keys. See how
    **[here](https://docs.truestate.io/docs/api/overview)**.


    **PS**: You can view this API documentation in either
    **[Swagger](swagger/docs)** or **[Redoc](redoc/)**, but only the swagger
    lets you test calls.
  contact:
    name: True State Support
    url: http://docs.truestate.io/
    email: support@truestate.io
  license:
    name: Private
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 0.11.78
servers: []
security: []
tags:
  - name: assistants
    description: Management of assistants
  - name: api-keys
    description: Management of each user personal Client API Keys, used to access this API.
  - name: models
    description: Management of models
  - name: secrets
    description: Management of client secrets for accessing external services
  - name: deployments
    description: Management of deployments.
  - name: pipelines
    description: Management of pipelines.
  - name: pipeline-runs
    description: Management of pipeline runs.
  - name: automations
    description: Management of Automations.
  - name: automation-sessions
    description: Management of Automation Sessions.
  - name: chatbots
    description: Chatbot endpoints.
  - name: check-auto-recharge
    description: ''
  - name: classification-classes
    description: >-
      Management of zero shot classifications (using ai to apply new categories
      to a dataset).
  - name: conversations
    description: Management of conversations
  - name: conventions
    description: Management of conventions - best practices for actuators and agents
  - name: credit-usage
    description: Management of Credits.
  - name: dashboards
    description: Management of Dashboards.
  - name: data
    description: Bigquery inference services
  - name: data-dictionary
    description: Data Dictionary endpoints.
  - name: datasets
    description: Dataset endpoints.
  - name: documents
    description: Document endpoints.
  - name: default
    description: Default health checks.
  - name: embedding-search
    description: ''
  - name: inference
    description: Model inference services
  - name: messages
    description: Management of messages
  - name: notebooks
    description: ''
  - name: notebook-services
    description: ''
  - name: organisations
    description: Management of Organisations.
  - name: payment-methods
    description: Management of Payment methods.
  - name: private-tasks
    description: ''
  - name: private-pipelines
    description: ''
  - name: private-data
    description: ''
  - name: renew-seats
    description: ''
  - name: tagging-lists
    description: Management of Tagging Lists.
  - name: tasks
    description: ''
  - name: task-templates
    description: Management of task templates (definitions and schedules).
  - name: agents
    description: ''
  - name: user
    description: Management of User.
  - name: user-context
    description: Management of User Context.
  - name: private-messages
    description: ''
  - name: private-llm-call
    description: ''
  - name: admin-organisations
    description: ''
  - name: private-warehouser
    description: ''
  - name: private-pipeline-tracking
    description: ''
  - name: private-pipeline-runs
    description: ''
  - name: private-reports
    description: ''
  - name: private-bootstrap
    description: ''
  - name: reports
    description: ''
  - name: private-conversations
    description: ''
  - name: private-datasets
    description: ''
  - name: private-dashboards
    description: ''
  - name: private-conventions
    description: ''
  - name: private-documents
    description: ''
paths:
  /dashboards/data-sources/run-query/:
    post:
      tags:
        - dashboards
      summary: Run Data For Visualisation
      operationId: run_data_for_visualisation_dashboards_data_sources_run_query__post
      parameters:
        - name: Api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunDataSourceQueryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    RunDataSourceQueryRequest:
      properties:
        visualisation:
          $ref: '#/components/schemas/DashboardVisualisationCreate'
        data_source:
          $ref: '#/components/schemas/DashboardDataSourceCreate'
        embedding_search:
          anyOf:
            - $ref: >-
                #/components/schemas/src__routers__dashboards__dashboards__EmbeddingSearchParams
            - type: 'null'
      type: object
      required:
        - visualisation
        - data_source
      title: RunDataSourceQueryRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DashboardVisualisationCreate:
      properties:
        uid:
          type: string
          title: Uid
        title:
          type: string
          title: Title
        grid_layout:
          $ref: '#/components/schemas/DashboardGridLayout'
        data_source_uid:
          type: string
          title: Data Source Uid
        config:
          oneOf:
            - $ref: '#/components/schemas/StandardTableConfig'
            - $ref: '#/components/schemas/ScatterPlotConfig'
            - $ref: '#/components/schemas/BarChartConfig'
            - $ref: '#/components/schemas/PieChartConfig'
            - $ref: '#/components/schemas/LineChartConfig'
          title: Config
          discriminator:
            propertyName: type
            mapping:
              BAR_CHART: '#/components/schemas/BarChartConfig'
              LINE_CHART: '#/components/schemas/LineChartConfig'
              PIE_CHART: '#/components/schemas/PieChartConfig'
              SCATTER_PLOT: '#/components/schemas/ScatterPlotConfig'
              STANDARD_TABLE: '#/components/schemas/StandardTableConfig'
      type: object
      required:
        - uid
        - title
        - grid_layout
        - data_source_uid
        - config
      title: DashboardVisualisationCreate
    DashboardDataSourceCreate:
      properties:
        uid:
          type: string
          title: Uid
        query:
          type: string
          title: Query
        filters:
          items:
            $ref: '#/components/schemas/ColumnFilter'
          type: array
          title: Filters
      type: object
      required:
        - uid
        - query
        - filters
      title: DashboardDataSourceCreate
    src__routers__dashboards__dashboards__EmbeddingSearchParams:
      properties:
        search_term:
          type: string
          title: Search Term
        keyword_column:
          type: string
          title: Keyword Column
          default: ''
        top_k:
          type: integer
          maximum: 10000
          exclusiveMinimum: 0
          title: Top K
          default: 1000
      type: object
      required:
        - search_term
      title: EmbeddingSearchParams
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DashboardGridLayout:
      properties:
        x:
          type: integer
          title: X
        'y':
          type: integer
          title: 'Y'
        w:
          type: integer
          title: W
        h:
          type: integer
          title: H
      type: object
      required:
        - x
        - 'y'
        - w
        - h
      title: DashboardGridLayout
      description: >-
        The grid layout of the dashboard.

        x: The x-coordinate of the top-left corner of the visualisation.

        y: The y-coordinate of the top-left corner of the visualisation.

        w: The width of the visualisation.

        h: The height of the visualisation.


        The page is divided into a grid of cells 12 wide, like a Bootstrap grid
        system. A layout with (x=0, y=0, w=12, h=10) will take up the entire
        width of the page and span 10 rows. A layout with (x=0, y=0, w=6, h=10)
        and (x=6, y=0, w=6, h=10) will take up the width of the page with 2
        equal height columns.
    StandardTableConfig:
      properties:
        type:
          type: string
          const: STANDARD_TABLE
          title: Type
          default: STANDARD_TABLE
        columns:
          items:
            type: string
          type: array
          title: Columns
      type: object
      required:
        - columns
      title: StandardTableConfig
    ScatterPlotConfig:
      properties:
        type:
          type: string
          const: SCATTER_PLOT
          title: Type
          default: SCATTER_PLOT
        x_column:
          type: string
          title: X Column
        y_column:
          type: string
          title: Y Column
        label_column:
          type: string
          title: Label Column
      type: object
      required:
        - x_column
        - y_column
        - label_column
      title: ScatterPlotConfig
    BarChartConfig:
      properties:
        type:
          type: string
          const: BAR_CHART
          title: Type
          default: BAR_CHART
        x_column:
          type: string
          title: X Column
        y_column:
          type: string
          title: Y Column
        aggregation_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Aggregation Type
      type: object
      required:
        - x_column
        - y_column
      title: BarChartConfig
    PieChartConfig:
      properties:
        type:
          type: string
          const: PIE_CHART
          title: Type
          default: PIE_CHART
        label_column:
          type: string
          title: Label Column
      type: object
      required:
        - label_column
      title: PieChartConfig
    LineChartConfig:
      properties:
        type:
          type: string
          const: LINE_CHART
          title: Type
          default: LINE_CHART
        x_column:
          type: string
          title: X Column
        y_column:
          type: string
          title: Y Column
        aggregation_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Aggregation Type
      type: object
      required:
        - x_column
        - y_column
      title: LineChartConfig
    ColumnFilter:
      properties:
        uid:
          type: string
          title: Uid
        column:
          type: string
          title: Column
        column_type:
          $ref: '#/components/schemas/ColumnType'
        filter_condition:
          oneOf:
            - $ref: '#/components/schemas/GeneralFilterCondition'
            - $ref: '#/components/schemas/NonNegatedFilterCondition'
            - $ref: '#/components/schemas/IsInFilterCondition'
          title: Filter Condition
          discriminator:
            propertyName: operator
            mapping:
              CONTAINS: '#/components/schemas/GeneralFilterCondition'
              ENDS_WITH: '#/components/schemas/GeneralFilterCondition'
              EQUALS: '#/components/schemas/GeneralFilterCondition'
              GREATER_THAN: '#/components/schemas/NonNegatedFilterCondition'
              GREATER_THAN_OR_EQUALS: '#/components/schemas/NonNegatedFilterCondition'
              IS_IN: '#/components/schemas/IsInFilterCondition'
              IS_NULL: '#/components/schemas/GeneralFilterCondition'
              LESS_THAN: '#/components/schemas/NonNegatedFilterCondition'
              LESS_THAN_OR_EQUALS: '#/components/schemas/NonNegatedFilterCondition'
              STARTS_WITH: '#/components/schemas/GeneralFilterCondition'
      type: object
      required:
        - uid
        - column
        - column_type
        - filter_condition
      title: ColumnFilter
    ColumnType:
      type: string
      enum:
        - BOOLEAN
        - STRING
        - NUMBER
        - DATETIME
      title: ColumnType
    GeneralFilterCondition:
      properties:
        operator:
          type: string
          enum:
            - EQUALS
            - IS_NULL
            - CONTAINS
            - STARTS_WITH
            - ENDS_WITH
          title: Operator
        value:
          type: string
          title: Value
        is_negated:
          type: boolean
          title: Is Negated
          default: false
      type: object
      required:
        - operator
        - value
      title: GeneralFilterCondition
    NonNegatedFilterCondition:
      properties:
        operator:
          type: string
          enum:
            - GREATER_THAN
            - GREATER_THAN_OR_EQUALS
            - LESS_THAN
            - LESS_THAN_OR_EQUALS
          title: Operator
        value:
          type: string
          title: Value
      type: object
      required:
        - operator
        - value
      title: NonNegatedFilterCondition
    IsInFilterCondition:
      properties:
        operator:
          type: string
          const: IS_IN
          title: Operator
          default: IS_IN
        values:
          items:
            type: string
          type: array
          title: Values
        is_negated:
          type: boolean
          title: Is Negated
          default: false
      type: object
      required:
        - values
      title: IsInFilterCondition
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````