knowledgeStoreItems

List knowledge store items

Changed on

This method returns a list of items in the specified knowledge store.

Use the status, metadata, enrichment, created_at_gte, and created_at_lte parameters to choose which items to list. An item must match all of the parameters that you specify.

get/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.

Query parameters

pageinteger

A number that identifies the page to retrieve.

Default: 1.

page_limitinteger

The number of items to return on each page.

Default: 10. Max: 50.

sort_by'created_at' | 'updated_at'

The field to sort on. The following options are available:

  • created_at: Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the item was created.
  • updated_at: Sorts by the time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"), when the item was last updated.

Default: created_at.

sort_optionstring

The sorting direction. The following options are available:

  • asc
  • desc

Default: desc.

statusKnowledgeStoresKnowledgeStoreIdItemsGetParametersStatusSchemaItems[]

Filter by one or more item processing statuses. For the meaning of each value, see the Item statuses section on The knowledge store item object page.

To filter by multiple statuses, repeat the status parameter for each value:

status=queued&status=pending
metadatastring

Filter by custom metadata. Provide a JSON object that maps each key to a value or to a list of values. A list matches any of its values. An item must match all of the keys that you specify.

A key matches the custom metadata of the source asset (the metadata field of the knowledge store item) and the custom metadata of the knowledge store item (the item_metadata field). An item matches a key when the value matches in either field.

A value is a string, a number, or a boolean. The value must have the same type as the value that the item has for the key. For example, the number 2026 does not match the string "2026". If the item has a list for the key, the item matches when the list contains the value.

The object must have at least one key. A list must have at least one value. If the parameter is not a valid JSON object, or a value is not a string, a number, or a boolean, the platform returns a 422 error.

URL-encode the object:

metadata=%7B%22hashtags%22%3A%5B%22summer%22%2C%22travel%22%5D%2C%22verified%22%3Atrue%7D
enrichmentstring

Filter by enrichment values. The platform extracts these values as the enrichment configuration of the knowledge store defines (the ingestion_config.enrichment_config field).

Provide a JSON object that maps each top-level property that the enrichment configuration defines to a value or to a list of values. Each value follows the rules for the metadata parameter. If you specify a key that the enrichment configuration does not define, the platform returns a 422 error.

The granularity keyword of a property sets how often the platform extracts its value. The keyword also sets which items the key matches:

  • video: One value for each video. The key matches video items only.
  • image: One value for each image. The key matches image items only.
  • shot: One value for each shot of a video. A shot is a continuous part of a video between two scene changes. The key matches video items only. If you specify more than one shot key, one shot must have all of the values.

An item must match all of the keys that you specify. An object with a video key and an image key matches no items, because an item is a video or an image.

URL-encode the object:

enrichment=%7B%22detected_topic%22%3A%22cooking%22%7D
created_at_gtestring date-time

Return only items created at or after this time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ").

The creation time is the time when you create the item with the POST method of the /knowledge-stores/{knowledge_store_id}/items endpoint. It is not the time when the item reaches the ready status. To list only items that are ready, also set the status parameter to ready.

created_at_ltestring date-time

Return only items created at or before this time, in the RFC 3339 format ("YYYY-MM-DDTHH:mm:ssZ"). When you use both created_at_gte and created_at_lte, the created_at_gte time must be equal to or earlier than the created_at_lte time. Otherwise, the platform returns a 422 error.

The creation time is the time when you create the item with the POST method of the /knowledge-stores/{knowledge_store_id}/items endpoint. It is not the time when the item reaches the ready status.

Response

The knowledge store items have been successfully retrieved.

Changes

    • info

      added the new optional query request parameter created_at_gte

    • info

      added the new optional query request parameter created_at_lte

    • info

      added the new optional query request parameter enrichment

    • info

      added the new optional query request parameter metadata

    • info

      added the non-success response with the status

    • breaking

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

    • info

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