Skip to main content

Upload

File uploads are handled via presigned URLs to MinIO. The API exposes two main steps:
  • POST /v1/biz/initiate-upload – create an upload session and receive presigned URLs.
  • POST /v1/biz/complete-upload – finalize the upload and register the file for operations.

Initiate upload

curl -X POST https://api.dragdropdo.com/v1/biz/initiate-upload \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_name": "document.pdf",
    "size": 1234567,
    "mime_type": "application/pdf",
    "parts": 1
  }'
  • 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) – multipart upload parts; defaults to 1 when omitted or zero.
Response (ExternalUploadResponse):
{
  "file_key": "file_key_123",
  "object_name": "external/...",
  "upload_id": "upload-id",
  "presigned_urls": [
    "https://minio.example.com/bucket/object?X-Amz-Signature=..."
  ]
}
  • 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 of PUT URLs to upload file parts.

Upload file contents

Use the provided presigned_urls to upload file data directly to MinIO. For single‑part uploads there will be exactly one URL.
# Upload file to presigned URL
curl -X PUT "https://minio.example.com/bucket/object?X-Amz-Signature=..." \
  -H "Content-Type: application/pdf" \
  --data-binary "@document.pdf"

Complete upload

Once all parts have been uploaded, finalize the upload so that the file can be used by operations.
curl -X POST https://api.dragdropdo.com/v1/biz/complete-upload \
  -H "X-D3-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "file_key": "file_key_123"
  }'
On success, the server persists metadata in the repository layer and the file becomes available for /v1/biz/do operations.