An index is a basic unit for organizing and storing video data consisting of video embeddings and metadata. Indexes facilitate information retrieval and processing. The IndexesWrapper class provides methods to manage your indexes.
Description: This method creates a new index based on the provided parameters.
Function signature and example:
The TwelvelabsApi.IndexesCreateRequest interface has the following properties:
You cannot change the model configuration after creating the index.
Returns an HttpResponsePromise that resolves to a TwelvelabsApi.IndexesCreateResponse instance containing a field named id representing the unique identifier of the newly created index.
Description: This method retrieves details of a specific index.
Function signature and example:
Returns an HttpResponsePromise that resolves to a TwelvelabsApi.IndexSchema object representing the retrieved index.
The TwelvelabsApi.IndexSchema interface contains the following properties:
The TwelvelabsApi.IndexModelsItem interface contains the following properties:
Description: This method retrieves a paginated list of indexes based on the provided parameters. By default, the platform returns your indexes sorted by creation date, with the newest at the top of the list.
Function signature and example:
The IndexesListRequest interface defines the parameters for listing indexes:
Returns a Promise that resolves to a core.Page<TwelvelabsApi.IndexSchema> instance, representing the indexes that match the specified criteria. See the Retrieve an index section above for complete property details.
The Page class contains the following properties and methods:
Description: This method updates the name of an existing index.
Function signature and example:
The TwelvelabsApi.IndexesUpdateRequest interface contains the following properties:
Returns an HttpResponsePromise that resolves to void. This method doesn’t return any data upon successful completion.
Description: This method deletes an existing index.
Function signature and example:
Returns an HttpResponsePromise that resolves to void. This method doesn’t return any data upon successful completion.
This section lists the most common error messages you may encounter while managing indexes.
index_option_cannot_be_changed
index_engine_cannot_be_changed
index_name_already_exists
{index_name} already exists. Please use another unique name and try again.For a list of general errors that apply to all endpoints, see the Error codes page.