Create a video indexing task

<Info>This method will be removed in a future version. New implementations should use [direct](/v1.3/api-reference/upload-content/direct-uploads) or [multipart](/v1.3/api-reference/upload-content/multipart-uploads) uploads followed by [separate indexing](/v1.3/api-reference/index-content/create).</Info> This method creates a video indexing task that uploads and indexes a video in a single operation. <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> Upload options: - **Local file**: Use the `video_file` parameter. - **Publicly accessible URL**: Use the `video_url` parameter. Your video files must meet requirements based 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#video-file-requirements). - If you want to both search and analyze your videos, the most restrictive requirements apply. - This method allows you to upload files up to 2 GB in size. To upload larger files, use the [Multipart Upload API](/v1.3/api-reference/upload-content/multipart-uploads) Indexes have limits on video hours and video count. For details, see the [Video hours and video count limits](/v1.3/docs/concepts/indexes#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>

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-keys" target="_blank">API Keys</a> page. </Note>

Request

Request to upload a video to an index.
index_idstringRequired
The unique identifier of the index to which the video is being uploaded.
video_filefileOptional
Specify this parameter to upload a video from your local file system.
video_urlstringOptional
Specify this parameter to upload a video from a publicly accessible URL.
enable_video_streambooleanOptionalDefaults to true
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`](/v1.3/api-reference/videos/retrieve) method of the `/indexes/{index-id}/videos/{video-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_metadatastringOptional

Metadata that helps you categorize your videos. You can specify a list of keys and values. Keys must be of type string, and values can be of the following types: string, integer, float, or boolean. Send this value as a JSON-encoded string.

Response

A video indexing task has successfully been created.
_idstringOptional
A string representing the unique identifier of your video indexing task.
video_idstringOptional
A string representing the unique identifier of the video associated with the specified video indexing task.

Errors

400
Bad Request Error