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

# Remove assets from an entity

DELETE https://api.twelvelabs.io/v1.3/entity-collections/{entity_collection_id}/entities/{entity_id}/assets
Content-Type: application/json

This method removes from the specified entity. Assets are used to identify the entity in media content, and removing assets may impact the accuracy of entity recognition in searches if too few assets remain.

When assets are removed, the entity may temporarily enter a "processing" state while the system updates the necessary data. Once processing is complete, the entity status will return to "ready."

* This operation only removes the association between the entity and the specified assets; it does not delete the assets themselves.
* An entity must always have at least one asset associated with it. You can't remove the last asset from an entity.

Reference: https://docs.twelvelabs.io/api-reference/entities/entity-collections/entities/remove-assets

## Authentication

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

## Request

### Path parameters

- `entity_collection_id` (string, required) — The unique identifier of the entity collection that contains the entity from which assets will be removed.
- `entity_id` (string, required) — The unique identifier of the entity within the specified entity collection from which the assets will be removed.

### Body (application/json)

This endpoint expects an object.

- `asset_ids` (list of string, required) — An array of asset IDs to remove from the entity.

## Response

### 200

The assets have been successfully removed from the entity.

- `_id` (string, optional) — The unique identifier of the entity.
- `entity_collection_id` (string, optional) — The unique identifier of the entity collection this entity belongs to.
- `name` (string, optional) — The name of the entity.
- `description` (string, optional) — A description of the entity.
- `metadata` (EntityMetadata, optional) — Custom metadata for the entity.
- `asset_ids` (list of string, optional) — An array of asset IDs associated with the entity.
- `status` (enum, optional) — The current status of the entity creation process. **Values**: - `processing`: The entity is being processed and is not yet ready for use in searches. - `ready`: The entity is fully processed and can be used in search queries.
  - Allowed values: `processing`, `ready`
- `created_at` (string, optional) — The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the entity was created.
- `updated_at` (string, optional) — The date and time, in RFC 3339 format (“YYYY-MM-DDTHH:mm:ssZ”), when the entity was last updated.

## 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.

## Types

### EntityMetadata

Custom metadata for the entity.

## Examples

**Request**

```json
{
  "asset_ids": [
    "6298d673f1090f1100476d4e",
    "6298d673f1090f1100476d4f"
  ]
}
```

**Response**

```json
{
  "_id": "6298d673f1090f1100476d4c",
  "entity_collection_id": "7309e784f2191g2211587e5d",
  "name": "John Doe",
  "description": "Famous soccer player",
  "metadata": {
    "sport": "soccer",
    "team": "Team A",
    "role": "forward"
  },
  "asset_ids": [
    "6298d673f1090f1100476d4c",
    "6298d673f1090f1100476d4d"
  ],
  "status": "ready",
  "created_at": "2022-06-02T10:30:00Z",
  "updated_at": "2022-06-02T10:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.twelvelabs.io/v1.3/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets"

payload = { "asset_ids": ["6298d673f1090f1100476d4e", "6298d673f1090f1100476d4f"] }
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.twelvelabs.io/v1.3/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets';
const options = {
  method: 'DELETE',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"asset_ids":["6298d673f1090f1100476d4e","6298d673f1090f1100476d4f"]}'
};

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/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets"

	payload := strings.NewReader("{\n  \"asset_ids\": [\n    \"6298d673f1090f1100476d4e\",\n    \"6298d673f1090f1100476d4f\"\n  ]\n}")

	req, _ := http.NewRequest("DELETE", 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/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets")

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

request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"asset_ids\": [\n    \"6298d673f1090f1100476d4e\",\n    \"6298d673f1090f1100476d4f\"\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.delete("https://api.twelvelabs.io/v1.3/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"asset_ids\": [\n    \"6298d673f1090f1100476d4e\",\n    \"6298d673f1090f1100476d4f\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.twelvelabs.io/v1.3/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets', [
  'body' => '{
  "asset_ids": [
    "6298d673f1090f1100476d4e",
    "6298d673f1090f1100476d4f"
  ]
}',
  '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/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets");
var request = new RestRequest(Method.DELETE);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"asset_ids\": [\n    \"6298d673f1090f1100476d4e\",\n    \"6298d673f1090f1100476d4f\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["asset_ids": ["6298d673f1090f1100476d4e", "6298d673f1090f1100476d4f"]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.twelvelabs.io/v1.3/entity-collections/6298d673f1090f1100476d4c/entities/6298d673f1090f1100476d4c/assets")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
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()
```