---
title: "Upload a single file"
method: POST
path: "/user/files/upload"
tags: ["user APIs"]
---

# Upload a single file

`POST /user/files/upload`

Upload a single file for the logged in user to an existing directory. This API does not use multipart/form-data and so no temporary files are created server side but only a single file can be uploaded as POST body

## Query parameters

- `path` string, required
- `mkdir_parents` boolean

## Headers

- `X-SFTPGO-MTIME` integer

## Response `201`

successful operation

- ApiResponse
  - `message` string — message, can be empty
  - `error` string — error description if any

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `413` — Request Entity Too Large, max allowed size exceeded
- `500` — Internal Server Error
- `default` — Unexpected Error

---

[API](https://skmtc.net/kanton-bern/apis/sftpgo.md) · [All operations](https://skmtc.net/kanton-bern/apis/sftpgo/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kanton-bern/sftpgo/versions/d8d616a479b0/schema)
