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

# Request file upload URL

> Returns a signed upload URL valid for 15 minutes (step 1 of 2). PUT the file bytes to `uploadUrl` with the same `Content-Type`, then call the sync endpoint to register the file. Limits: 50MB per file, 500 files per project, 500MB total storage per project.




## OpenAPI

````yaml POST /projects/{projectId}/files/upload
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/upload:
    post:
      tags:
        - Projects
      summary: Request file upload URL
      description: >
        Returns a signed upload URL valid for 15 minutes (step 1 of 2). PUT the
        file bytes to `uploadUrl` with the same `Content-Type`, then call the
        sync endpoint to register the file. Limits: 50MB per file, 500 files per
        project, 500MB total storage per project.
      parameters:
        - $ref: '#/components/parameters/projectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - filename
                - contentType
              properties:
                filename:
                  type: string
                  maxLength: 255
                contentType:
                  type: string
                  description: >
                    MIME type of the file. Common document, image, text, code,
                    and archive types are allowed.
                sizeBytes:
                  type: integer
                  description: File size, used to enforce storage quotas.
                folder:
                  type: string
                  description: Optional subfolder path.
      responses:
        '200':
          description: Signed upload target.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      uploadUrl:
                        type: string
                        description: Signed PUT URL, expires in 15 minutes.
                      gcsPath:
                        type: string
                        description: Storage path the file will occupy.
        '400':
          $ref: '#/components/responses/BadRequest'
        '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:
    BadRequest:
      description: Request body or parameters failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    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).

````