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

# List virtual views as code (deprecated)



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json get /api/v1/projects/{projectUuid}/virtualViews/code
openapi: 3.0.0
info:
  title: Lightdash API
  version: 2.55.1
  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}/virtualViews/code:
    get:
      tags:
        - Projects
      summary: List virtual views as code (deprecated)
      operationId: getVirtualViewsAsCode
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            type: string
        - in: query
          name: slugs
          required: false
          schema:
            items:
              type: string
            type: array
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiVirtualViewAsCodeListResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      deprecated: true
      security: []
components:
  schemas:
    ApiVirtualViewAsCodeListResponse:
      properties:
        results:
          properties:
            missingSlugs:
              items:
                type: string
              type: array
            skipped:
              items:
                $ref: '#/components/schemas/VirtualViewAsCodeSkip'
              type: array
            virtualViews:
              items:
                $ref: '#/components/schemas/VirtualViewAsCode'
              type: array
          required:
            - missingSlugs
            - skipped
            - virtualViews
          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
    VirtualViewAsCodeSkip:
      properties:
        reason:
          type: string
        slug:
          type: string
      required:
        - reason
        - slug
      type: object
    VirtualViewAsCode:
      properties:
        parameters:
          allOf:
            - $ref: '#/components/schemas/ParametersValuesMap'
          nullable: true
        columns:
          items:
            $ref: '#/components/schemas/ResultColumn'
          type: array
        sql:
          type: string
        name:
          type: string
          description: Mutable display label.
        slug:
          type: string
          description: Immutable project-scoped explore name used by downstream content.
        version:
          type: number
          format: double
        contentType:
          $ref: '#/components/schemas/ContentAsCodeType.VIRTUAL_VIEW'
      required:
        - parameters
        - columns
        - sql
        - name
        - slug
        - version
        - contentType
      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.
    ParametersValuesMap:
      $ref: '#/components/schemas/Record_string.ParameterValue_'
    ResultColumn:
      properties:
        provenance:
          $ref: '#/components/schemas/ResultColumnProvenance'
          description: >-
            Absent ⇒ no semantic field behind this column (computed DuckDB
            column,

            raw SQL column, table calc, join key). Absence gates interaction

            capabilities (drill, underlying data, URLs) off — by design.
        shiftsTimezone:
          type: boolean
          description: >-
            Resolved output of getFormatterTimezone: whether values shift into
            the

            display timezone. Saves consumers from needing
            skipTimezoneConversion /

            baseDimensionType.
        timeInterval:
          $ref: '#/components/schemas/TimeFrames'
          description: |-
            Temporal grain. Required for QUARTER (no ECMA-376 token) and for
            export paths (GSheets) that branch on grain.
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
          description: >-
            Escape hatch for the non-expressible formats: Compact.AUTO and

            negative round (magnitude rounding). Mirrors
            getFieldFormatOverrideProps.
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: |-
            The expression cannot encode locale — carried beside it, mirroring
            Field.separator / getFieldFormatOverrideProps.
        format:
          type: string
          description: |-
            Lightdash format expression: ECMA-376 with in-repo extensions (IEC
            bytes, tz-shift for date expressions). MUST be rendered with
            formatValueWithExpression, never raw numfmt.
        label:
          type: string
          description: Display label. Absent ⇒ consumers fall back to the reference.
        type:
          $ref: '#/components/schemas/DimensionType'
        reference:
          type: string
      required:
        - type
        - reference
      type: object
    ContentAsCodeType.VIRTUAL_VIEW:
      enum:
        - virtual_view
      type: string
    Record_string.ParameterValue_:
      properties: {}
      additionalProperties:
        $ref: '#/components/schemas/ParameterValue'
      type: object
      description: Construct a type with a set of properties K of type T
    ResultColumnProvenance:
      properties:
        sourceQueryUuid:
          type: string
          description: >-
            Which query in a multi-source pipeline the field belongs to. Omitted

            for single-query results. Two composer nodes can both expose the
            same

            field name, so a bare fieldId is ambiguous across sources.
        fieldId:
          type: string
          description: Key into the query's fields map (query_history.fields).
      required:
        - fieldId
      type: object
    TimeFrames:
      enum:
        - 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
      type: string
    CustomFormat:
      properties:
        type:
          $ref: '#/components/schemas/CustomFormatType'
          description: Format type
        round:
          type: number
          format: double
          description: Number of decimal places
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: Number separator style
        currency:
          type: string
          description: Currency code (e.g., USD, GBP, EUR)
        compact:
          $ref: '#/components/schemas/CompactOrAlias'
          description: Compact format for large numbers (K, M, B, T) or byte units
        prefix:
          type: string
          description: Prefix to prepend to formatted values
        suffix:
          type: string
          description: Suffix to append to formatted values
        timeInterval:
          $ref: '#/components/schemas/TimeFrames'
          description: Time interval for date formatting
        custom:
          type: string
          description: Custom format string
      required:
        - type
      type: object
      additionalProperties: true
    NumberSeparator:
      enum:
        - default
        - commaPeriod
        - spacePeriod
        - periodComma
        - noSeparatorPeriod
        - apostrophePeriod
      type: string
    DimensionType:
      enum:
        - string
        - number
        - timestamp
        - date
        - boolean
      type: string
    ParameterValue:
      anyOf:
        - type: string
        - type: number
          format: double
        - items:
            type: string
          type: array
        - items:
            type: number
            format: double
          type: array
    CustomFormatType:
      enum:
        - default
        - percent
        - currency
        - number
        - id
        - date
        - timestamp
        - bytes_si
        - bytes_iec
        - custom
      type: string
    CompactOrAlias:
      anyOf:
        - $ref: '#/components/schemas/Compact'
        - type: string
          enum:
            - 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
    Compact:
      enum:
        - auto
        - thousands
        - millions
        - billions
        - trillions
        - kilobytes
        - megabytes
        - gigabytes
        - terabytes
        - petabytes
        - kibibytes
        - mebibytes
        - gibibytes
        - tebibytes
        - pebibytes
      type: string

````