> For the complete documentation index, see [llms.txt](https://docs.plumvoice.com/insight/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plumvoice.com/insight/api/cancelling-all-pending-outbound-calls.md).

# Cancelling All Pending Outbound Calls

## Cancel All Pending Outbound Calls

<mark style="color:red;">`DELETE`</mark> `https://insight.plumvoice.com/api/surveys/{survey_id}/{instance_id}/cancel`

Cancel all pending outbound calls in the call queue.

#### Path Parameters

| Name         | Type   | Description                         |
| ------------ | ------ | ----------------------------------- |
| survey\_id   | string | Plum Insight survey ID number       |
| instance\_id | string | Plum Insight survey instance number |

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| content-type | string | application/x-www-form-urlencoded |

{% tabs %}
{% tab title="202 No body returned" %}

```
```

{% endtab %}

{% tab title="404 Example: Invalid deployment" %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{'success':false,'error':'The specified deployment was not found for this survey.'}
```

{% endtab %}

{% tab title="XML" %}

```markup
<result>
  <success>false</success>
  <error>The specified deployment was not found for this survey.</error>.
</result>
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

### **Possible Response Codes**

{% hint style="info" %}
**Note**: On a successful response (HTTP code 202), no body will be returned.
{% endhint %}

* **202**: calls successfully marked for deletion
* **401**: authentication headers invalid or the account is inactive
* **403**: the account attempting to cancel calls does not have appropriate permissions
* **404**: deployment was not found by the supplied survey and instance id
* **405**: invalid HTTP method supplied (only DELETE allowed)
* **415**: unsupported media type (Content-Type value in request)
* **500**: database error

The return structure will contain the following item(s):

| Name    | Data Type | Always Present | Description                                                                                                                                                                                            |
| ------- | --------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| success | boolean   | no             | Indicates the outcome of the request. This will only be present when the response http code is something other than HTTP 202, indicating a failure.                                                    |
| error   | string    | no             | If the success value is false this provides a message indicating what error(s) occurred. This will only be present when the response http code is something other than HTTP 202, indicating a failure. |

### **Sample Code**

This sample PHP code that makes a request to this method:

```php
<?php
$ch = curl_init();
$url = 'https://insight.plumvoice.com/api/surveys/{survey_id}/{instance_id}/cancel';
$username = 'you@yourdomain.com';
$password = 'your_developer_key';
curl_setopt($ch, CURLOPT_USERPWD, $username.":".$password);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/json", "Content-Type: application/x-www-form-urlencoded"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);
```
