> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.telekesher.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.telekesher.dev/_mcp/server.

# Cancel in-progress DTMF collection

DELETE https://api.telekesher.dev/v1/sessions/{uuid}/dtmf/collect

**Rate limit: Per command** · **Burst:** 4 · **Refill:** 0.8 req/s

This DELETE has its own bucket. The POST is configured identically, but uses a separate bucket.

Cancel the in-progress prompt-and-collect operation on this session. Interrupts
the prompt/collect cycle; the resulting `digits.collected` carries
`status: cancelled`. Applies to the most recently dispatched
DTMF collection; with none in progress the request is accepted
and has no effect.

Residual latency: cancellation stops prompt audio
promptly, but the cancelled command's terminal `digits.collected`
(`status: cancelled`) does not fire until the in-progress collect phase
ends on the media layer's own timers — it is not delivered the instant you call
DELETE. Input entered after a cancel is discarded — reported on the
cancelled command's `digits.collected` event, never delivered to a later
command.

Reference: https://docs.telekesher.dev/api/keypad-input/cancel

## Authentication

- `Authorization` header (bearer token, required) — Application auth. Send `Authorization: Bearer <app_uuid>:<api_key>`. See [Authentication](https://voice-platform.docs.buildwithfern.com/api/authentication) for details.

## Request

### Path parameters

- `uuid` (string, required) — [Session](/api/sessions) UUID (format `{5-char-prefix}-{uuid}`).

### Query parameters

- `operation_uuid` (string, optional) — Client-supplied UUID to label this cancel operation; must be a valid UUID or the request is rejected with 400; a UUID is generated when omitted. Echoed back as `operation_uuid` in the 202 response and on the resulting webhook.

## Response

### 202

Cancellation accepted.

- `operation_uuid` (string, required)
- `status` (enum, required)
  - Allowed values: `cancelling`

## Examples

**Response**

```json
{
  "operation_uuid": "550e8400-e29b-41d4-a716-446655440000",
  "status": "cancelling"
}
```

**SDK Code**

```python Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
import requests

url = "https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.json())
```

```javascript Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
const url = 'https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
require 'uri'
require 'net/http'

url = URI("https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
using RestSharp;

var client = new RestClient("https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Keypad Input_cancelPlayPromptAndCollectDTMFDigits_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.telekesher.dev/v1/sessions/uuid/dtmf/collect")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```