Manage indexes
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.
Methods
Create an index
Description: This method creates a new index based on the provided parameters.
Function signature and example:
Parameters
The TwelvelabsApi.IndexesCreateRequest interface has the following properties:
Note
You cannot change the model configuration after creating the index.
Return value
Returns an HttpResponsePromise that resolves to a TwelvelabsApi.IndexesCreateResponse instance containing a field named id representing the unique identifier of the newly created index.
API Reference
Related guide
Retrieve an index
Description: This method retrieves details of a specific index.
Function signature and example:
Parameters
Return value
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:
API Reference
List indexes
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:
Parameters
The IndexesListRequest interface defines the parameters for listing indexes:
Return value
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:
API Reference
Update an index
Description: This method updates the name of an existing index.
Function signature and example:
Parameters
The TwelvelabsApi.IndexesUpdateRequest interface contains the following properties:
Return value
Returns an HttpResponsePromise that resolves to void. This method doesn’t return any data upon successful completion.
API Reference
Delete an index
Description: This method deletes an existing index.
Function signature and example:
Parameters
Return value
Returns an HttpResponsePromise that resolves to void. This method doesn’t return any data upon successful completion.
API Reference
Error codes
This section lists the most common error messages you may encounter while managing indexes.
index_option_cannot_be_changed- Index option cannot be changed. Please remove index_options parameter and try again. If you want to change index option, please create new index.
index_engine_cannot_be_changed- Index engine cannot be changed. Please remove engine_id parameter and try again. If you want to change engine, please create new index.
index_name_already_exists- Index name
{index_name}already exists. Please use another unique name and try again.
- Index name