---
title: "uploadFileV2"
method: POST
path: "/v2/files/upload"
tags: ["File"]
---

# uploadFileV2

`POST /v2/files/upload`

Create pre-signed S3 URL to upload a file to keep temporarily (one week).

Use the saveFileV2 operation to store file file permanently.

## Query parameters

- `file_entity_id` union
  - string — Empty string (used when file ID not yet assigned)
  - string, uuid — Valid UUID v4

## Request body

- UploadFilePayload
  - `filename` string, required
  - `mime_type` string — MIME type of file
  - `index_tag` string — Used to index the file at the storage layer, which helps when browsing for this file
  - `metadata` object — Allows passing in custom metadata for the file, expects key-value pairs of string type

## Response `201`

Pre-signed URL for POST / PUT upload

- FileUpload
  - `s3ref` object
    - `bucket` string, required
    - `key` string, required
  - `upload_url` string, url
  - `public_url` string, url — Returned only if file is permanent i.e. file_entity_id is passed

## Other responses

- `400` — Invalid request parameters or payload
- `401` — Authentication required or invalid credentials
- `500` — An unexpected error occurred on the server

---

[API](https://skmtc.net/epilot/apis/file-api.md) · [All operations](https://skmtc.net/epilot/apis/file-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/epilot/file-api/revisions/4d61b97f1e97/schema)
