knowledgeStoreItems

Create a knowledge store item

Changed on

This method adds an asset to a knowledge store for processing. The operation is asynchronous. The item is created immediately with the queued status and processed in the background.

Asset size limits:

  • Video: Up to 10 GB
  • Images: Up to 32 MB
post/knowledge-stores/{knowledge_store_id}/items

Request

  • Base URL: https://api.twelvelabs.io/v1.3
  • URL: https://api.twelvelabs.io/v1.3/knowledge-stores/{knowledge_store_id}/items
  • Auth: API key in header x-api-key

Path parameters

knowledge_store_idstring required

The unique identifier of the knowledge store.

Request body

asset_type'video' | 'image'

The type of item in the knowledge store.

asset_idstring required

The unique identifier of the asset to add to the knowledge store. If you uploaded the asset before your plan moved to the new billing, enable storage accounting for it before you add it to a knowledge store. Use the Enable storage accounting for an asset method.

item_metadataobject

Custom metadata for the item, as user-defined key-value pairs. Up to 50 pairs, keys up to 128 characters, string values up to 8192 characters. Keys are strings; values can be a string, a number, a boolean, or an array of strings. A nested object, an array containing anything other than strings, and a null value are rejected. An integer must fit in 53 bits (-9007199254740991 to 9007199254740991). Send a wider integer, or an identifier that must be preserved verbatim, as a string. To change it after you create the item, use the PATCH or PUT method of the /knowledge-stores/{knowledge_store_id}/items/{item_id}/item-metadata endpoint.

metadataobject

Deprecated. Use item_metadata instead. The item stores the pairs in its item_metadata field and not in its metadata field. Send item_metadata or metadata, not both. A request that sets both returns a 400 error.

Response

The item creation request has been accepted and is processing.

_idstring

The unique identifier of the knowledge store item.

asset_type'video' | 'image' required

The type of item in the knowledge store.

asset_idstring

The unique identifier of the source asset.

status'queued' | 'pending' | 'processing' | 'ready' | 'failed'

The processing status of the item. For the meaning of each value, see the Item statuses section on The knowledge store item object page.

metadataobject

The custom metadata of the source asset. Keys are strings; each value is a string, a number, a boolean, or an array of strings. The platform updates it when the user-defined metadata of the asset changes. To change it, use the PATCH method of the /assets/{asset_id}/user-metadata endpoint. To set custom metadata for the knowledge store item only, use item_metadata.

item_metadataobject

The custom metadata of the knowledge store item. Keys are strings; each value is a string, a number, a boolean, or an array of strings. It is separate from the custom metadata of the source asset. A change to the custom metadata of the source asset does not change this field. The same key can have different values in the metadata field and in the item_metadata field. You set it when you create the item or change it with the PATCH or PUT method of the /knowledge-stores/{knowledge_store_id}/items/{item_id}/item-metadata endpoint. This field is absent when no item metadata has been set.

enriched_metadataobject

Metadata that the platform extracts from the whole item, as defined by the enrichment configuration of the knowledge store. It contains the properties that have the granularity keyword set to video for a video, or to image for an image. Properties that have the granularity keyword set to shot do not appear in this field. Keys are the property names; each value matches its property definition. A property with no value is omitted. The field is present only when the item is ready and contains at least one value.

created_atstring date-time

The date and time when the item was created, in the RFC 3339 format.

updated_atstring date-time

The date and time when the item was last updated, in the RFC 3339 format.

Changes

    • breaking

      added subschema #1 subschema #2 to the response property oneOf list for the response status

    • info

      added the non-success response with the status

    • info

      removed subschema #1 subschema #2 from the response property oneOf list for the response status

    • info

      added the non-success response with the status