Marvia Developer Portal
DocsAPI ReferenceAbout
DocsAPI ReferenceAbout
  1. Docs
  • Getting Started
  • Authentication
  • Permissions
  • Using the Marvia CDN
  • Upload Files via API
  • API Reference
    • Users
      • Get a user
      • Delete a user
      • Update a user
      • List
      • Create a new user
    • Products
      • List products
    • Locations
      • Update a location
      • Get a location
      • Delete a location
      • List locations
      • Create a new location
    • Groups
      • Get a group
      • Update a group
      • Delete a group
      • List groups
      • Create a new group
    • Uploads
      • Initialize multipart upload
      • Complete multipart upload
    • Assets
      • List assets
      • Create a new asset
      • Get asset by UUID
      • Update an asset
      • Search assets
  1. Docs

Upload Files via API

Large files are uploaded using a multipart upload process. This makes uploads more reliable and efficient, especially for big files or unstable connections.
The following repository provides reference implementations and examples showcasing how to integrate with Marvia's API upload endpoints: marvia/api-upload-examples

Process Overview#

The process involves three main steps:
1.
Initialize the multipart upload - Initialize Multipart Upload Endpoint
2.
Upload each part to the pre-signed URLs returned
3.
Complete the multipart upload with the part checksums (ETags) - Complete Multipart Upload Endpoint
The sequence diagram below visually explains the expected integration flow.

1. Initialize Multipart Upload#

Call the initialize endpoint with the following file metadata:
fileName
fileSize
Response includes:
A temporary uuidfor tracking
An array of parts with { partNumber, url } where each part must be uploaded

2. Upload Each Part#

For each part:
Use the provided pre-signed URL
Upload with an HTTP PUT request
Record the ETag from the response headers (this is required later)
Example (cURL)

3. Complete Multipart Upload#

Once all parts are uploaded and you have their ETags, call the complete endpoint with:
The uuid from step 1
An array of { partNumber, ETag } for each uploaded part
Example request body:
{
  "uuid": "UPLOAD-ID-FROM-INIT",
  "parts": [
    { "partNumber": 1, "ETag": "etag-part-1" },
    { "partNumber": 2, "ETag": "etag-part-2" },
    { "partNumber": 3, "ETag": "etag-part-3" }
  ]
}
Response includes:
Final fileUuid
Public or signed url to the completed file

Summary#

Use Initialize Multipart Upload to start and get pre-signed part URLs.
Upload all parts directly to storage, keeping track of each ETag.
Call Complete Multipart Upload with the collected ETags.
The API responds with the final fileUuid and accessible file URL.
Modified at 2025-09-25 10:33:24
Previous
Using the Marvia CDN
Next
Get a user
Built with