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

# Upload a new file

`POST /v1/files`

Uploads a file to the user's storage. The file size is limited to 10MB.

## Response `201`

File uploaded successfully. Returns the file metadata.

- union — The response for a file. Properties depend on the file type.
  - ImageResponse — The response for an image file
    - `id` string, required — The id of the file
    - `name` string, required — The name of the file
    - `task_id` string, nullable, required — The id of the task that generated this file, if any
    - `created_at` string, required — The creation date of the file in ISO format
    - `type` 'image/png' | 'image/jpeg' | 'image/webp', required — The MIME type of the file
    - `properties` object, required
      - `size` number, required — The size of the image in bytes
      - `width` number, required — The width of the image in pixels
      - `height` number, required — The height of the image in pixels
  - DocumentResponse — The response for a document file
    - `id` string, required — The id of the file
    - `name` string, required — The name of the file
    - `task_id` string, nullable, required — The id of the task that generated this file, if any
    - `created_at` string, required — The creation date of the file in ISO format
    - `type` 'application/pdf', required — The MIME type of the file
    - `properties` object, required
      - `size` number, required — The size of the document in bytes
      - `page_count` number, required — The number of pages in the document

## Other responses

- `422` — Validation Error. The request form data is invalid.
- `429` — Rate Limit Exceeded.
- `5XX` — Internal Server Error.

## Changes

- **2025-06-24** `42f9aa9c3b27` — 1 info
  - the `name` request property's maxLength was increased from `30` to `50`

[Change history](https://skmtc.dev/scan-documents/apis/scan-documents-api/changes/v1/files/post.md)

---

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