---
title: Delete Collection
slug: asindataapi/collections-api/collections/delete
docTags: 
createdAt: 2024-08-01T10:34:46.728Z
---

# Delete Collection

Collections can be deleted by making an `HTTP DELETE` request to the `/collections/COLLECTION_ID` endpoint (where `COLLECTION_ID` is the `id` of the Collection you wish to delete).

:::hint{type="info"}
A Collection can only be deleted when it is not running. To check whether a Collection is currently running use the [Get Collection](https://docs.trajectdata.com/asindataapi/collections-api/collections/get) endpoint.
:::

### Example

<font color="#f5222d">`DELETE`</font>  `/collections/COLLECTION_ID`

In the example below we delete a Collections with `id=123456` :

:::CodeblockTabs
```curl
$ curl -X DELETE "https://api.asindataapi.com/collections/123456?api_key=demo"
```

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.delete('https://api.asindataapi.com/collections/123456', { params })
  .then(response => {

    console.log('Collection deleted.');

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

api_result = requests.delete('https://api.asindataapi.com/collections/123456?api_key=demo')

print ("Collection deleted.")
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.asindataapi.com/collections/123456', $queryString));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
# the following options are required if you're using an outdated OpenSSL version
# more details: https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");

$json = curl_exec($ch);
curl_close($ch);

echo "Collection deleted.", PHP_EOL;

?>
```
:::

ASIN Data API responds with a JSON object confirming that the Collection has been deleted, or detailing the error if it has not been possible to delete the Collection:

```json
{
  "request_info": {
    "success": true,
    "message": "collection deleted"
  }
}
```

***

**Next Steps**
     [Get Collections](https://docs.trajectdata.com/asindataapi/collections-api/collections/get)
     [List Collections](https://docs.trajectdata.com/asindataapi/collections-api/collections/list)
