v3

latestOpenAPI 3.1.02026-07-3197486526.1 KB
indexes > indexedAssets

Create an indexed asset

This method indexes an uploaded asset to make it searchable and analyzable. Indexing processes your content and extracts information that enables the platform to search and analyze your videos.

This operation is asynchronous. The platform returns an indexed asset ID immediately and processes your content in the background. Monitor the indexing status to know when your content is ready to use.

Your asset must meet the requirements based on your workflow:

  • Search: Marengo requirements
  • Video analysis: Pegasus requirements.

If you want to both search and analyze your videos, the most restrictive requirements apply.

Indexes have limits on video hours and video count. For details, see the Video hours and video count limits section.

<Note title="Note"> This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page. </Note>
post/indexes/{index-id}/indexed-assets

Path parameters

index-idstring required

The unique identifier of the index to which the asset will be indexed.

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

asset_idstring required

The unique identifier of the asset to index. The asset status must be ready. Use the Retrieve an asset method to check the status.

enable_video_streamboolean

This parameter indicates if the platform stores the video for streaming. When set to true, the platform stores the video, and you can retrieve its URL by calling the GET method of the /indexes/{index-id}/indexed-assets/{indexed-asset-id} endpoint. You can then use this URL to access the stream over the <a href="https://en.wikipedia.org/wiki/HTTP_Live_Streaming" target="_blank">HLS</a> protocol.

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 indexing request has been accepted and is processing.

_idstring

The unique identifier of the indexed asset. Use it to monitor the indexing progress.

asset_idstring

The unique identifier of the associated asset.