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

# List application repository tree

> List files and directories in the application Git repository at a given ref. Use this to discover the repository structure before reading individual files. Defaults to reading the commit of the latest successful deployment so you see exactly the code that is running. Only applications with a `privateGit` or `publicGit` source have a repository; `dockerImage` and internally created apps return 422.



## OpenAPI

````yaml https://api.sevalla.com/v3/openapi.json get /applications/{id}/repository/tree
openapi: 3.1.0
info:
  title: Sevalla API docs
  version: 1.0.0
servers:
  - url: https://api.sevalla.com/v3
security:
  - bearerAuth: []
paths:
  /applications/{id}/repository/tree:
    get:
      tags:
        - Applications
      summary: List application repository tree
      description: >-
        List files and directories in the application Git repository at a given
        ref. Use this to discover the repository structure before reading
        individual files. Defaults to reading the commit of the latest
        successful deployment so you see exactly the code that is running. Only
        applications with a `privateGit` or `publicGit` source have a
        repository; `dockerImage` and internally created apps return 422.
      operationId: listApplicationRepositoryTreeV3
      parameters:
        - schema:
            example: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
            type: string
          in: query
          name: ref
          required: false
          description: >-
            Branch, tag, or commit SHA to read the tree at. Defaults to the
            commit of the latest successful deployment, falling back to the
            default branch when there is no such deployment or the app's
            repository was changed after it (so the deployed commit no longer
            exists in the current repo). Pass the deployed commit SHA to inspect
            exactly the code that is running.
        - schema:
            example: src
            type: string
          in: query
          name: path
          required: false
          description: >-
            Directory path relative to the repository root. Defaults to the
            root.
        - schema:
            example: false
            type: string
          in: query
          name: recursive
          required: false
          description: >-
            When true, returns the full tree under `path` recursively in a
            single response. When false (default), returns only the immediate
            children. Large trees may be truncated.
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
            example: fb5e5168-4281-4bec-94c5-0d1584e9e657
          in: path
          name: id
          required: true
          description: Application identifier
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ref:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      The ref the tree was read at (the resolved commit SHA or
                      branch)
                    example: a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0
                  entries:
                    type: array
                    items:
                      type: object
                      properties:
                        path:
                          type: string
                          description: Path of the entry relative to the repository root
                          example: src/index.ts
                        type:
                          type: string
                          enum:
                            - file
                            - dir
                          description: >-
                            Entry type. `file` - a file (blob). `dir` - a
                            directory (tree).
                          example: file
                        size:
                          anyOf:
                            - type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            - type: 'null'
                          description: File size in bytes. Null for directories.
                          example: 1024
                        sha:
                          anyOf:
                            - type: string
                            - type: 'null'
                          description: Object SHA of the entry, when available
                          example: b1c2d3e4
                      required:
                        - path
                        - type
                        - size
                        - sha
                      additionalProperties: false
                    description: Tree entries at the requested path
                required:
                  - ref
                  - entries
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unauthorized
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 401
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Forbidden
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 403
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Not found
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 404
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Unprocessable entity
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 422
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Too many requests
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 429
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
                    example: Internal Server Error
                  status:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: HTTP status code
                    example: 500
                  data:
                    type: object
                    properties:
                      code:
                        description: Error tracking code for support reference
                        example: err-abc-123
                        type: string
                      message:
                        description: Additional error details or instructions
                        example: >-
                          If you need assistance, please contact support and
                          provide this error code.
                        type: string
                    additionalProperties: false
                required:
                  - message
                  - status
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Pass your API key as a Bearer token in the
        Authorization header.

````