Create a resumable upload session
POST/v1/storages/upload/resumable
Creates a resumable upload session based on the TUS protocol, suitable for multipart upload of large files and resumable uploads. On success, the Location response header returns the upload session URL, which is used for subsequent chunk uploads (PATCH), progress queries (HEAD), or termination (DELETE).
Protocol notes:
- The
Tus-Resumable: 1.0.0request header is required; - Declare the total file size via
Upload-Length, or defer it withUpload-Defer-Length: 1(declared later in a PATCH request). It is recommended to useUpload-Lengthwhenever possible; - Pass object information via
Upload-Metadata, wherebucketNameandobjectNameare required; - The first chunk can be sent along with the creation request (
Content-Type: application/offset+octet-stream); - After the last chunk is uploaded, the response carries the
Tus-Complete: 1header and the object is written to storage.
Request
Responses
- 201
- 400
- 401
- 403
- 409
- 412
- 413
- 500
Created successfully, no response body
Response Headers
Upload session URL, used by subsequent PATCH/HEAD/DELETE requests
TUS protocol version
Expiration time of an unfinished session (RFC 1123 format)
Gateway cache control
Gateway request ID, useful for log searches
Invalid request parameters, metadata, or length declaration
Missing or invalid platform credentials (MISSING_CREDENTIALS)
RLS policy or permission denied
The object already exists and x-upsert is not set (STORAGE_KEY_ALREADY_EXISTS)
Missing or unsupported Tus-Resumable header (ERR_UNSUPPORTED_VERSION)
Declared length exceeds the bucket limit or global quota (ERR_SIZE_EXCEEDED)
Internal server error