> ## 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.

# Sync project files

> Reconciles the project's file records with uploaded storage contents (step 2 after uploading). Registers new uploads, removes records for deleted objects, and updates sizes.




## OpenAPI

````yaml POST /projects/{projectId}/files/sync
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/sync:
    post:
      tags:
        - Projects
      summary: Sync project files
      description: >
        Reconciles the project's file records with uploaded storage contents
        (step 2 after uploading). Registers new uploads, removes records for
        deleted objects, and updates sizes.
      parameters:
        - $ref: '#/components/parameters/projectId'
      responses:
        '200':
          description: Sync results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      added:
                        type: integer
                      removed:
                        type: integer
                      updated:
                        type: integer
        '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.
  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'
  schemas:
    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.
  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).

````