---
title: Stop All Collections
slug: backyardapi/collections-api/collections/stop-all
docTags: 
createdAt: 2024-07-23T14:57:52.062Z
---

# Stop All Collections

Stop all Collections on your account that are currently in the  `queued`  or  `running`  state by making an `HTTP GET` request to the `/collections/stopall` endpoint. The Collections will be set back to the  `idle`  state.

For Collections that are currently  `queued`  you will be refunded for the credits allocated for that Collection run. If the Collection has already started running (i.e. it is in the state  `running` ) then a credit refund will not be issued, but the Collection will still be stopped.

***

### Example

<font color="#52c41a">`GET`</font>  `/collections/stopall`

:::CodeblockTabs
HTTP

```HTTP
https://api.backyardapi.com/collections/stopall?api_key=demo
```

```curl
$ curl "https://api.backyardapi.com/collections/stopall?api_key=demo"
```

```nodejs
const axios = require('axios');
const params = {
  api_key: 'demo'
}

axios.get('https://api.backyardapi.com/collections/stopall', { params })
  .then(response => {
    const apiResponse = response.data;

    console.log('Collections stopped.');

  }).catch(error => {
    console.log(error);
  });
```

```python
import requests

params = {
  'api_key': 'demo'
}

api_result = requests.get('https://api.backyardapi.com/collections/stopall', params)

api_response = api_result.json()

print "Collections stopped."
```

```php
<?php
      
$queryString = http_build_query([
  'api_key' => 'demo',
]);

$ch = curl_init(sprintf('%s?%s', 'https://api.backyardapi.com/collections/stopall', $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);

$json = curl_exec($ch);
curl_close($ch);

$api_result = json_decode($json, true);

print_r($api_result);

echo "Collections stopped.", PHP_EOL;

?>
```
:::

Backyard API responds with a JSON object confirming that the Collections have been stopped.

```json
{
  "request_info": {
    "success": true,
    "message": "23 Collections stopped"
  },
  "collections_stopped": 23,
  "collections_failed_to_stop": 0
}
```

***

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