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

# Finalize an upload

> Finish an upload so the file becomes available to the agent.

Call this after sending the bytes to the `upload_url` from `POST /files/uploads`. Until you do, the file is stored but not yet visible to Tasks in the project's Drive.


## OpenAPI

````yaml api-reference/openapi.json POST /files/{file_id}/finalize
openapi: 3.1.0
info:
  title: Biomni Public API — V0
  description: >-
    The public API for **Biomni** — the AI agent platform for clinical genomics
    (variant annotation, ClinVar lookups, PMID-cited literature, and project
    file drives). Create projects and Tasks, send messages to the agent, stream
    its replies, manage files, and check your usage — all from your own code.


    **Authentication**: send `Authorization: Bearer <your-api-key>`. The adapter
    forwards your key straight to Biomni; it never stores it.


    **Safe retries**: send `Idempotency-Key: <token>` on POST endpoints
    (`/projects`, `/tasks`, `/messages`, `/files/uploads`) so a retried request
    won't create a duplicate.
  version: 0.1.0
servers:
  - url: https://api.phylo.bio/api/v1
security: []
paths:
  /files/{file_id}/finalize:
    post:
      tags:
        - files
      summary: Finalize an upload
      description: Finish an upload so the file becomes available to the agent.
      operationId: finalize_upload_files__file_id__finalize_post
      parameters:
        - name: file_id
          in: path
          required: true
          schema:
            type: string
            title: File Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/FinalizeUploadRequest'
                - type: 'null'
              title: Req
      responses:
        '200':
          description: >-
            Upload finished; the file will appear in the project's Drive and
            become readable by the agent shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFinalized'
              example:
                object: upload_finalized
                file_id: 9c3d3be7-13d3-4deb-8e6a-aa3a9b51abd4
      security:
        - bearerAuth: []
components:
  schemas:
    FinalizeUploadRequest:
      properties:
        upload_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Upload Id
        parts:
          anyOf:
            - items:
                $ref: '#/components/schemas/CompletedPart'
              type: array
            - type: 'null'
          title: Parts
      type: object
      title: FinalizeUploadRequest
      description: |-
        Body for POST /files/{file_id}/finalize.

        Omit both fields for a single upload. For a multipart upload, send the
        `upload_id` from the intent plus every part's `{part_number, etag}`.
    UploadFinalized:
      properties:
        object:
          type: string
          const: upload_finalized
          title: Object
          default: upload_finalized
        file_id:
          type: string
          title: File Id
      type: object
      required:
        - file_id
      title: UploadFinalized
    CompletedPart:
      properties:
        part_number:
          type: integer
          exclusiveMinimum: 0
          title: Part Number
        etag:
          type: string
          title: Etag
          description: ETag returned by S3 in the part's PUT response
      type: object
      required:
        - part_number
        - etag
      title: CompletedPart
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Requires an API key. See the Authentication guide.

````