Start Multipart Upload
curl --request POST \
--url https://api.example.com/api/partner/v1/files/multipart \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"size": 123,
"filename": "<string>"
}
'import requests
url = "https://api.example.com/api/partner/v1/files/multipart"
payload = {
"contentType": "<string>",
"size": 123,
"filename": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contentType: '<string>', size: 123, filename: '<string>'})
};
fetch('https://api.example.com/api/partner/v1/files/multipart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/partner/v1/files/multipart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentType' => '<string>',
'size' => 123,
'filename' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/partner/v1/files/multipart"
payload := strings.NewReader("{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/partner/v1/files/multipart")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partner/v1/files/multipart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"code": 201,
"message": "Multipart upload started",
"data": {
"id": "11111111-1111-4111-8111-111111111111",
"uploadId": "2~example-upload-id",
"partSize": 16777216,
"parts": [
{ "partNumber": 1, "uploadUrl": "https://storage.example.com/presigned-part-1..." },
{ "partNumber": 2, "uploadUrl": "https://storage.example.com/presigned-part-2..." }
],
"expiresIn": 3600
}
}
Files
Start Multipart Upload
Upload videos up to 500 MB in resumable parts, then finalize them into the Genviral Media Library.
POST
/
api
/
partner
/
v1
/
files
/
multipart
Start Multipart Upload
curl --request POST \
--url https://api.example.com/api/partner/v1/files/multipart \
--header 'Content-Type: application/json' \
--data '
{
"contentType": "<string>",
"size": 123,
"filename": "<string>"
}
'import requests
url = "https://api.example.com/api/partner/v1/files/multipart"
payload = {
"contentType": "<string>",
"size": 123,
"filename": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contentType: '<string>', size: 123, filename: '<string>'})
};
fetch('https://api.example.com/api/partner/v1/files/multipart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/partner/v1/files/multipart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contentType' => '<string>',
'size' => 123,
'filename' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/partner/v1/files/multipart"
payload := strings.NewReader("{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/partner/v1/files/multipart")
.header("Content-Type", "application/json")
.body("{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/partner/v1/files/multipart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contentType\": \"<string>\",\n \"size\": 123,\n \"filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"code": 201,
"message": "Multipart upload started",
"data": {
"id": "11111111-1111-4111-8111-111111111111",
"uploadId": "2~example-upload-id",
"partSize": 16777216,
"parts": [
{ "partNumber": 1, "uploadUrl": "https://storage.example.com/presigned-part-1..." },
{ "partNumber": 2, "uploadUrl": "https://storage.example.com/presigned-part-2..." }
],
"expiresIn": 3600
}
}
Use a multipart upload for videos larger than 100 MB, such as phone footage (a minute of 4K is
about 350 MB). Each part is an independent PUT, so a dropped connection resends one part instead
of the whole file. Nothing appears in the Media Library until
Complete Multipart Upload verifies the bytes.
How It Works
- Call this endpoint with the content type, exact byte
size, and a stableIdempotency-Key. - Split the file into
partSizechunks (16 MiB). PUT chunk n toparts[n-1].uploadUrl. The last part carries the remainder. Each URL accepts exactly its part’s length. - Keep the
ETagresponse header of every part PUT. - Call Complete Multipart Upload with every
partNumberand itsetag.
expiresIn seconds (one hour). To resume later, call this
endpoint again with the same Idempotency-Key and body: you get the same upload id and
uploadId with fresh part URLs. Re-PUT only the parts that did not finish.
Body Parameters
string
required
MIME type of the file. Videos:
video/mp4, video/quicktime, video/x-msvideo,
video/webm, video/x-m4v. Images are accepted too, up to 50 MB.integer
required
Exact byte size of the file: at most 524,288,000 (500 MB) for videos and 52,428,800 (50 MB)
for images.
string
Original filename, used for display.
Response
Successful requests return201 with:
id- upload identity, used to complete or abort the uploaduploadId- multipart upload identitypartSize- bytes per part (16,777,216); the last part carries the remainderparts-{ partNumber, uploadUrl }for every part, in orderexpiresIn- seconds the part URLs can be started (3600)
{
"ok": true,
"code": 201,
"message": "Multipart upload started",
"data": {
"id": "11111111-1111-4111-8111-111111111111",
"uploadId": "2~example-upload-id",
"partSize": 16777216,
"parts": [
{ "partNumber": 1, "uploadUrl": "https://storage.example.com/presigned-part-1..." },
{ "partNumber": 2, "uploadUrl": "https://storage.example.com/presigned-part-2..." }
],
"expiresIn": 3600
}
}
Error Responses
400 invalid_request-Idempotency-Keyis missing or invalid400 upload_failed- theIdempotency-Keywas already used with a different body422 invalid_payload- unsupported content type, orsizeabove the limit for its media type
