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

# Upload a file

`POST /api/files/actions/upload`

# Errors
Returns an error if file upload, database operations, or file system operations fail.

## Response `201`

File uploaded successfully

- FileUploadResponse — Response for file upload operations
  - `file` UserFileInfo, required — User file information for API responses
    - `created_at` string, date-time, nullable — File upload timestamp
    - `file_hash` string, required — SHA-256 hash of the file
    - `file_size` integer, required — Size of the file in bytes
    - `filename` string, required — Current filename
    - `id` string, uuid, required — File's unique identifier
    - `metadata` Value — Flexible JSON value that can be an object, array, string, number, boolean, or null
    - `mime_type` string, required — MIME type of the file
    - `original_filename` string, required — Original filename as uploaded by user
    - `status` 'uploaded' | 'processing' | 'processed' | 'failed' | 'deleted', required — File processing status for user uploaded files
    - `updated_at` string, date-time, nullable — File last update timestamp
    - `user_id` string, uuid, required — ID of the user who owns this file
  - `message` string, required — Upload confirmation message

## Other responses

- `400` — Invalid file upload request or malformed file data
- `401` — Authentication required for file upload
- `413` — Uploaded file exceeds maximum size limit
- `500` — Server error during file upload or storage

## Changes

- **2025-09-22** `93deff514935` — 1 info
  - endpoint added
- **2025-09-01** `a2488be8a6e4` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/patroninc/apis/patron-api/changes/api/files/actions/upload/post.md)

---

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