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

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
