Create a multipart upload session

This method creates a multipart upload session. **Supported content**: Video and audio **File size**: 4GB maximum. **Additional requirements** depend on your workflow: - **Search**: [Marengo requirements](/v1.3/docs/concepts/models/marengo#video-file-requirements) - **Video analysis**: [Pegasus requirements](/v1.3/docs/concepts/models/pegasus#input-requirements) - **Create embeddings**: [Marengo requirements](/v1.3/docs/concepts/models/marengo#input-requirements)

Authentication

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

Request

This endpoint expects an object.
filenamestringRequired1-255 characters
Original filename of the asset
typeenumRequired
Type of asset being uploaded
Allowed values:
total_sizeintegerRequired1-4294967296
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

Response

The multipart upload session has been successfully created.
upload_idstring or null
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 or null
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_urlslist of objects or null
The initial set of presigned URLs for uploading chunks. Each URL corresponds to a specific chunk. <Note title="Notes> - URLs expire after 1 hour. - Depending on the size of the file, this initial set may not include URLs for all chunks. You can request more using the [`POST`](/v1.3/api-reference/multipart-uploads/get-additional-presigned-urls) method of the `/assets/multipart-uploads/{upload_id}/presigned-urls` endpoint. </Note>
upload_headersmap from strings to strings or null
chunk_sizeinteger or null
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 or null

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

expires_atstring or nullformat: "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.

Errors