Storage Objects

Upload a file or create resumable session

Changed on

Unified endpoint for file uploads. Behavior depends on Content-Type and headers:

Simple Upload (multipart/form-data): Upload a complete file in a single request. Best for files under 100MB.

Create Resumable Session (application/json): Create a session for chunked uploads. Best for large files or unreliable networks. Requires: Content-Type: application/json with body {"filename": "...", "content_type": "...", "total_size": ...}

Complete Resumable Session: Complete a session after all parts are uploaded. Requires: X-Upload-Session header with session ID and X-Upload-Complete: true header.

Resumable Session Ownership: A session created with a user access token remains bound to that user. A session created with an anon key remains bound to that exact anon key. Reuse the same identity or anon key for part uploads, status, completion, and abort requests; an ownership mismatch returns 404.

post/storage/{bucketName}/{path}

Request

  • Base URL
    https://api.volcano.dev
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

bucketName, string required

Storage bucket name

path, string required

Object path within bucket

Headers

X-Upload-Session, string

Upload session ID (for completing resumable uploads)

X-Upload-Complete, 'true'

Set to "true" to complete a resumable upload session

Request body

CreateUploadSessionRequest required

Request to create a resumable upload session

object_path, string required

Target file path within the bucket

content_type, string required

MIME type of the file

total_size, integer required

Total file size in bytes (max 5TB)

part_size, integer

Part size in bytes (default: 25MB, min: 5MB, max: 25MB)

Example request

{
  "object_path": "videos/large-file.mp4",
  "content_type": "video/mp4",
  "total_size": 5368709120,
  "part_size": 26214400
}

Response

Resumable upload completed (when X-Upload-Complete=true)

CompleteUploadSessionResponse required

Response when completing an upload

object, StorageObject

Changes

    • breaking

      added the new path request parameter bucketName

    • breaking

      added the new required request property content_type

    • breaking

      added the new required request property object_path

    26 more changes in this revision