cURL
Endpoints
Multipart Upload
Upload large files using a three-step multipart upload flow.
POST
cURL
Documentation Index
Fetch the complete documentation index at: https://developer.copera.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Uploading files to the drive uses a three-step multipart upload flow via S3. This approach supports large files reliably by splitting them into parts that are uploaded directly to S3 using signed URLs.Upload Flow
Step 1: Start the Upload
POST /public/v1/drive/files/upload/multipart/start
Initiate a new multipart upload by providing file metadata.
Request body:
fileName(required): Name of the file being uploaded.fileSize(required): Total file size in bytes.mimeType(required): MIME type of the file (e.g.,application/pdf,image/png).parentId(optional): ID of the parent folder. Omit to upload to the root.
uploadId: The S3 multipart upload identifier.fileKey: The S3 object key for this file.
Step 2: Get Presigned URLs
POST /public/v1/drive/files/upload/multipart/presigned-urls
Request signed URLs for each part of the file.
Request body:
uploadId(required): The upload ID from Step 1.fileKey(required): The file key from Step 1.parts(required): The number of parts to upload. Split your file into chunks and request one URL per chunk.
urls: Array of signed URLs, one for each part. Each URL is used to upload a single chunk via HTTP PUT.
Step 3: Upload Parts to S3
Upload each file chunk directly to S3 using the signed URLs from Step 2. For each part:- Send an HTTP
PUTrequest to the signed URL with the file chunk as the body. - Record the
ETagheader from each S3 response — you will need it in the next step.
Step 4: Finalize the Upload
POST /public/v1/drive/files/upload/multipart/finalize
Complete the upload by providing the part information from S3.
Request body:
uploadId(required): The upload ID from Step 1.fileKey(required): The file key from Step 1.parts(required): Array of objects, each containing:partNumber: The 1-based index of the part.eTag: The ETag value returned by S3 when uploading that part.
- Returns the created drive item with its ID, name, and metadata.
Example
Authorizations
Bearer token
Body
application/json