---
title: Clear Requests
slug: countdownapi/collections-api/requests/clear
docTags: 
createdAt: 2024-07-29T12:49:20.014Z
---

# Clear Requests

All of the Requests in a collection can be cleared by making an  `HTTP DELETE` request to the  `/collections/COLLECTION_ID/clear` endpoint (where  `COLLECTION_ID` is the  `id` of the Collection).

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

***

### Example

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

In the example below we clear a Collection with  `id=123456` :

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

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

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

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.countdownapi.com/collections/123456/clear', $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 "Request deleted.", PHP_EOL;

?>
```
:::

Countdown API responds with a JSON object confirming that the collection has been cleared:

```json
{
  "request_info": {
    "success": true,
    "message": "Collection requests cleared"
  }
}
```

***

**Next Steps**
     [Update Request](https://docs.trajectdata.com/countdownapi/collections-api/requests/update)
     [List Request](https://docs.trajectdata.com/countdownapi/collections-api/requests/list)
