Create a video indexing task
This method creates a video indexing task that uploads and indexes a video in a single operation.
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.
Upload options:
- Local file: Use the
video_fileparameter. - Publicly accessible URL: Use the
video_urlparameter.
Your videos must meet 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.
- This method allows you to upload files up to 2 GB in size. To upload larger files, use the Multipart Upload API
Indexes have limits on video hours and video count. For details, see the Video hours and video count limits section.
This endpoint is rate-limited. For details, see the Rate limits page.
Authentication
Your API key.
You can find your API key on the API Keys page.
Request
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}/videos/{video-id} endpoint. You can then use this URL to access the stream over the HLS protocol.
Metadata that helps you categorize your videos. You can specify a list of keys and values. Keys are strings, and values can be 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. Send this value as a JSON-encoded string.
Response headers
A comma-separated, alphabetically sorted list of the rate limits the request was measured against. Only the limits that applied to the request appear.
Each entry is a label. Replace <label> with an entry to read the values for that limit: X-Ratelimit-<label>-Limit, X-Ratelimit-<label>-Remaining, and X-Ratelimit-<label>-Reset. This list keeps the mixed-case spelling of each label, such as InputToken-Video. The platform sends the headers as X-Ratelimit-Inputtoken-Video-Limit. HTTP header names are case-insensitive, so the two spellings match.
Some accounts receive the legacy X-Ratelimit-Limit, X-Ratelimit-Remaining, X-Ratelimit-Used, and X-Ratelimit-Reset headers instead of this family. A response does not include both families. The /embed-v2, /embed-v2/tasks, and /knowledge-stores/{knowledge_store_id}/search endpoints send only this family. For details, see Legacy headers.
The maximum number of requests you can make per rate limit window for this endpoint. For details, see the Rate limits page.
The maximum duration of video and audio, in seconds, that you can process per rate limit window for this endpoint. For details, see the Rate limits page.
The maximum number of requests you can make per rate limit window for this endpoint. Some accounts receive this legacy header instead of the X-Ratelimit-Dimensions family. For details, see Legacy headers.
The number of requests remaining in the current rate limit window for the specific endpoint. Some accounts receive this legacy header instead of the X-Ratelimit-Dimensions family. For details, see Legacy headers.
The number of requests you have made in the current rate limit window for the specific endpoint. Some accounts receive this legacy header instead of the X-Ratelimit-Dimensions family. For details, see Legacy headers.
The time at which the current rate limit window resets, expressed in UTC epoch seconds. Some accounts receive this legacy header instead of the X-Ratelimit-Dimensions family. For details, see Legacy headers.