# Cancel Outbound Calls

{% hint style="success" %}
**-** **NEW! -  Interactive API docs, now live!**

Visit [api-docs.plumvoice.com](https://api-docs.plumvoice.com) to **read** Plum API documentation, **build and test requests** in our interactive API sandbox, **review** the responses, and **share** it all with your team.
{% endhint %}

## Cancelling All Pending Outbound Calls

<mark style="color:red;">`DELETE`</mark> `https://fuse.plumvoice.com/api/apps/{application_id}/{deployment_id}/cancel`

Cancel all pending outbound calls

#### Path Parameters

| Name            | Type   | Description                                                                                                                                                                                              |
| --------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| application\_id | string | <p>Application ID number.</p><p></p><p>To find this number, <a href="/pages/-MJCrBvC0VgWv3SbsmEK#locating-the-application-and-deployment-id">see the following instructions from Outbound Calls</a>.</p> |
| deployment\_id  | string | <p>Deployment ID number.</p><p></p><p>To find this number, <a href="/pages/-MJCrBvC0VgWv3SbsmEK#locating-the-application-and-deployment-id">see the following instructions from Outbound Calls</a>.</p>  |

{% tabs %}
{% tab title="202 Call(s) successfully canceled." %}

```
No response body returned in either JSON or XML
```

{% endtab %}

{% tab title="404 User, deployment, or application not found. Example: deployment not found." %}
{% tabs %}
{% tab title="JSON" %}

```javascript
{"error": "No deployment was found by that application id and deployment id."}
```

{% endtab %}

{% tab title="XML" %}

```markup
<?xml version="1.0"?>
<result>
  <error>No deployment was found by that application id and deployment id.</error>
</result>
```

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

### **Possible Response Codes**

* **202**: calls successfully canceled
* **401**: authentication headers invalid or the account is inactive
* **403**: the account attempting to cancel calls does not have appropriate permissions
* **404**: user, deployment, or application not found
* **405**: invalid HTTP method supplied (only DELETE allowed)
* **500**: database error

The return structure contains the following item(s):

{% hint style="info" %}
**Note**: No body is returned for a successful response (HTTP code 202).
{% endhint %}

| Name  | Data Type | Always Present | Description                                                                          |
| ----- | --------- | -------------- | ------------------------------------------------------------------------------------ |
| error | string    | no             | If the HTTP code is not 202, this provides a message indicating what error occurred. |

### **Sample Code**

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

```php
<?php
// account and application settings
$email = '<your_email_address>';
$developer_key = '<your_developer_key>';
$application_id = '<your_application_id>';
$deployment_id = '<your_deployment_id>';

// build the URL
$url = 'https://fuse.plumvoice.com/api/apps/'.$application_id.'/'.$deployment_id.'/cancel';

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, $email.':'.$developer_key);
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"));
$result = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($result);
var_dump($http_code);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plumvoice.com/fuse/apis/outbound-calls/cancelling-outbound-calls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
