> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.twelvelabs.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.twelvelabs.io/_mcp/server.

# Remove items from an item collection

POST https://api.twelvelabs.io/v1.3/knowledge-stores/{knowledge_store_id}/item-collections/{collection_id}/items/remove
Content-Type: application/json

Removes one or more items from the specified item collection. This operation is idempotent — identifiers that do not match a member of the collection are ignored. The items themselves remain in the knowledge store.


Reference: https://docs.twelvelabs.io/api-reference/knowledge-store-items/item-collections/remove-items

## Authentication

- `x-api-key` header (required) — Your API key. You can find your API key on the API Keys page.

## Request

### Path parameters

- `knowledge_store_id` (string, required) — The unique identifier of the knowledge store.
- `collection_id` (string, required) — The unique identifier of the knowledge store item collection.

### Body (application/json)

This endpoint expects an object.

- `item_ids` (list of string, required) — The unique identifiers of the items to remove from the collection. Include up to 500 identifiers per request.

## Errors

### 400 Bad Request Error

The request has failed.

- `code` (string, optional) — A string representing the code associated with the error. See the [Error codes](/v1.3/api-reference/error-codes) page for details.
- `message` (string, optional) — A human-readable string describing the error, intended to be suitable for display in a user interface.

## Examples

**Request**

```json
{
  "item_ids": [
    "ksi_069e9870-3c4d-7abc-9012-3456789abcde"
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove"

payload = { "item_ids": ["ksi_069e9870-3c4d-7abc-9012-3456789abcde"] }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"item_ids":["ksi_069e9870-3c4d-7abc-9012-3456789abcde"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove"

	payload := strings.NewReader("{\n  \"item_ids\": [\n    \"ksi_069e9870-3c4d-7abc-9012-3456789abcde\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"item_ids\": [\n    \"ksi_069e9870-3c4d-7abc-9012-3456789abcde\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"item_ids\": [\n    \"ksi_069e9870-3c4d-7abc-9012-3456789abcde\"\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove', [
  'body' => '{
  "item_ids": [
    "ksi_069e9870-3c4d-7abc-9012-3456789abcde"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"item_ids\": [\n    \"ksi_069e9870-3c4d-7abc-9012-3456789abcde\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["item_ids": ["ksi_069e9870-3c4d-7abc-9012-3456789abcde"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/knowledge-stores/ks_069e9869-1ea3-7481-8000-dae72bf6be6e/item-collections/ksic_069e9870-3c4d-7abc-9012-3456789abcde/items/remove")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```