/api/upload

Upload one or more files. Supports both regular and chunked ("partial") uploads. Quota and folder restrictions may apply.

Info

This endpoint requires authentication.

POST
Request

Headers

See upload options for headers.

Body

Content-Type: multipart/form-data

All files should be included in the form data with the key file. You can upload multiple files by repeating the file key.

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
files{ id: string; type: string; url: string; pending?: boolean; }[]Uploaded file(s) info.
pending is true if the file is not fully uploaded (e.g. chunked upload).
deletesAtstring?ISO timestamp when files will be deleted.
assumedMimetypesboolean[]?List indicating if file mimetypes were assumed.
partialSuccessboolean?If the partial upload (chunk) succeeded.
partialIdentifierstring?Identifier for the partial upload session.

Example

{
"files": [
{
"id": "cmb60pvng00039kentdaw6p68",
"type": "image/png",
"url": "http://localhost:3000/u/brg2IB.png"
}
]
}

Error Responses

  • 400 Bad Request

    • Missing or invalid headers
    • Folder does not exist
    • Partial uploads with multiple files
    • Malfored upload, missing files, etc.
  • 403 Forbidden

    Folder uploads not allowed for anonymous user

  • 413 Payload Too Large

    Upload would exceed user quota (by file count or by bytes)

  • 500 Internal Server Error

    Unexpected server error while processing upload



Last updated: 5/28/2025
Edit this page on GitHub