> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-claude-gallant-ramanujan-0b34qw.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List the data-model source files for a deployment

Returns the data-model file tree. `first`/`after` (from the shared cursor params) paginate the **top-level** tree nodes only — a single node can carry a large subtree, so this bounds the number of roots returned, not the total file count. Omit `first` to get the whole tree.


## OpenAPI

````yaml /api-reference/api.yaml get /build/api/v1/deployments/{deploymentId}/data-model/files
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Folders
  - name: Reports
  - name: Workbooks
  - name: Notifications
  - name: Workspace
  - name: Users Admin
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: OpenAPI Spec
paths:
  /build/api/v1/deployments/{deploymentId}/data-model/files:
    get:
      tags:
        - Data Model
      summary: List the data-model source files for a deployment
      operationId: listFiles
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: query
          name: withContent
          required: false
          schema:
            type: boolean
        - in: query
          name: branchName
          required: false
          schema:
            type: string
        - in: query
          name: showLastCLIUpload
          required: false
          schema:
            type: boolean
        - in: query
          name: after
          schema:
            oneOf:
              - type: string
              - type: 'null'
        - in: query
          name: first
          schema:
            oneOf:
              - minimum: 1
                type: integer
              - type: 'null'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceTreeResponse'
          description: ''
components:
  schemas:
    SourceTreeResponse:
      properties:
        data:
          deprecated: true
          description: 'Deprecated: use `items` instead. Kept for backward compatibility.'
          items:
            additionalProperties: true
            type: object
          type: array
        items:
          items:
            additionalProperties: true
            type: object
          type: array
        pageInfo:
          oneOf:
            - $ref: '#/components/schemas/PageInfo'
            - type: 'null'
      required:
        - items
        - data
      type: object
    PageInfo:
      properties:
        endCursor:
          oneOf:
            - type: string
            - type: 'null'
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - hasNextPage
        - hasPreviousPage
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````