---
title: "List charts as code"
method: GET
path: "/api/v1/projects/{projectUuid}/code/charts"
tags: ["Projects"]
---

# List charts as code

`GET /api/v1/projects/{projectUuid}/code/charts`

Get charts in code representation

## Path parameters

- `projectUuid` string, required

## Query parameters

- `ids` string[]
- `offset` number, double
- `languageMap` boolean

## Response `200`

Success

- ApiChartAsCodeListResponse
  - `results` object, required
    - `offset` number, double, required
    - `total` number, double, required
    - `spaces` SpaceAsCode[], required
      - `access` SpaceAsCodeAccess
        - `groups` SpaceAsCodeGroupAccess[], required
          - `role` 'viewer' | 'editor' | 'admin', required
          - `name` string, required — Exact, case-sensitive organization group name.
        - `users` SpaceAsCodeUserAccess[], required
          - `role` 'viewer' | 'editor' | 'admin', required
          - `email` string, required — Primary email of a human organization member.
        - `projectMemberAccessRole` 'viewer' | 'editor' | 'admin', required
        - `inheritParentPermissions` boolean, required
      - `slug` string, required — Full portable hierarchy path used for identity and cross-referencing.
      - `spaceName` string, required — The original human-readable space name (preserves emoji, casing, etc.)
      - `version` 1 — Optional only for backwards-compatible metadata-only files.
      - `contentType` 'space', required
    - `missingIds` string[], required
    - `languageMap` PartialDeepChartAsCodeLanguageMapRecurseIntoArraysTrue[]
      - `chart` PartialObjectDeep91XString9358Name63StringOrUndefinedDescription63StringOrUndefinedChartConfig6358TypeChartTypeCARTESIANConfig6358EChartsConfig58XAxis6358Name63StringOrUndefinedArrayOrUndefinedYAxis6358Name63StringOrUndefinedArrayOrUndefinedSeries6358Name63StringOrUndefinedMarkLine6358Data58Name63StringOrUndefinedArrayOrUndefinedArrayOrUndefinedOrUndefinedOrTypeChartTypePIEConfig6358GroupLabelOverrides63RecordStringStringOrUndefinedOrUndefinedOrTypeChartTypeFUNNELConfig6358LabelOverrides63RecordStringStringOrUndefinedOrUndefinedOrTypeChartTypeBIGNUMBERConfig6358Label63StringOrUndefinedComparisonLabel63StringOrUndefinedComparisonField63StringOrUndefinedOrUndefinedOrTypeChartTypeTABLEConfig6358Columns63RecordStringNameStringOrUndefinedOrUndefinedOrTypeChartTypeCUSTOMConfig6358Spec63RecordStringUnknownOrUndefinedOrUndefinedOrUndefinedRecurseIntoArraysTrue — Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
    - `charts` ChartAsCode[], required
      - `name` string, required — Display name of the chart
      - `description` string — Optional description of what this chart displays
      - `tableName` string, required — The explore/table name this chart queries from
      - `chartConfig` union, required
        - BigNumberConfig
          - `config` BigNumber
            - `comparisonField` string
            - `conditionalFormattings` ConditionalFormattingConfig[] — Conditional formatting rules
              - …
            - `comparisonLabel` string — Custom label for the comparison value
            - `flipColors` boolean — Flip positive/negative colors (red for increase, green for decrease)
            - `comparisonFormat` 'raw' | 'percentage'
            - `showComparison` boolean — Show comparison with previous value
            - `showTableNamesInLabel` boolean — Include table name in the label
            - `showBigNumberLabel` boolean — Show the label above the number
            - `selectedField` string — Field ID to display as the big number
            - `style` union
              - …
            - `label` string — Custom label for the big number
          - `type` 'big_number', required
        - CartesianChartConfig
          - `config` CartesianChart
            - `columnLimit` number, double — Maximum number of pivot columns to display
            - `rowLimit` RowLimit
              - …
            - `metadata` RecordStringSeriesMetadata — Construct a type with a set of properties K of type T
            - `conditionalFormattings` ConditionalFormattingConfig[] — Conditional formatting rules
              - …
            - `eChartsConfig` EChartsConfig, required — Make all properties in T optional
              - …
            - `layout` CartesianChartLayout, required — Make all properties in T optional
              - …
          - `type` 'cartesian', required
        - CustomVisConfig
          - `config` CustomVis
            - `spec` RecordStringUnknown — Construct a type with a set of properties K of type T
          - `type` 'custom', required
        - PieChartConfig
          - `config` PieChart
            - `metadata` RecordStringSeriesMetadata — Construct a type with a set of properties K of type T
            - `legendMaxItemLength` number, double — Maximum character length for legend items
            - `legendPosition` 'horizontal' | 'vertical'
            - `showLegend` boolean — Show the chart legend
            - `groupSortOverrides` string[] — Custom sort order for groups/slices
            - `groupValueOptionOverrides` RecordStringPartialPieChartValueOptions — Construct a type with a set of properties K of type T
            - `groupColorOverrides` RecordStringString — Construct a type with a set of properties K of type T
            - `groupLabelOverrides` RecordStringString — Construct a type with a set of properties K of type T
            - `showPercentage` boolean — Show percentage on slices
            - `showValue` boolean — Show the actual value on slices
            - `valueLabel` 'hidden' | 'inside' | 'outside'
            - `isDonut` boolean — Display as donut chart with hole in center
            - `metricId` string — Field ID of the metric to display
            - `groupFieldIds` string[] — Field IDs used for grouping/slicing the pie
          - `type` 'pie', required
        - FunnelChartConfig
          - `config` FunnelChart
            - `legendPosition` 'horizontal' | 'vertical'
            - `showLegend` boolean — Show the chart legend
            - `labels` object — Label display configuration
              - …
            - `colorOverrides` RecordStringString — Construct a type with a set of properties K of type T
            - `labelOverrides` RecordStringString — Construct a type with a set of properties K of type T
            - `metadata` RecordStringSeriesMetadata — Construct a type with a set of properties K of type T
            - `fieldId` string — Field ID to display in funnel
            - `dataInput` 'row' | 'column'
          - `type` 'funnel', required
        - TableChartConfig
          - `config` TableChart
            - `rowLimit` RowLimit
              - …
            - `metricsAsRows` boolean — Display metrics as rows instead of columns
            - `conditionalFormattings` ConditionalFormattingConfig[] — Conditional formatting rules
              - …
            - `columns` RecordStringColumnProperties — Construct a type with a set of properties K of type T
            - `showRowGrouping` boolean — Visually deduplicate repeated row-index dimension values across consecutive rows without showing aggregate subtotal rows. When `showSubtotals` is true, grouping is implicitly active and this flag is ignored. Defaults to false.
            - `showSubtotalsExpanded` boolean — Default subtotal rows to expanded (vs. collapsed). Only meaningful when showSubtotals is true.
            - `showSubtotals` boolean — Show subtotal rows
            - `showResultsTotal` boolean — Show total results count
            - `hideRowNumbers` boolean — Hide row number column
            - `showTableNames` boolean — Show table names in column headers
            - `showRowCalculation` boolean — Show row totals/calculations
            - `showColumnCalculation` boolean — Show column totals/calculations
          - `type` 'table', required
        - TreemapChartConfig
          - `config` TreemapChart
            - `endColorThreshold` number, double — Value threshold for end color
            - `startColorThreshold` number, double — Value threshold for start color
            - `useDynamicColors` boolean — Use dynamic color scaling based on values
            - `endColor` string — End color for color gradient (hex code)
            - `startColor` string — Start color for color gradient (hex code)
            - `colorMetricId` string — Field ID for node color value
            - `sizeMetricId` string — Field ID for node size
            - `groupFieldIds` string[] — Field IDs for hierarchical grouping
            - `leafDepth` number, double — Depth of leaf nodes to display
            - `visibleMin` number, double — Minimum size for visible nodes
          - `type` 'treemap', required
        - GaugeChartConfig
          - `config` GaugeChart
            - `customPercentageLabel` string — Custom label for the percentage display
            - `showPercentage` boolean — Show value as percentage
            - `customLabel` string — Custom label for the gauge value
            - `sections` GaugeSection[] — Color sections/ranges for the gauge
              - …
            - `showAxisLabels` boolean — Show min/max labels on the gauge
            - `maxFieldId` string — Field ID to use as the max value
            - `max` number, double — Maximum value for the gauge
            - `min` number, double — Minimum value for the gauge
            - `selectedField` string — Field ID for the gauge value
          - `type` 'gauge', required
        - DataAppVizChartConfig
          - `config` DataAppVizChart
            - `fieldMapping` DataAppVizFieldMapping, required — Construct a type with a set of properties K of type T
            - `dataAppVizUuid` string, required — The reusable data app viz this chart renders with (by reference).
          - `type` 'data_app_viz', required
        - MapChartConfig
          - `config` MapChart
            - `saveMapExtent` boolean — Save the current map zoom/position
            - `fieldConfig` RecordStringMapFieldConfig — Construct a type with a set of properties K of type T
            - `noDataColor` string — Color for regions with no data (hex code)
            - `backgroundColor` string — Background color for the map (hex code)
            - `darkModeTileBackground` 'none' | 'openstreetmap' | 'light' | 'dark' | 'satellite' | 'voyager'
            - `tileBackground` 'none' | 'openstreetmap' | 'light' | 'dark' | 'satellite' | 'voyager'
            - `dataLayerOpacity` number, double — Data layer opacity (0.1 to 1)
            - `hexbinConfig` object — Configuration for H3 hexagonal binning visualization
              - …
            - `heatmapConfig` object — Configuration for heatmap visualization
              - …
            - `sizeFieldId` string — Field ID for bubble size (scatter maps)
            - `maxBubbleSize` number, double — Maximum bubble size for scatter maps
            - `minBubbleSize` number, double — Minimum bubble size for scatter maps
            - `defaultCenterLon` number, double — Default center longitude
            - `defaultCenterLat` number, double — Default center latitude
            - `defaultZoom` number, double — Default zoom level
            - `colorOverrides` RecordStringString — Construct a type with a set of properties K of type T
            - `colorRange` string[] — Array of colors for the value gradient
            - `showLegend` boolean — Show the map legend
            - `valueFieldId` string — Field ID for the value to display
            - `geoJsonPropertyKey` string — Property key in GeoJSON to match against data
            - `locationFieldId` string — Field ID for location/region names (area maps)
            - `longitudeFieldId` string — Field ID for longitude values
            - `latitudeFieldId` string — Field ID for latitude values
            - `locationType` 'scatter' | 'area' | 'heatmap' | 'hexbin'
            - `customGeoJsonUrl` string — URL to custom GeoJSON file
            - `mapType` 'USA' | 'world' | 'europe' | 'custom'
          - `type` 'map', required
        - SankeyChartConfig
          - `config` SankeyChart
            - `nodeLayout` 'multi-step' | 'merged' | 'direct' — How nodes are laid out: - `multi-step`: depth-unrolled journeys (default) - `merged`: one node per label, journeys preserved (acyclic flows only) - `direct`: two-column source→target pairs, no chaining
            - `orient` 'horizontal' | 'vertical' — Orientation of the diagram
            - `nodeAlign` 'left' | 'right' | 'justify' — Node alignment
            - `metricFieldId` string — Field ID for the link value metric
            - `targetFieldId` string — Field ID for the target node dimension
            - `sourceFieldId` string — Field ID for the source node dimension
          - `type` 'sankey', required
      - `pivotConfig` object — Pivot table configuration
        - `rows` string[]
        - `columns` string[], required
      - `slug` string, required — Unique identifier slug for this chart
      - `parameters` ParametersValuesMap — Construct a type with a set of properties K of type T
      - `verification` ContentVerificationInfo
        - `verifiedAt` string, date-time, required
        - `verifiedBy` object, required
          - `lastName` string, required
          - `firstName` string, required
          - `userUuid` string, required
      - `verified` boolean — Declarative verification state. `true` verifies the chart on upload, `false` unverifies it, `undefined` leaves the current state untouched. Download sets this to `true` when the chart is verified.
      - `downloadedAt` string, date-time — Timestamp when this chart was downloaded from Lightdash
      - `spaceSlug` string, required — Slug of the space containing this chart
      - `contentType` 'chart'
      - `version` number, double, required — Schema version for this chart configuration
      - `dashboardSlug` string — Slug of the dashboard this chart belongs to (if any)
      - `tableConfig` object — Table configuration. Defaults to empty column order if omitted.
        - `columnOrder` string[], required
      - `updatedAt` string, date-time — Not modifiable by user, but useful to know if it has been updated. Defaults to now if omitted.
      - `metricQuery` object, required — From T, pick a set of properties whose keys are in the union K
        - `exploreName` string, required — The name of the explore to query
        - `dimensions` string[], required — List of dimension field IDs to include
        - `metrics` string[], required — List of metric field IDs to include
        - `sorts` SortField[], required — Sort configuration for query results
          - `pivotValues` PivotSortAnchor[] — Pins the row-sort anchor to a specific pivot column. Ignored for non-pivoted results.
            - `value` union, required
              - …
            - `reference` string, required
          - `nullsFirst` boolean — Sort null values first
          - `descending` boolean, required — Sort in descending order
          - `fieldId` string, required — Field ID to sort by
        - `limit` number, double, required — Maximum number of rows to return
        - `tableCalculations` TableCalculation[], required — Custom calculations to perform on query results
          - union
            - SqlTableCalculation
              - …
            - TemplateTableCalculation
              - …
            - FormulaTableCalculation
              - …
        - `additionalMetrics` AdditionalMetric[] — Custom metrics defined inline (ad-hoc metrics not in the dbt model)
          - `label` string — Display label for the metric
          - `type` 'percentile' | 'average' | 'count' | 'count_distinct' | 'sum' | 'sum_distinct' | 'average_distinct' | 'min' | 'max' | 'percent_of_previous' | 'percent_of_total' | 'running_total' | 'number' | 'median' | 'string' | 'date' | 'timestamp' | 'boolean', required
          - `description` string — Description of what the metric measures
          - `sql` string, required — SQL expression (e.g., ${TABLE}.column_name)
          - `hidden` boolean — Whether the metric is hidden from users
          - `round` number, double — Number of decimal places
          - `compact` union
            - 'auto' | 'thousands' | 'millions' | 'billions' | 'trillions' | 'kilobytes' | 'megabytes' | 'gigabytes' | 'terabytes' | 'petabytes' | 'kibibytes' | 'mebibytes' | 'gibibytes' | 'tebibytes' | 'pebibytes'
            - 'K' | 'thousand' | 'M' | 'million' | 'B' | 'billion' | 'T' | 'trillion' | 'KB' | 'kilobyte' | 'MB' | 'megabyte' | 'GB' | 'gigabyte' | 'TB' | 'terabyte' | 'PB' | 'petabyte' | 'KiB' | 'kibibyte' | 'MiB' | 'mebibyte' | 'GiB' | 'gibibyte' | 'TiB' | 'tebibyte' | 'PiB' | 'pebibyte'
          - `format` union — Format string (legacy format specification)
            - 'km' | 'mi' | 'si' | 'usd' | 'gbp' | 'eur' | 'jpy' | 'dkk' | 'id' | 'percent'
            - string
          - `separator` 'default' | 'commaPeriod' | 'spacePeriod' | 'periodComma' | 'noSeparatorPeriod' | 'apostrophePeriod'
          - `table` string, required — Table name the metric belongs to
          - `name` string, required — Internal name of the metric
          - `index` number, double — Display order index
          - `filters` MetricFilterRule[] — Filters to apply to this metric
            - `includeNull` boolean — For the `equals` operator on string fields, also match rows where the field is null (compiles to `field IN (...) OR field IS NULL`). Lets users combine null with selected values in a single "is" rule.
            - `values` AnyType[] — Values to filter by
              - …
            - `operator` 'isNull' | 'notNull' | 'equals' | 'notEquals' | 'startsWith' | 'endsWith' | 'include' | 'doesNotInclude' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'inThePast' | 'notInThePast' | 'inTheNext' | 'inTheCurrent' | 'notInTheCurrent' | 'inBetween' | 'notInBetween' | 'inPeriodToDate', required
            - `id` string, required — Unique identifier for the filter
            - `target` object, required — Target field for the filter
              - …
            - `settings` unknown
            - `disabled` boolean — Whether this filter is disabled
            - `required` boolean — Whether this filter is required
            - `caseSensitive` boolean — 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.
          - `baseDimensionName` string — Name of the base dimension/column this metric aggregates
          - `baseMetricName` string — Name of the explore metric this metric was cloned from
          - `uuid` string, nullable — Unique identifier for the metric
          - `percentile` number, double — Percentile value for percentile metrics
          - `distinctKeys` string[]
          - `formatOptions` CustomFormat
            - `type` 'default' | 'percent' | 'currency' | 'number' | 'id' | 'date' | 'timestamp' | 'bytes_si' | 'bytes_iec' | 'custom', required
            - `round` number, double — Number of decimal places
            - `separator` 'default' | 'commaPeriod' | 'spacePeriod' | 'periodComma' | 'noSeparatorPeriod' | 'apostrophePeriod'
            - `currency` string — Currency code (e.g., USD, GBP, EUR)
            - `compact` union
              - …
            - `prefix` string — Prefix to prepend to formatted values
            - `suffix` string — Suffix to append to formatted values
            - `timeInterval` 'RAW' | 'YEAR' | 'QUARTER' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND' | 'MILLISECOND' | 'DAY_OF_WEEK_INDEX' | 'DAY_OF_MONTH_NUM' | 'DAY_OF_YEAR_NUM' | 'WEEK_NUM' | 'MONTH_NUM' | 'QUARTER_NUM' | 'YEAR_NUM' | 'DAY_OF_WEEK_NAME' | 'MONTH_NAME' | 'QUARTER_NAME' | 'HOUR_OF_DAY_NUM' | 'MINUTE_OF_HOUR_NUM'
            - `custom` string — Custom format string
          - `generationType` 'periodOverPeriod' — Optional marker for metrics generated by the system. Currently used for Period-over-Period (PoP) previous-period metrics.
          - `baseMetricId` string
          - `timeDimensionId` string
          - `granularity` 'RAW' | 'YEAR' | 'QUARTER' | 'MONTH' | 'WEEK' | 'DAY' | 'HOUR' | 'MINUTE' | 'SECOND' | 'MILLISECOND' | 'DAY_OF_WEEK_INDEX' | 'DAY_OF_MONTH_NUM' | 'DAY_OF_YEAR_NUM' | 'WEEK_NUM' | 'MONTH_NUM' | 'QUARTER_NUM' | 'YEAR_NUM' | 'DAY_OF_WEEK_NAME' | 'MONTH_NAME' | 'QUARTER_NAME' | 'HOUR_OF_DAY_NUM' | 'MINUTE_OF_HOUR_NUM'
          - `periodOffset` number, double — For PoP-generated metrics, the number of periods to offset by (>= 1).
        - `customDimensions` CustomDimension[] — Custom dimensions defined inline
          - union
            - union
              - …
            - CustomSqlDimension
              - …
        - `metricOverrides` MetricOverrides
        - `dimensionOverrides` DimensionOverrides
        - `timezone` string — Timezone for date/time values (e.g., 'America/Los_Angeles', 'UTC')
        - `pivotDimensions` string[] — Dimension field IDs used as pivot columns (from chart's pivotConfig.columns). Used by row_total() to determine non-pivot dimensions for GROUP BY.
        - `metadata` object
          - `hasADateDimension` PickCompiledDimensionNameOrLabelOrTable, required — From T, pick a set of properties whose keys are in the union K
        - `filters` FiltersInput, required
          - `tableCalculations` union
            - OrFilterGroupInput
              - …
            - AndFilterGroupInput
              - …
          - `metrics` union
            - OrFilterGroupInput
              - …
            - AndFilterGroupInput
              - …
          - `dimensions` union
            - OrFilterGroupInput
              - …
            - AndFilterGroupInput
              - …
  - `status` 'ok', required

## Other responses

- `default` — Error

---

[API](https://skmtc.net/lightdash/apis/lightdash-api.md) · [All operations](https://skmtc.net/lightdash/apis/lightdash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lightdash/lightdash-api/versions/40c933755c9a/schema)
