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

# Get a chart

> Retrieves a chart by ID, including the content of its latest version (name, SQL query, chart type, axes) and its dashboard placement. Requires admin access to the organization.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi get /api/public/organizations/{orgId}/charts/{id}
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication.
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Definitions
    description: Manage reusable SQL definitions
  - name: Dashboards
    description: Manage dashboards and their tabs
  - name: Charts
    description: Manage charts and their SQL queries
paths:
  /api/public/organizations/{orgId}/charts/{id}:
    get:
      tags:
        - Charts
      summary: Get a chart
      description: >-
        Retrieves a chart by ID, including the content of its latest version
        (name, SQL query, chart type, axes) and its dashboard placement.
        Requires admin access to the organization.
      parameters:
        - schema:
            type: string
            description: Organization ID
          required: true
          description: Organization ID
          name: orgId
          in: path
        - schema:
            type: string
            description: Chart ID
          required: true
          description: Chart ID
          name: id
          in: path
      responses:
        '200':
          description: Chart retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ChartResponse'
                required:
                  - data
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - Chart not found or no admin access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ChartResponse:
      type: object
      properties:
        id:
          type: string
          description: Chart ID
        createdAt:
          type: string
          format: date-time
          description: Chart creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of the last content or placement change
        dashboardId:
          type: string
          description: ID of the dashboard the chart is on
        dashboardTabId:
          type: string
          description: ID of the dashboard tab the chart is on
        organizationId:
          type: string
          description: Organization ID
        name:
          type: string
          description: Name of the chart
        description:
          type:
            - string
            - 'null'
          description: Description of the chart
        chartType:
          $ref: '#/components/schemas/SqlChartType'
        sqlQuery:
          type: string
          description: SQL query powering the chart
        drilldownSqlQuery:
          type:
            - string
            - 'null'
          description: SQL query used for chart drill-downs
        databaseConnectionId:
          type:
            - string
            - 'null'
          description: ID of the data source the SQL query runs against
        xAxisProperty:
          type:
            - string
            - 'null'
          description: Result column used for the x-axis
        xAxisSecondaryProperty:
          type:
            - string
            - 'null'
          description: Result column used to break down the x-axis into segments
        yAxisProperty:
          type:
            - string
            - 'null'
          description: Result column used for the y-axis
        staticContent:
          type:
            - string
            - 'null'
          description: Static content for DASHBOARD_HEADER and DASHBOARD_TEXT chart types
        layout:
          $ref: '#/components/schemas/ChartLayout'
      required:
        - id
        - createdAt
        - updatedAt
        - dashboardId
        - dashboardTabId
        - organizationId
        - name
        - description
        - chartType
        - sqlQuery
        - drilldownSqlQuery
        - databaseConnectionId
        - xAxisProperty
        - xAxisSecondaryProperty
        - yAxisProperty
        - staticContent
        - layout
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    SqlChartType:
      anyOf:
        - type: string
          enum:
            - TABLE
        - type: string
          enum:
            - LINE
        - type: string
          enum:
            - VERTICAL_BAR
        - type: string
          enum:
            - HORIZONTAL_BAR
        - type: string
          enum:
            - SCATTER
        - type: string
          enum:
            - FUNNEL
        - type: string
          enum:
            - NUMBER
        - type: string
          enum:
            - PROGRESS
        - type: string
          enum:
            - IMAGE
        - type: string
          enum:
            - RECORD
        - type: string
          enum:
            - TEXT
        - type: string
          enum:
            - PIE
        - type: string
          enum:
            - ACTIVITY
        - type: string
          enum:
            - MAP
        - type: string
          enum:
            - SANKEY
        - type: string
          enum:
            - DASHBOARD_HEADER
        - type: string
          enum:
            - DASHBOARD_TEXT
        - type: 'null'
      description: Type of the chart
    ChartLayout:
      type: object
      properties:
        x:
          type: integer
          minimum: 0
          description: Column position on the dashboard grid
        'y':
          type: integer
          minimum: 0
          description: Row position on the dashboard grid
        width:
          type: integer
          minimum: 1
          description: Width of the chart in grid units
        height:
          type: integer
          minimum: 1
          description: Height of the chart in grid units
      required:
        - x
        - 'y'
        - width
        - height
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````