Direct Thumbnail Upload

Upload a thumbnail directly to Gumlet using the official SDKs, CLI, or REST API. The file upload helper requests an authenticated upload URL and uploads the image in a single call.

Using SDKs or CLI

Use uploadThumbnailFile in Node.js, upload_thumbnail_file in Python, UploadThumbnailFile in Go, or gumlet video asset thumbnail-upload in the CLI. Replace <asset_id> with the video asset ID and pass your thumbnail file. You do not need to request an upload URL or make a separate PUT request.

import { createReadStream } from 'node:fs';
import Gumlet from '@gumlet/nodejs-sdk';

const client = new Gumlet({
  apiKey: process.env['API_KEY'],
});

await client.videoAssets.uploadThumbnailFile(
  '<asset_id>',
  createReadStream('thumbnail.jpg'),
);

console.log('Thumbnail upload complete');
import os

from gumlet import Gumlet

client = Gumlet(
    api_key=os.environ.get("API_KEY"),
)

with open("thumbnail.jpg", "rb") as image_file:
    client.video_assets.upload_thumbnail_file(
        asset_id="<asset_id>",
        file=image_file,
    )

print("Thumbnail upload complete")
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("thumbnail.jpg")
	if err != nil {
		panic(err)
	}
	defer file.Close()

	_, err = client.VideoAssets.UploadThumbnailFile(
		context.Background(),
		"<asset_id>",
		file,
	)
	if err != nil {
		panic(err)
	}

	fmt.Println("Thumbnail upload complete")
}
# Upload a local image as the custom thumbnail
gumlet video asset thumbnail-upload \
  --asset-id <asset_id> \
  --file ./thumbnail.jpg

# Or select a frame from the video as the thumbnail
gumlet video asset thumbnail-select \
  --asset-id <asset_id> \
  --frame-at-second 2.5

The method completes after the thumbnail file has been uploaded successfully.

Using REST API (Thumbnail Upload)

If you are not using an SDK, request an upload URL and upload the thumbnail in two steps.

1. Create a thumbnail upload URL

Get the upload_url from the Update thumbnail via upload API. Replace <asset_id> with the video asset ID.

curl --request POST \
     --url 'https://api.gumlet.com/v1/video/assets/<asset_id>/thumbnail' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --header 'accept: application/json'

2. Upload a thumbnail file

Make a PUT request to the returned upload_url with the image file in the body.

curl --request PUT '<upload_url>' \
     --header 'Content-Type: image/jpeg' \
     --data-binary '@thumbnail.jpg'

On successful upload, you will get a 200 OK response.