Complete File Upload
POST /api/videos/uploads/{uploadSessionId}/files/{uploadId}/complete
Finalize one uploaded file. Once every file in the upload group reaches completed, SpatialGen will automatically create the downstream library record and processing job for the full video asset set.
Allowed API Key Roles
adminupload
Route Parameters
uploadSessionId: string UUID for the upload groupuploadId: string UUID for the file within that group
Request Body
parts: array, optional forsingle_put, required formultipart
Each multipart parts[] item includes:
partNumber: positive integeretag: string
Behavior Notes
- Multipart completion must include every part number from
1throughtotalParts. - Single-part uploads do not need to send a
partsarray. - Repeating
completeon an already completed file is safe and will return the same file state. - When the last file in the group completes, SpatialGen creates one library record and queues one processing job automatically.
libraryIdstaysnulluntil the upload group is fully completed. The final successfulcompletecall returns the new library ID.
Response Shape
uploadId: stringfileRole: stringfileName: stringtotalBytes: numberpartSizeBytes: numbertotalParts: numberuploadStrategy:"single_put" | "multipart"status: stringlibraryId:number | null
Example Request
fetch('https://spatialgen.com/api/videos/uploads/5ea97a59-95e0-4c8b-a634-b0fa9976f6ff/files/402f0bda-a0fa-4551-ae28-7300ab6678dd/complete', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-SPATIALGEN-APPKEY': apiKey, }, body: JSON.stringify({ parts: [ { partNumber: 1, etag: '"etag-part-1"' }, { partNumber: 2, etag: '"etag-part-2"' }, ], }),})Example Response
{ "uploadId": "402f0bda-a0fa-4551-ae28-7300ab6678dd", "fileRole": "video_left", "fileName": "left-eye.mov", "totalBytes": 1287340032, "partSizeBytes": 104857600, "totalParts": 13, "uploadStrategy": "multipart", "status": "completed", "libraryId": 4821}