knowledgeStores

Search a knowledge store

Changed on

This method searches a knowledge store using natural language and returns matching video clips and images ranked by relevance.

Use the query.text field to specify your natural-language query. Use the filter parameter to choose which items to search. Use the search_options parameter to choose how the platform matches videos.

By default, each result is an individual match: a video clip or an image. Set the group_by parameter to item to group clips under their parent item.

<Note title="Note"> This endpoint is rate-limited. For details, see the [Rate limits](/v1.3/docs/get-started/rate-limits) page. </Note>
post/knowledge-stores/{knowledge_store_id}/search

Request

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

Path parameters

knowledge_store_idstring required

The unique identifier of the knowledge store.

Request body

group_by'none' | 'item'

Controls how the platform groups matches in the response.

  • none: Returns individual matches ordered by relevance.
  • item: Groups matches under their parent item.

Default: none.

page_sizeinteger

The maximum number of results per page. A result is one entry in the data array. With the group_by parameter set to its default of none, each result is an individual match: a video clip or an image. When set to item, each result is one item: a video with all its matching clips, or an image.

Default: 10. Max: 50.

page_tokenstring

Pagination token used to retrieve the next page of results. Omit it on the first request. To fetch the next page, set it to the next_page_token field returned in the previous response and send the request again.

If a token is malformed or unrecognized, the platform returns a 400 error. If a token has expired, the platform returns a 410 error (make a new search request to obtain a fresh page token).

include_metadataboolean

Set to true to include metadata in each result. Each result includes a metadata object with these fields:

  • system: System-generated metadata, such as duration and resolution.
  • user: The custom metadata of the source asset.
  • item: The custom metadata of the knowledge store item.

Response

The search completed successfully.

next_page_tokenstring

The unique identifier of the next page.

Changes

    • info

      added the new optional request property /

    • info

      added the new optional request property //

    • info

      added the new optional request property ///

    • info

      added the new optional request property ///