> This page is for version v1.3 (default).
> For other versions, use one of these documentation indexes:
> - v1.3 (default): https://docs.twelvelabs.io/v1.3/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.

## See the result for each item you add to or remove from an item collection

You can now see the result for each item you add to or remove from an item collection. The response lists, for each identifier of an item in the request, whether the platform added, removed, or skipped the item. For a skipped item, it also gives the reason.

Removing items returns this response with a `200` status. Before, removing items returned a `204` status with no response body.

When you add items, every identifier must reference an existing item in the knowledge store. If one does not, the platform returns a `404` error and adds none of the items.

To use this feature, upgrade to the latest version of the Python or Node.js SDK:

**`Python SDK`**

```sh Python SDK
pip install --upgrade twelvelabs
```

**`Node.js SDK`**

```sh Node.js SDK
npm install twelvelabs-js@latest
```

### SDK type changes

In the Python and Node.js SDKs, the methods that add items to an item collection return a `KnowledgeStoreItemCollectionMembershipResponse` object. This type extends `KnowledgeStoreItemCollection` with the `results` array, so existing code keeps working. The methods that remove items returned no value before. They now return the same object.

For details, see the [Add items to an item collection](/v1.3/api-reference/knowledge-store-items/item-collections/add-items) and [Remove items from an item collection](/v1.3/api-reference/knowledge-store-items/item-collections/remove-items) pages in the API Reference section, or the SDK reference for [Python](/v1.3/sdk-reference/python/knowledge-store-items#add-items-to-an-item-collection) and [Node.js](/v1.3/sdk-reference/node-js/knowledge-store-items#add-items-to-an-item-collection).

## Sort knowledge store items by supported metadata keys

When you list the items in a knowledge store, you can sort by these custom metadata keys: `view_count`, `like_count`, `comment_count`, `share_count`, `video.view_count`, `video.like_count`, `video.comment_count`, and `video.share_count`. Use the `sort_by` parameter with the `metadata.<key>` value. The platform sorts by numeric value. If the value is not a number, the platform treats the item as having no value for the key. For any other metadata key, the platform returns a `422` error with the `parameter_invalid` code. Sorting by `created_at` and `updated_at` does not change.

For details, see the [List knowledge store items](/v1.3/api-reference/knowledge-store-items/list) page in the API Reference section.

## Video duration limits for knowledge store items

The platform now rejects a video that is shorter than 1.1 seconds or longer than 24 hours when you add the video to a knowledge store. The request returns a `422` error with the `parameter_invalid` code.

For details, see the [Create a knowledge store item](/v1.3/api-reference/knowledge-store-items/create) page in the API Reference section.