indexes > indexedAssets

Create an indexed asset

Changed on

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.

<Note title="Adding videos to existing indexes"> You can no longer add videos to an index that has only Pegasus 1.2 enabled. When you add videos to an index that has both Marengo and Pegasus 1.2 enabled, the platform indexes them with Marengo only. </Note>

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

Request

  • Base URL: https://api.twelvelabs.io/v1.3
  • URL: https://api.twelvelabs.io/v1.3/indexes/{index-id}/indexed-assets
  • Auth: API key in header x-api-key

Path parameters

index-idstring required

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

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. If you uploaded the asset before your plan moved to the new billing, enable storage accounting for it before you index it in an index for which Marengo is enabled. Use the Enable storage accounting for an asset method.

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. Each value is a string, a number, a boolean, or an array of strings. Send an integer wider than 53 bits (-9007199254740991 to 9007199254740991), and any identifier you want preserved verbatim, as a string.

Example:

"user_metadata": {
  "category": "recentlyAdded",
  "batchNumber": 5,
  "rating": 9.3,
  "needsReview": true,
  "hashtags": ["summer", "vlog"]
}

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.

Changes