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

# Request a presigned upload URL for an existing file

> Returns a temporary upload URL that replaces an existing file's content in place, keeping its id. PUT the file directly to the returned URL. Use this when a reference to the file had to be written before its bytes were available. The stored name and mime type are reused; only the size is updated. Only the user who created the file can replace it.



## OpenAPI

````yaml /openapi/customer-api.json post /project/{projectId}/files/{id}/request-upload
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Flow customer API reference. Start with the [quickstart](/api/quickstart)
    and [authentication guide](/api/authentication).
  title: Customer API
  version: 1.0.0
servers:
  - description: Flow API
    url: https://backend.branch.flowengineering.com
security: []
tags:
  - name: Automations
  - name: Branches
  - name: Comments
  - name: Convert
  - name: Data Model
  - name: Diagrams
  - name: Entities
  - name: Files
  - name: Import
  - name: Notifications
  - name: Projects
  - name: ReqIF
  - name: ReqIF Import
  - name: Shared Access Grants
  - name: User Groups
  - name: Users
paths:
  /project/{projectId}/files/{id}/request-upload:
    post:
      tags:
        - Files
      summary: Request a presigned upload URL for an existing file
      description: >-
        Returns a temporary upload URL that replaces an existing file's content
        in place, keeping its id. PUT the file directly to the returned URL. Use
        this when a reference to the file had to be written before its bytes
        were available. The stored name and mime type are reused; only the size
        is updated. Only the user who created the file can replace it.
      operationId: FilesController_requestReupload
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: projectId
          required: true
          schema:
            type: string
        - description: Branch rendered by the shared Reader view.
          in: query
          name: branchId
          required: false
          schema:
            type: string
        - description: Saved view that granted the external Reader access.
          in: query
          name: viewId
          required: false
          schema:
            type: string
        - description: Reachable entity whose rich text or diagram references the file.
          in: query
          name: entityId
          required: false
          schema:
            type: string
        - description: Workspace identifier
          in: header
          name: customer
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReuploadFileDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponseDto'
          description: ''
      security:
        - api-key: []
        - bearer: []
components:
  schemas:
    ReuploadFileDto:
      properties:
        size:
          description: >-
            Size in bytes of the replacement content. Overwrites the stored
            size, which was declared when the record was first minted.
          type: number
      required:
        - size
      type: object
    FileUploadResponseDto:
      properties:
        id:
          type: string
        mime_type:
          type: string
        original_name:
          type: string
        size:
          type: number
        upload_headers:
          additionalProperties:
            type: string
          description: >-
            Headers the client MUST send on the PUT to upload_url. Empty for S3;
            { "x-ms-blob-type": "BlockBlob" } for Azure Blob. Apply them all.
          type: object
        upload_url:
          type: string
      required:
        - id
        - upload_url
        - upload_headers
        - original_name
        - size
        - mime_type
      type: object
  securitySchemes:
    api-key:
      in: header
      name: X-API-Key
      type: apiKey
    bearer:
      bearerFormat: JWT
      scheme: bearer
      type: http

````