---
title: "Upload file"
method: POST
path: "/api/v2/files"
tags: ["Files"]
---

# Upload file

`POST /api/v2/files`

Swagger notice: Swagger 2.0 doesn't support file upload with a `content-type` different than `application/x-www-form-urlencoded`.

## Headers

- `Content-Type` string, required

## Response `200`

Returns existing file if duplicate

- CodersdkUploadResponse
  - `hash` string, uuid

## Other responses

- `201` — Returns newly created file
- `413` — Request body exceeds 100 MiB, or a .zip archive exceeds it once expanded

## Changes

- **2026-08-18** `bca89c54d30d` — 1 info
  - added the non-success response with the status `413`

[Change history](https://skmtc.dev/coder/apis/coder-api/changes/api/v2/files/post.md)

---

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