---
title: "Upload a file"
method: POST
path: "/v1/upload_file"
tags: ["Files"]
---

# Upload a file

`POST /v1/upload_file`

Upload a file to Skyvern storage so runs can reference it as an input. Returns the file id, its storage URI, a presigned download URL, and the expiry implied by the requested retention period.

## Headers

- `x-api-key` string, nullable — Skyvern API key for authentication. API key can be found at https://app.skyvern.com/settings.

## Response `200`

Successful Response

- UploadFileResponse
  - `s3_uri` string, required — S3 URI where the file was uploaded
  - `presigned_url` string, required — Presigned URL to access the uploaded file
  - `file_id` string, nullable — Identifier for this upload. Pass it to DELETE /v1/files/{file_id} to delete the file.
  - `expires_at` string, date-time, nullable — When the file will be deleted, if a retention_days was supplied. Null means the file has no expiry of its own and follows the organization's data retention policy.

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-19** `830020b643cd` — 3 info
  - added the new optional request property `retention_days`
  - added the optional property `expires_at` to the response with the `200` status
  - added the optional property `file_id` to the response with the `200` status
- **2026-06-08** `3a3616091b66` — 1 breaking, 5 info
  - the `file` request property contentMediaType changed from `` to `application/octet-stream`
  - `header` request parameter `x-api-key` list-of-types was widened by adding types `null`
  - for the `header` request parameter `x-api-key`, the type was generalized from `string` to no type
  - the `file` request property format was generalized from `binary` to no format
  - …2 more
- **2026-02-04** `a8899e7707c4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2/changes/v1/upload_file/post.md)

---

[API](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2.md) · [All operations](https://skmtc.dev/skyvern-ai/apis/skyvern-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/skyvern-ai/skyvern-api-2/revisions/d9771d57ea65/schema)
