---
title: "Upload files"
method: POST
path: "/files"
tags: ["files"]
---

# Upload files

`POST /files`

Upload one or more files to a specified bucket. Supports batch uploading with optional custom metadata for each file. If uploading multiple files, either provide metadata for all files or none.

## Response `201`

Files successfully uploaded

- object
  - `processedFiles` FileMetadata[], required — List of successfully processed files with their metadata.
    - `id` string, required — Unique identifier for the file.
    - `name` string, required — Name of the file including extension.
    - `size` integer, required — Size of the file in bytes.
    - `bucketId` string, required — ID of the bucket containing the file.
    - `etag` string, required — Entity tag for cache validation.
    - `createdAt` string, date-time, required — Timestamp when the file was created.
    - `updatedAt` string, date-time, required — Timestamp when the file was last updated.
    - `isUploaded` boolean, required — Whether the file has been successfully uploaded.
    - `mimeType` string, required — MIME type of the file.
    - `uploadedByUserId` string — ID of the user who uploaded the file.
    - `metadata` object — Custom metadata associated with the file.

## Other responses

- `default` — Error occurred during upload

---

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