File uploads are handled via presigned URLs to MinIO. The API exposes two main steps:Documentation Index
Fetch the complete documentation index at: https://docs.dragdropdo.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/v1/initiate-upload– create an upload session and receive presigned URLs.POST /api/v1/complete-upload– finalize the upload and register the file for operations.
PUT (parts: 1). For files larger than 5 GiB, you must use multipart upload: set parts to the number of chunks you will upload (each chunk is uploaded with its own presigned URL), PUT each part separately, collect each response’s ETag, then call complete-upload with every (etag, part_number) pair. This matches S3‑compatible limits: a single PUT cannot exceed 5 GiB per object part.
Initiate upload
file_name(required) – original file name including extension.size(required) – file size in bytes.mime_type(required) – MIME type (e.g.application/pdf).parts(optional) – number of multipart parts; defaults to1when omitted or zero. Use1for files ≤ 5 GiB. For > 5 GiB, setpartsto how many pieces you will upload (see Multipart upload example).
ExternalUploadResponse):
file_key– stable key to reference this file in later operations.object_name– internal object name in MinIO.upload_id– underlying multipart upload id (if applicable).presigned_urls– list ofPUTURLs to upload file parts.
Upload file contents
Use the providedpresigned_urls to upload file data directly to MinIO. For single‑part uploads there will be exactly one URL. For multipart uploads there is one URL per part, in order (index 0 → part_number 1, and so on).
Getting ETag values for complete-upload
After each successful presigned PUT:
- Read the
ETagHTTP response header (not the request body). - Remove surrounding double quotes if present (S3 and MinIO often return
"abc123..."). - Send that string as
parts[i].etagwithpart_numberequal to the 1‑based part index (first URL →1, second →2, …).
part_number order, complete-upload can fail when the storage backend completes the multipart upload.
Multipart upload example (files larger than 5 GiB)
Why multipart: S3‑compatible storage allows at most 5 GiB per singlePUT. Objects larger than 5 GiB must be split into multiple parts: each part is uploaded with its own presigned URL, and you pass every part’s ETag into complete-upload.
Flow:
- Decide how many parts
Nyou need (each uploaded part’s body must be ≤ 5 GiB; size the ranges so the whole file is covered). POST /api/v1/initiate-uploadwithparts:N,size: total file size in bytes, plusfile_nameandmime_type. The response includesNentries inpresigned_urls(in order: part 1, part 2, …).- For each index
ifrom0toN - 1,PUTthe corresponding byte range of your file topresigned_urls[i]. After each successfulPUT, readETagfrom the response headers and strip double quotes (see GettingETagvalues forcomplete-upload). POST /api/v1/complete-uploadwithpartslisting allNparts, each with the correctpart_number(1…N) matching the presigned URL order.
"parts": 3, upload three ranges, then complete with three { "etag", "part_number" } objects.
presigned_urls, PUT each chunk, push { etag: strippedETag, part_number: i + 1 }, then POST the array to complete-upload.
Complete upload
POST /api/v1/complete-upload finalizes the multipart upload in storage and registers the file so it can be referenced by file_key in /api/v1/do and related APIs. Call it only after every part has been uploaded successfully via the presigned PUT URLs.
Authentication: same as other Business API routes — Authorization: Bearer <your-api-key> and Content-Type: application/json.
Request body
JSON body (CompleteUploadRequest):
file_key(required) – frominitiate-uploadresponse.object_name(required) – frominitiate-uploadresponse.upload_id(required) – frominitiate-uploadresponse.parts(required) – one entry per uploaded part, in order:etag(required) – value of theETagheader from the corresponding presignedPUTresponse. If the header includes double quotes (common for S3‑compatible storage), strip them before sending.part_number(required) – 1‑based index matching the part and presigned URL order from initiate upload.
parts is a one‑element array.
Response
On success, HTTP 200 with a JSON body (CompleteUploadResponse):
message– status text from the server (typically includes the stored object ETag after a successful complete). If the upload was already finalized, the message may instead be a short confirmation such asfile upload completed.file_key– echoes the key you sent; use this key in operations.
/api/v1/do operations.