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

# Update File

> Update a file. Changing extension regenerates stored filename.

Update a file. `name` must remain unique per team and keep a valid extension. If the extension changes, a new stored filename is generated.


## OpenAPI

````yaml PATCH /files/{id}
openapi: 3.1.0
info:
  title: LoadForge API
  description: >-
    The LoadForge API provides programmatic access to create, manage, and run
    load tests on your web applications
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://app.loadforge.com/api/v2
security:
  - bearerAuth: []
paths:
  /files/{id}:
    patch:
      description: Update a file. Changing extension regenerates stored filename.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - content
              properties:
                name:
                  type: string
                  description: >-
                    Filename ending with .csv, .json, or .txt. Must be unique
                    per team.
                content:
                  type: string
                  description: >-
                    Plain text or base64-encoded file content. Base64 is
                    auto-detected.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  file_id:
                    type: integer
              example:
                file_id: 123
        '400':
          description: Validation, duplicate name, or missing record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope
components:
  schemas:
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````