v3

latestOpenAPI 3.1.02026-07-3197486526.1 KB
multipartUpload

Create a multipart upload session

This method creates a multipart upload session for a local file.

Supported content: Video, audio, and images.

Upload limits:

  • Video and audio: Up to 10 GB
  • Images: Up to 32 MB

Additional requirements depend on your workflow:

  • Search: Marengo requirements
  • Video analysis: Pegasus requirements
  • Entity search: Marengo image requirements
  • Create embeddings: Marengo requirements
post/assets/multipart-uploads

Headers

x-api-keystring required

Your API key.

<Note title="Note"> You can find your API key on the <a href="https://playground.twelvelabs.io/dashboard/api-keys" target="_blank">API Keys</a> page. </Note>

Request body

filenamestring required

The original file name of the asset.

type'video' | 'audio' | 'image' required

The type of asset you want to upload.

total_sizeinteger required

The total size of the file in bytes. The platform uses this value to:

  • Calculate the optimal chunk size.
  • Determine the total number of chunks required
  • Generate the initial set of presigned URLs

Upload limits:

  • Video and audio: Up to 10 GB
  • Images: Up to 32 MB
enable_hlsboolean

When set to true, the platform generates an HLS playlist and segments for streaming. Applicable to video and audio assets only.

Default: false.

enable_thumbnailboolean

When set to true, the platform generates thumbnail images from the uploaded content.

Default: false.

user_metadataUserMetadata

Metadata that helps you categorize your assets. The object contains user-defined keys and values, where keys are strings and values are one of string, integer, float, or boolean.

Example:

"user_metadata": {
  "category": "recentlyAdded",
  "batchNumber": 5,
  "rating": 9.3,
  "needsReview": true
}
<Note title="Note"> To store other types of data, such as objects or arrays, convert your data into string values before sending it. </Note>

Response

The multipart upload session has been successfully created.

upload_idstring

The unique identifier of this upload session. Store this value, as you'll need it for the following subsequent operations:

  • Reporting completed chunks
  • Requesting additional presigned URLs
  • Retrieving the status of this upload session

This identifier remains valid for 24 hours from the time of creation.

asset_idstring

The unique identifier for the asset being created. Store this value, as you'll need it to reference the asset in other API calls. Note that this identifier is reserved immediately, but the asset becomes available for other operations only after the upload is completed successfully.

upload_headersobject
chunk_sizeinteger

The size in bytes for each chunk, except for the last chunk, which may be smaller. Use this value to divide your file into chunks of this exact size.

total_chunksinteger

The total number of chunks into which your file must be split. Calculated as: ceiling(total_size / chunk_size).

expires_atstring date-time

A string representing the date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the upload URL will expire. Upload URLs expire 24 hours from their creation. After expiration, you cannot resume the upload, and you must create a new upload session.