---
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` string

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

---

[API](https://skmtc.dev/epilot/apis/webhooks.md) · [All operations](https://skmtc.dev/epilot/apis/webhooks/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/epilot/webhooks/revisions/ff893c7d7bfc/schema)
