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

# List project files

> Lists files registered in a project, most recently updated first. Pass `tree=true` to receive a nested folder tree instead of a flat list.




## OpenAPI

````yaml GET /projects/{projectId}/files
openapi: 3.1.0
info:
  title: TeamAI API
  version: '1.0'
  description: >
    REST API for TeamAI. Run agents and chat completions, and manage projects,
    files, and skills programmatically.
servers:
  - url: https://app.teamai.com/api/v1
security:
  - apiKey: []
tags:
  - name: Chat
  - name: Agents
  - name: Projects
  - name: Skills
paths:
  /projects/{projectId}/files:
    get:
      tags:
        - Projects
      summary: List project files
      description: >
        Lists files registered in a project, most recently updated first. Pass
        `tree=true` to receive a nested folder tree instead of a flat list.
      parameters:
        - $ref: '#/components/parameters/projectId'
        - name: tree
          in: query
          schema:
            type: boolean
            default: false
          description: Return a nested folder tree. Ignores limit and offset.
        - name: limit
          in: query
          schema:
            type: integer
          description: Page size. Omit for all files.
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Files as a flat list (default) or tree (`tree=true`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      files:
                        type: array
                        items:
                          $ref: '#/components/schemas/ProjectFile'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/NotAuthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    projectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: Project ID.
  schemas:
    ProjectFile:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        name:
          type: string
        path:
          type: string
          description: Relative path within the project, including folders.
        mimeType:
          type: string
          nullable: true
        sizeBytes:
          type: integer
        type:
          type: string
          enum:
            - uploaded
            - text
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        syncedAt:
          type: string
          format: date-time
          nullable: true
    Pagination:
      type: object
      properties:
        total:
          type: integer
          description: Total matching records.
        limit:
          type: integer
        offset:
          type: integer
    Error:
      type: object
      properties:
        code:
          type: string
          description: Machine-readable error code.
          example: bad_request
        message:
          type: string
          description: Human-readable error description.
        details:
          type: object
          additionalProperties: true
          description: Additional error context.
  responses:
    NotAuthenticated:
      description: >
        API key missing or invalid (`not_authenticated`), or valid but not
        permitted to access this resource (`unauthorized`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Requested resource does not exist or is not visible to this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-teamai-api-key
      description: >
        Secret API key created in Workspace Settings → API Keys (workspace keys)
        or Organization Admin → API Keys (organization keys).

````