Direct Upload
Upload files directly to Gumlet.
Using Dashboard
Upload your videos directly from the dashboard using this guide
Using SDKs or CLI (Recommended)
The official SDKs and CLI create an upload asset, get its authenticated upload URL, and upload your file in a single call. You do not need to request or send the file to the upload URL yourself.
- Node.js / TypeScript SDK —
npm install @gumlet/nodejs-sdk - Python SDK —
pip install gumlet - Go SDK —
go get github.com/gumlet/golang-sdk - Gumlet CLI —
npm install -g @gumlet/cli
Use uploadFile in Node.js, upload_file in Python, UploadFile in Go, or gumlet video asset upload in the CLI. Pass your local file and Asset Parameters, such as workspace_id and format:
import { createReadStream } from 'node:fs';
import Gumlet from '@gumlet/nodejs-sdk';
const client = new Gumlet({
apiKey: process.env['API_KEY'],
});
const videoAsset = await client.videoAssets.uploadFile(createReadStream('video.mp4'), {
workspace_id: '<your workspace id>',
format: 'ABR',
});
console.log(videoAsset.asset_id);
import os
from gumlet import Gumlet
client = Gumlet(
api_key=os.environ.get("API_KEY"),
)
with open("video.mp4", "rb") as video_file:
video_asset = client.video_assets.upload_file(
file=video_file,
workspace_id="<your workspace id>",
format="ABR",
)
print(video_asset.asset_id)
package main
import (
"context"
"fmt"
"os"
sdk "github.com/gumlet/golang-sdk"
"github.com/gumlet/golang-sdk/option"
)
func main() {
client := sdk.NewClient(
option.WithAPIKey(os.Getenv("API_KEY")),
)
file, err := os.Open("video.mp4")
if err != nil {
panic(err)
}
defer file.Close()
videoAsset, err := client.VideoAssets.UploadFile(
context.Background(),
file,
sdk.VideoAssetUploadFileParams{
WorkspaceID: sdk.F("<your workspace id>"),
Format: sdk.F(sdk.VideoAssetUploadFileParamsFormatAbr),
},
)
if err != nil {
panic(err)
}
fmt.Println(videoAsset.AssetID)
}
gumlet video asset upload \
--workspace-id <your workspace id> \
--file ./video.mp4 \
--format ABR
The method returns the created asset details, including asset_id, after the file upload succeeds. Video processing happens asynchronously; use the returned asset ID to check its status. See Video Asset Status for what each status means.
These helpers read the file into memory before uploading it. Use multipart upload for input files larger than 1 GB. Multipart upload is required for files larger than 5 GB; they cannot be uploaded with a single direct upload request.
Using REST APIs (Direct Upload)
If you are not using an SDK, create an upload asset and upload the file to the returned URL in two steps.
1. Create an authenticated Gumlet URL
Create a new Direct Upload Asset with Asset Parameters per your requirements. The Gumlet API returns an authenticated upload_url and an asset_id so you can check the status later via the API or in the Gumlet Dashboard.
curl -L -X POST 'https://api.gumlet.com/v1/video/assets/upload' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"workspace_id": "<your workspace id>",
"format": "ABR"
}'
2. Use the URL to upload a file
Once you have the upload_url from the previous step, make a PUT request that includes the file in the body. Skip this step if you used an SDK's file upload helper above.
curl -v -X PUT -T video.mp4 '<upload_url>'
On successful upload, the new asset will be available in the Gumlet Dashboard.
3. Access uploaded video
Access your uploaded video using the Video Asset Status API. You will receive the original_download_url parameter.
const videoAsset = await client.videoAssets.retrieveDetails('<asset_id>');
console.log(videoAsset);
video_asset = client.video_assets.retrieve_details(
asset_id="<asset_id>",
)
print(video_asset)
gumlet video asset get --asset-id <asset_id> -o table
curl -L -X GET 'https://api.gumlet.com/v1/video/assets/<asset_id>' \
-H 'Authorization: Bearer <YOUR_API_KEY>'
By default, Gumlet will keep your original videos in its storage. If you don't want your original video stored on Gumlet storage, you can add the keep_original parameter with value false in the Create Asset API and Gumlet will delete your original video after processing.
Using REST APIs (Multipart Upload)
Use multipart upload for input files larger than 1 GB. It is the only way to upload files larger than 5 GB.
Create the asset first, split the video into parts of at least 5MB (unless the video is smaller than 5MB), upload each part to a pre-signed URL, then complete the upload.
1. Create asset for upload
Create a new Upload Asset with Asset Parameters per your requirements.
const videoAsset = await client.videoAssets.upload({
workspace_id: '<your workspace id>',
format: 'ABR',
});
const assetId = videoAsset.asset_id;
video_asset = client.video_assets.upload(
workspace_id="<your workspace id>",
format="ABR",
)
asset_id = video_asset.asset_id
curl -L -X POST 'https://api.gumlet.com/v1/video/assets/upload' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"workspace_id": "<your workspace id>",
"format": "ABR"
}'
2. Create parts of the original video
Create multiple parts of your video. Make sure each part is at least 5MB (unless the video is less than 5MB itself, then it will be only 1 part).
3. Sign part and upload
Get a pre-signed upload URL for each part using the sign part API call. Use asset_id received from the create upload asset call.
import { readFile } from 'node:fs/promises';
const partNumber = '1';
const signed = await client.multipartUpload.retrievePartURL(partNumber, {
asset_id: assetId,
});
const partData = await readFile('part-1.bin');
const uploadResponse = await fetch(signed.part_upload_url, {
method: 'PUT',
body: partData,
});
if (!uploadResponse.ok) {
throw new Error(`Part upload failed: ${uploadResponse.status}`);
}
const etag = uploadResponse.headers.get('etag');
// Store PartNumber + ETag for every part
import requests
part_number = "1"
signed = client.multipart_upload.retrieve_part_url(
asset_id=asset_id,
part_number=part_number,
)
with open("part-1.bin", "rb") as part_file:
upload_response = requests.put(signed.part_upload_url, data=part_file)
upload_response.raise_for_status()
etag = upload_response.headers["ETag"]
# Store PartNumber + ETag for every part
curl -L -X GET 'https://api.gumlet.com/v1/video/assets/{asset_id}/multipartupload/{part_number}/sign' \
-H 'Authorization: Bearer <YOUR_API_KEY>'
Upload the part using the part_upload_url:
curl -v -X PUT -T part_binary_data '<part_upload_url>'
Store the ETag value of the response header for each part.
4. Complete multipart upload
Once you upload all the parts using their part_upload_url, complete the multipart upload using this API call. Send an array of PartNumber and ETag values received while uploading each part.
await client.multipartUpload.complete(assetId, {
parts: [
{ PartNumber: 1, ETag: '1ae165be27bf32b6430c150620ee9b8f' },
{ PartNumber: 2, ETag: '52e124ba4c6f32b31dac23e6033e9c4d' },
],
});
client.multipart_upload.complete(
asset_id=asset_id,
parts=[
{"part_number": 1, "e_tag": "1ae165be27bf32b6430c150620ee9b8f"},
{"part_number": 2, "e_tag": "52e124ba4c6f32b31dac23e6033e9c4d"},
],
)
curl -L -X POST 'https://api.gumlet.com/v1/video/assets/{asset_id}/multipartupload/complete' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"parts": [
{"PartNumber": 1, "ETag": "1ae165be27bf32b6430c150620ee9b8f"},
{"PartNumber": 2, "ETag": "52e124ba4c6f32b31dac23e6033e9c4d"}
]
}'
Using REST API (Subtitle Upload)
1. Upload .srt file
First create signed subtitle upload URLs with the Upload Subtitle API. Then PUT each .srt / .vtt file to the returned URL. Finally call the complete API so Gumlet attaches the subtitles to the asset.
import { readFile } from 'node:fs/promises';
const subtitleUpload = await client.subtitleUpload.upload(assetId, {
language_codes: ['en'],
});
const signedUrl = subtitleUpload.signed_urls?.[0]?.upload_url;
const subtitleFile = await readFile('subtitles.en.srt');
const putResponse = await fetch(signedUrl, {
method: 'PUT',
body: subtitleFile,
});
if (!putResponse.ok) {
throw new Error(`Subtitle upload failed: ${putResponse.status}`);
}
await client.subtitleUpload.complete(assetId, {
upload_responses: [{ language_code: 'en', uploaded: true }],
});
import requests
subtitle_upload = client.subtitle_upload.upload(
asset_id=asset_id,
language_codes=["en"],
)
upload_url = subtitle_upload.signed_urls[0].upload_url
with open("subtitles.en.srt", "rb") as subtitle_file:
put_response = requests.put(upload_url, data=subtitle_file)
put_response.raise_for_status()
client.subtitle_upload.complete(
asset_id=asset_id,
upload_responses=[{"language_code": "en", "uploaded": True}],
)
# 1. Request signed upload URLs
curl -L -X POST 'https://api.gumlet.com/v1/video/assets/<asset_id>/subtitle/upload' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"language_codes": ["en"]
}'
# 2. Upload the subtitle file
curl --location --request PUT '<upload_url>' \
--data-binary '@subtitles.en.srt'
# 3. Complete subtitle upload
curl -L -X POST 'https://api.gumlet.com/v1/video/assets/<asset_id>/subtitle/upload/event' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"upload_responses": [
{"language_code": "en", "uploaded": true}
]
}'
On success, you will get a 200 OK status.

