> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-mintlify-cccf65ca.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List dashboards as code

> Get dashboards in code representation



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json get /api/v1/projects/{projectUuid}/dashboards/code
openapi: 3.0.0
info:
  title: Lightdash API
  version: 0.3233.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/projects/{projectUuid}/dashboards/code:
    get:
      tags:
        - Projects
      summary: List dashboards as code
      description: Get dashboards in code representation
      operationId: getDashboardsAsCode
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            type: string
        - in: query
          name: ids
          required: false
          schema:
            items:
              type: string
            type: array
        - in: query
          name: offset
          required: false
          schema:
            type: number
            format: double
        - in: query
          name: languageMap
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiDashboardAsCodeListResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    ApiDashboardAsCodeListResponse:
      properties:
        results:
          properties:
            offset:
              type: number
              format: double
            total:
              type: number
              format: double
            spaces:
              items:
                $ref: '#/components/schemas/SpaceAsCode'
              type: array
            missingIds:
              items:
                type: string
              type: array
            languageMap:
              items:
                $ref: >-
                  #/components/schemas/PartialDeep_DashboardAsCodeLanguageMap._recurseIntoArrays-true__
              type: array
            dashboards:
              items:
                $ref: '#/components/schemas/DashboardAsCode'
              type: array
          required:
            - offset
            - total
            - spaces
            - missingIds
            - dashboards
          type: object
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    SpaceAsCode:
      properties:
        slug:
          type: string
          description: The space slug used for file naming and cross-referencing
        spaceName:
          type: string
          description: >-
            The original human-readable space name (preserves emoji, casing,
            etc.)
        contentType:
          $ref: '#/components/schemas/ContentAsCodeType.SPACE'
      required:
        - slug
        - spaceName
        - contentType
      type: object
    PartialDeep_DashboardAsCodeLanguageMap._recurseIntoArrays-true__:
      $ref: >-
        #/components/schemas/PartialObjectDeep__dashboard_58___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--tiles_63__58__40__type-DashboardTileTypes.SAVED_CHART-or-DashboardTileTypes.SQL_CHART--properties_58__title-string--chartName-string__-or-_type-DashboardTileTypes.MARKDOWN--properties_58__title-string--content-string__-or-_type-DashboardTileTypes.LOOM--properties_58__title-string__-or-_type-DashboardTileTypes.HEADING--properties_58__text-string__-or-_type-DashboardTileTypes.DATA_APP--properties_58__title-string___41_-Array-or-undefined___._recurseIntoArrays-true__
      description: >-
        Create a type from another type with all keys and nested keys set to
        optional.


        Use-cases:

        - Merging a default settings/config object with another object, the
        second object would be a deep partial of the default object.

        - Mocking and testing complex entities, where populating an entire
        object with its keys would be redundant in terms of the mock or test.
    DashboardAsCode:
      allOf:
        - $ref: >-
            #/components/schemas/Omit_Pick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.name-or-slug-or-tabs_
        - properties:
            verification:
              allOf:
                - $ref: '#/components/schemas/ContentVerificationInfo'
              nullable: true
              description: >-
                Detailed verification info (who/when). Read-only; ignored on
                upload.
            verified:
              type: boolean
              description: >-
                Declarative verification state.

                `true` verifies the dashboard on upload, `false` unverifies it,
                `undefined` leaves the

                current state untouched. Download sets this to `true` when the
                dashboard is verified.
            filters:
              properties:
                tableCalculations:
                  items:
                    $ref: '#/components/schemas/DashboardFilterRule'
                  type: array
                metrics:
                  items:
                    $ref: '#/components/schemas/DashboardFilterRule'
                  type: array
                dimensions:
                  items:
                    $ref: '#/components/schemas/Omit_DashboardFilterRule.id_'
                  type: array
              type: object
            downloadedAt:
              type: string
              format: date-time
            spaceSlug:
              type: string
            contentType:
              $ref: '#/components/schemas/ContentAsCodeType.DASHBOARD'
            version:
              type: number
              format: double
            tiles:
              items:
                $ref: '#/components/schemas/DashboardTileAsCode'
              type: array
            updatedAt:
              type: string
              format: date-time
              description: >-
                Not modifiable by user, but useful to know if it has been
                updated. Defaults to now if omitted.
            tabs:
              items:
                $ref: '#/components/schemas/DashboardTabAsCode'
              type: array
            slug:
              type: string
              pattern: ^[a-z0-9-]+$
            name:
              type: string
              minLength: 1
          required:
            - spaceSlug
            - version
            - tiles
            - tabs
            - slug
            - name
          type: object
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    ContentAsCodeType.SPACE:
      enum:
        - space
      type: string
    PartialObjectDeep__dashboard_58___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--tiles_63__58__40__type-DashboardTileTypes.SAVED_CHART-or-DashboardTileTypes.SQL_CHART--properties_58__title-string--chartName-string__-or-_type-DashboardTileTypes.MARKDOWN--properties_58__title-string--content-string__-or-_type-DashboardTileTypes.LOOM--properties_58__title-string__-or-_type-DashboardTileTypes.HEADING--properties_58__text-string__-or-_type-DashboardTileTypes.DATA_APP--properties_58__title-string___41_-Array-or-undefined___._recurseIntoArrays-true__:
      properties:
        dashboard:
          $ref: >-
            #/components/schemas/PartialObjectDeep___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--tiles_63__58__40__type-DashboardTileTypes.SAVED_CHART-or-DashboardTileTypes.SQL_CHART--properties_58__title-string--chartName-string__-or-_type-DashboardTileTypes.MARKDOWN--properties_58__title-string--content-string__-or-_type-DashboardTileTypes.LOOM--properties_58__title-string__-or-_type-DashboardTileTypes.HEADING--properties_58__text-string__-or-_type-DashboardTileTypes.DATA_APP--properties_58__title-string___41_-Array-or-undefined__._recurseIntoArrays-true__
      type: object
      description: >-
        Same as `PartialDeep`, but accepts only `object`s as inputs. Internal
        helper for `PartialDeep`.
    Omit_Pick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.name-or-slug-or-tabs_:
      $ref: >-
        #/components/schemas/Pick_Pick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.Exclude_keyofPick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.name-or-slug-or-tabs__
      description: Construct a type with the properties of T except for those in type K.
    ContentVerificationInfo:
      properties:
        verifiedAt:
          type: string
          format: date-time
        verifiedBy:
          properties:
            lastName:
              type: string
            firstName:
              type: string
            userUuid:
              type: string
          required:
            - lastName
            - firstName
            - userUuid
          type: object
      required:
        - verifiedAt
        - verifiedBy
      type: object
    DashboardFilterRule:
      allOf:
        - $ref: >-
            #/components/schemas/FilterRule_FilterOperator.DashboardFieldTarget.AnyType.AnyType_
        - properties:
            lockedTabUuids:
              items:
                type: string
              type: array
              description: >-
                Tab UUIDs where this filter is locked. When the active tab is in
                this

                list, viewers see the filter but cannot change it, and URL /
                embed

                filter overrides targeting the same field are ignored on that
                tab.

                Empty or omitted means the filter is not locked anywhere.
            singleValue:
              type: boolean
            label:
              type: string
            tileTargets:
              $ref: '#/components/schemas/Record_string.DashboardTileTarget_'
          type: object
    Omit_DashboardFilterRule.id_:
      $ref: >-
        #/components/schemas/Pick_DashboardFilterRule.Exclude_keyofDashboardFilterRule.id__
      description: Construct a type with the properties of T except for those in type K.
    ContentAsCodeType.DASHBOARD:
      enum:
        - dashboard
      type: string
    DashboardTileAsCode:
      anyOf:
        - $ref: '#/components/schemas/DashboardChartTileAsCode'
        - $ref: '#/components/schemas/DashboardSqlChartTileAsCode'
        - $ref: '#/components/schemas/DashboardMarkdownTileAsCode'
        - $ref: '#/components/schemas/DashboardLoomTileAsCode'
        - $ref: '#/components/schemas/DashboardHeadingTileAsCode'
        - $ref: '#/components/schemas/DashboardDataAppTileAsCode'
    DashboardTabAsCode:
      properties:
        hidden:
          type: boolean
        order:
          type: number
          format: double
          minimum: 0
        name:
          type: string
          minLength: 1
        uuid:
          type: string
      required:
        - order
        - name
        - uuid
      type: object
    PartialObjectDeep___91_x-string_93__58__name_63_-string-or-undefined--description_63_-string-or-undefined--tiles_63__58__40__type-DashboardTileTypes.SAVED_CHART-or-DashboardTileTypes.SQL_CHART--properties_58__title-string--chartName-string__-or-_type-DashboardTileTypes.MARKDOWN--properties_58__title-string--content-string__-or-_type-DashboardTileTypes.LOOM--properties_58__title-string__-or-_type-DashboardTileTypes.HEADING--properties_58__text-string__-or-_type-DashboardTileTypes.DATA_APP--properties_58__title-string___41_-Array-or-undefined__._recurseIntoArrays-true__:
      properties: {}
      type: object
      description: >-
        Same as `PartialDeep`, but accepts only `object`s as inputs. Internal
        helper for `PartialDeep`.
    Pick_Pick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.Exclude_keyofPick_Dashboard.name-or-description-or-tabs-or-slug-or-config-or-parameters_.name-or-slug-or-tabs__:
      properties:
        description:
          type: string
        parameters:
          $ref: '#/components/schemas/DashboardParameters'
        config:
          $ref: '#/components/schemas/DashboardConfig'
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    FilterRule_FilterOperator.DashboardFieldTarget.AnyType.AnyType_:
      properties:
        values:
          items:
            $ref: '#/components/schemas/AnyType'
          type: array
          description: Values to filter by
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        id:
          type: string
          description: Unique identifier for the filter
        target:
          $ref: '#/components/schemas/DashboardFieldTarget'
          description: Target field for the filter
        settings:
          $ref: '#/components/schemas/AnyType'
          description: Additional settings for date/time filters
        disabled:
          type: boolean
          description: Whether this filter is disabled
        required:
          type: boolean
          description: Whether this filter is required
        caseSensitive:
          type: boolean
          description: >-
            Overrides the field/explore case-sensitivity for this rule only.

            Used by internal features like autocomplete search that must always

            match case-insensitively regardless of the field's configured
            setting.
      required:
        - operator
        - id
        - target
      type: object
      additionalProperties: true
    Record_string.DashboardTileTarget_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/DashboardTileTarget'
      type: object
      description: Construct a type with a set of properties K of type T
    Pick_DashboardFilterRule.Exclude_keyofDashboardFilterRule.id__:
      properties:
        label:
          type: string
        target:
          $ref: '#/components/schemas/DashboardFieldTarget'
          description: Target field for the filter
        settings:
          description: Additional settings for date/time filters
        disabled:
          type: boolean
          description: Whether this filter is disabled
        required:
          type: boolean
          description: Whether this filter is required
        caseSensitive:
          type: boolean
          description: >-
            Overrides the field/explore case-sensitivity for this rule only.

            Used by internal features like autocomplete search that must always

            match case-insensitively regardless of the field's configured
            setting.
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: Filter operator
        values:
          items: {}
          type: array
          description: Values to filter by
        tileTargets:
          $ref: '#/components/schemas/Record_string.DashboardTileTarget_'
        singleValue:
          type: boolean
        lockedTabUuids:
          items:
            type: string
          type: array
          description: >-
            Tab UUIDs where this filter is locked. When the active tab is in
            this

            list, viewers see the filter but cannot change it, and URL / embed

            filter overrides targeting the same field are ignored on that tab.

            Empty or omitted means the filter is not locked anywhere.
      required:
        - target
        - operator
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    DashboardChartTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              allOf:
                - $ref: >-
                    #/components/schemas/Pick_DashboardChartTileProperties-at-properties.title-or-hideTitle-or-chartName_
                - properties:
                    chartSlug:
                      type: string
                      nullable: true
                  required:
                    - chartSlug
                  type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.SAVED_CHART'
          required:
            - properties
            - type
          type: object
    DashboardSqlChartTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              allOf:
                - $ref: >-
                    #/components/schemas/Pick_DashboardSqlChartTileProperties-at-properties.title-or-hideTitle-or-chartName_
                - properties:
                    chartSlug:
                      type: string
                      nullable: true
                  required:
                    - chartSlug
                  type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.SQL_CHART'
          required:
            - properties
            - type
          type: object
    DashboardMarkdownTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              properties:
                hideFrame:
                  type: boolean
                content:
                  type: string
                title:
                  type: string
              required:
                - content
                - title
              type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.MARKDOWN'
          required:
            - properties
            - type
          type: object
    DashboardLoomTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              properties:
                url:
                  type: string
                hideTitle:
                  type: boolean
                title:
                  type: string
              required:
                - url
                - title
              type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.LOOM'
          required:
            - properties
            - type
          type: object
    DashboardHeadingTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              properties:
                showDivider:
                  type: boolean
                text:
                  type: string
                title: {}
              required:
                - text
              type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.HEADING'
          required:
            - properties
            - type
          type: object
    DashboardDataAppTileAsCode:
      allOf:
        - $ref: '#/components/schemas/DashboardTileAsCodeBase'
        - properties:
            properties:
              properties:
                appDeletedAt:
                  type: string
                  nullable: true
                appUuid:
                  type: string
                hideTitle:
                  type: boolean
                title:
                  type: string
              required:
                - appUuid
                - title
              type: object
            type:
              $ref: '#/components/schemas/DashboardTileTypes.DATA_APP'
          required:
            - properties
            - type
          type: object
    DashboardParameters:
      $ref: '#/components/schemas/Record_string.DashboardParameterValue_'
    DashboardConfig:
      properties:
        defaultDateZoomGranularity:
          anyOf:
            - $ref: '#/components/schemas/DateGranularity'
            - type: string
        dateZoomGranularities:
          items:
            anyOf:
              - $ref: '#/components/schemas/DateGranularity'
              - type: string
          type: array
        parameterOrder:
          items:
            type: string
          type: array
        pinnedParameters:
          items:
            type: string
          type: array
        isAddFilterDisabled:
          type: boolean
        isDateZoomDisabled:
          type: boolean
      required:
        - isDateZoomDisabled
      type: object
    FilterOperator:
      enum:
        - isNull
        - notNull
        - equals
        - notEquals
        - startsWith
        - endsWith
        - include
        - doesNotInclude
        - lessThan
        - lessThanOrEqual
        - greaterThan
        - greaterThanOrEqual
        - inThePast
        - notInThePast
        - inTheNext
        - inTheCurrent
        - notInTheCurrent
        - inBetween
        - notInBetween
        - inPeriodToDate
      type: string
    DashboardFieldTarget:
      properties:
        fallbackType:
          $ref: '#/components/schemas/DimensionType'
        isSqlColumn:
          type: boolean
        tableName:
          type: string
        fieldId:
          type: string
      required:
        - tableName
        - fieldId
      type: object
    DashboardTileTarget:
      anyOf:
        - $ref: '#/components/schemas/DashboardFieldTarget'
        - type: boolean
          enum:
            - false
    DashboardTileAsCodeBase:
      properties:
        tabUuid:
          type: string
          nullable: true
        w:
          type: number
          format: double
          minimum: 1
          maximum: 36
        h:
          type: number
          format: double
          minimum: 1
        'y':
          type: number
          format: double
          minimum: 0
        x:
          type: number
          format: double
          minimum: 0
          maximum: 35
        type:
          $ref: '#/components/schemas/DashboardTileTypes'
        tileSlug:
          type: string
        uuid:
          type: string
      required:
        - w
        - h
        - 'y'
        - x
        - type
      type: object
    Pick_DashboardChartTileProperties-at-properties.title-or-hideTitle-or-chartName_:
      properties:
        title:
          type: string
        chartName:
          type: string
          nullable: true
        hideTitle:
          type: boolean
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    DashboardTileTypes.SAVED_CHART:
      enum:
        - saved_chart
      type: string
    Pick_DashboardSqlChartTileProperties-at-properties.title-or-hideTitle-or-chartName_:
      properties:
        title:
          type: string
        chartName:
          type: string
        hideTitle:
          type: boolean
      required:
        - chartName
      type: object
      description: From T, pick a set of properties whose keys are in the union K
    DashboardTileTypes.SQL_CHART:
      enum:
        - sql_chart
      type: string
    DashboardTileTypes.MARKDOWN:
      enum:
        - markdown
      type: string
    DashboardTileTypes.LOOM:
      enum:
        - loom
      type: string
    DashboardTileTypes.HEADING:
      enum:
        - heading
      type: string
    DashboardTileTypes.DATA_APP:
      enum:
        - data_app
      type: string
    Record_string.DashboardParameterValue_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/DashboardParameterValue'
      type: object
      description: Construct a type with a set of properties K of type T
    DateGranularity:
      enum:
        - Second
        - Minute
        - Hour
        - Day
        - Week
        - Month
        - Quarter
        - Year
      type: string
    DimensionType:
      enum:
        - string
        - number
        - timestamp
        - date
        - boolean
      type: string
    DashboardTileTypes:
      enum:
        - saved_chart
        - sql_chart
        - markdown
        - loom
        - heading
        - data_app
      type: string
    DashboardParameterValue:
      properties:
        value:
          $ref: '#/components/schemas/ParameterValue'
        parameterName:
          type: string
      required:
        - value
        - parameterName
      type: object
    ParameterValue:
      anyOf:
        - type: string
        - type: number
          format: double
        - items:
            type: string
          type: array
        - items:
            type: number
            format: double
          type: array

````