---
title: Delete Request
slug: bigboxapi/collections-api/requests/delete
docTags: 
createdAt: 2024-07-22T08:01:06.003Z
---

# Delete Request

Requests can be deleted by making an  `HTTP DELETE` request to the  `/collections/COLLECTION_ID/REQUEST_ID` endpoint (where  `REQUEST_ID` is the  `id` of the Request to delete and  `COLLECTION_ID` is the  `id` of the Collection the Request belongs to).

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

:::hint{type="info"}
**Deleting Multiple Requests**
You should make calls to the Delete Request endpoint sequentially, rather than in parallel, as it is designed to remove Requests one by one. If you make too many concurrent calls you will receive an  `HTTP 429`  error. For mass-delete operations consider deleting and re-creating the Collection as this is typically quicker.

Alternatively if your use-case requires mass deletion of Requests you may make an  `HTTP DELETE`  request to the  `/collections/COLLECTION_ID/requests`  endpoint with the  `Content-Type`  HTTP header set to  `application/json`  and the body of the request being an array of Request ID strings. The platform will then delete each of the IDs specified.
:::

***

### Example

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

In the example below we delete a Request with  `id=ABCDEFGHIJKLMNOP` from Collection with  `id=123456` :

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

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

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

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

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

:::CodeblockTabs
✅ Success JSON

```text
{
  "request_info": {
    "success": true,
    "message": "Request deleted"
  }
}
```

❌ No Request

```text
{
  "request_info": {
    "success": false,
    "message": "No Request with ID 'ABCDEFGHIJKLMNOP' was found in this Collection, please check the ID and try again"
  }
}
```

❌ No Collection

```text
{
  "request_info": {
    "success": false,
    "message": "Collection with ID '123456' was not found"
  }
}
```
:::

***

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