> 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 an in-progress play_and_get_digits

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

**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 an in-progress `play_and_get_digits` on this session. Interrupts
the prompt/collect cycle; the resulting `digits.collected` carries
`status: cancelled`. Applies to the most recently dispatched
`play_and_get_digits`; 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/collect-keypad-input/cancel

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: voice-api
  version: 1.0.0
paths:
  /v1/sessions/{uuid}/play_and_get_digits:
    delete:
      operationId: cancelPlayPromptAndCollectDTMFDigits
      summary: Cancel an in-progress play_and_get_digits
      description: >-
        **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 an in-progress `play_and_get_digits` on this session. Interrupts

        the prompt/collect cycle; the resulting `digits.collected` carries

        `status: cancelled`. Applies to the most recently dispatched

        `play_and_get_digits`; 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.
      tags:
        - collectKeypadInput
      parameters:
        - name: uuid
          in: path
          description: '[Session](/api/sessions) UUID (format `{5-char-prefix}-{uuid}`).'
          required: true
          schema:
            type: string
        - name: operation_uuid
          in: query
          description: |-
            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.
          required: false
          schema:
            type: string
            format: uuid
        - name: Authorization
          in: header
          description: >-
            Application auth. Send `Authorization: Bearer <app_uuid>:<api_key>`.
            See
            [Authentication](https://voice-platform.docs.buildwithfern.com/api/authentication)
            for details.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Cancellation accepted.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Collect keypad
                  input_cancelPlayPromptAndCollectDTMFDigits_Response_202
        '400':
          description: >-
            Missing `Authorization`, malformed Bearer credentials, or invalid
            request parameters. A syntactically valid credential with an invalid
            API key returns `401` instead.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CancelPlayPromptAndCollectDTMFDigitsRequestBadRequestError
        '401':
          description: >-
            The Bearer credential is syntactically valid but its API key is
            invalid. Missing `Authorization` or malformed Bearer credentials
            return `400`.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CancelPlayPromptAndCollectDTMFDigitsRequestUnauthorizedError
        '404':
          description: >-
            The requested resource was not found or is not owned by the
            authenticated app.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CancelPlayPromptAndCollectDTMFDigitsRequestNotFoundError
        '429':
          description: >-
            Rate limit exceeded — a per-command, per-room, or per-app token
            bucket was empty. The `retry_after` field gives the integer seconds
            to wait before retrying.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CancelPlayPromptAndCollectDTMFDigitsRequestTooManyRequestsError
        '500':
          description: Internal gateway error.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CancelPlayPromptAndCollectDTMFDigitsRequestInternalServerError
servers:
  - url: https://api.telekesher.dev
    description: Gateway server
components:
  schemas:
    V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaStatus:
      type: string
      enum:
        - cancelling
      title: >-
        V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaStatus
    Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_Response_202:
      type: object
      properties:
        operation_uuid:
          type: string
          format: uuid
        status:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaStatus
      required:
        - operation_uuid
        - status
      description: >-
        An accepted asynchronous command. Store `operation_uuid` and use it to
        correlate later lifecycle events; an event that carries the same field
        is a correlation link, not an embedded Operation object.
      title: Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_Response_202
    V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode:
      type: string
      enum:
        - invalid_request
        - payload_too_large
        - result_set_too_large
        - unauthorized
        - forbidden
        - not_found
        - conflict
        - recording_not_active
        - room_full
        - rate_limited
        - unavailable
        - internal
      description: >-
        Stable, machine-readable error class from a closed set of twelve values.
        Branch on this for programmatic handling. New codes are only added with
        a documented API change. Maps to the HTTP status as follows:
        `invalid_request` (400/415/422), `payload_too_large` and
        `result_set_too_large` (413), `unauthorized` (401), `forbidden` (403),
        `not_found` (404), `recording_not_active` (400); `conflict` and
        `room_full` (409), `rate_limited` (429), `unavailable` (502/503/529),
        `internal` (500).


        Note: `413` is the only status shared by two codes — `payload_too_large`
        means the request body exceeded its size cap, while
        `result_set_too_large` means a list response exceeded the system result
        ceiling (narrow the query with filters and retry).


        Note: `unavailable` is the only code that maps to multiple HTTP
        statuses, which represent different retry conditions: `502` means a
        command dependency could not accept the request, `503` means a required
        service (including the idempotency store) is temporarily unavailable,
        and `529` means the gateway is overloaded with no spare capacity. Use
        the HTTP status and operation description, not just `code`, to
        distinguish them.
      title: >-
        V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
    CancelPlayPromptAndCollectDTMFDigitsRequestBadRequestError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
          description: >-
            Stable, machine-readable error class from a closed set of twelve
            values. Branch on this for programmatic handling. New codes are only
            added with a documented API change. Maps to the HTTP status as
            follows: `invalid_request` (400/415/422), `payload_too_large` and
            `result_set_too_large` (413), `unauthorized` (401), `forbidden`
            (403), `not_found` (404), `recording_not_active` (400); `conflict`
            and `room_full` (409), `rate_limited` (429), `unavailable`
            (502/503/529), `internal` (500).


            Note: `413` is the only status shared by two codes —
            `payload_too_large` means the request body exceeded its size cap,
            while `result_set_too_large` means a list response exceeded the
            system result ceiling (narrow the query with filters and retry).


            Note: `unavailable` is the only code that maps to multiple HTTP
            statuses, which represent different retry conditions: `502` means a
            command dependency could not accept the request, `503` means a
            required service (including the idempotency store) is temporarily
            unavailable, and `529` means the gateway is overloaded with no spare
            capacity. Use the HTTP status and operation description, not just
            `code`, to distinguish them.
        error:
          type: string
          description: >-
            Human-readable, English-only error message. For display only —
            phrasing may change without notice, so branch on `code`, not on this
            string.
        retry_after:
          type: integer
          description: >-
            Integer seconds to wait before retrying. Present on `429` (the time
            until the denying token bucket refills by one token) and on `529`
            (overload back-off hint). Mirrors the `Retry-After` response header.
        success:
          type: boolean
      required:
        - code
        - error
        - success
      title: CancelPlayPromptAndCollectDTMFDigitsRequestBadRequestError
    CancelPlayPromptAndCollectDTMFDigitsRequestUnauthorizedError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
          description: >-
            Stable, machine-readable error class from a closed set of twelve
            values. Branch on this for programmatic handling. New codes are only
            added with a documented API change. Maps to the HTTP status as
            follows: `invalid_request` (400/415/422), `payload_too_large` and
            `result_set_too_large` (413), `unauthorized` (401), `forbidden`
            (403), `not_found` (404), `recording_not_active` (400); `conflict`
            and `room_full` (409), `rate_limited` (429), `unavailable`
            (502/503/529), `internal` (500).


            Note: `413` is the only status shared by two codes —
            `payload_too_large` means the request body exceeded its size cap,
            while `result_set_too_large` means a list response exceeded the
            system result ceiling (narrow the query with filters and retry).


            Note: `unavailable` is the only code that maps to multiple HTTP
            statuses, which represent different retry conditions: `502` means a
            command dependency could not accept the request, `503` means a
            required service (including the idempotency store) is temporarily
            unavailable, and `529` means the gateway is overloaded with no spare
            capacity. Use the HTTP status and operation description, not just
            `code`, to distinguish them.
        error:
          type: string
          description: >-
            Human-readable, English-only error message. For display only —
            phrasing may change without notice, so branch on `code`, not on this
            string.
        retry_after:
          type: integer
          description: >-
            Integer seconds to wait before retrying. Present on `429` (the time
            until the denying token bucket refills by one token) and on `529`
            (overload back-off hint). Mirrors the `Retry-After` response header.
        success:
          type: boolean
      required:
        - code
        - error
        - success
      title: CancelPlayPromptAndCollectDTMFDigitsRequestUnauthorizedError
    CancelPlayPromptAndCollectDTMFDigitsRequestNotFoundError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
          description: >-
            Stable, machine-readable error class from a closed set of twelve
            values. Branch on this for programmatic handling. New codes are only
            added with a documented API change. Maps to the HTTP status as
            follows: `invalid_request` (400/415/422), `payload_too_large` and
            `result_set_too_large` (413), `unauthorized` (401), `forbidden`
            (403), `not_found` (404), `recording_not_active` (400); `conflict`
            and `room_full` (409), `rate_limited` (429), `unavailable`
            (502/503/529), `internal` (500).


            Note: `413` is the only status shared by two codes —
            `payload_too_large` means the request body exceeded its size cap,
            while `result_set_too_large` means a list response exceeded the
            system result ceiling (narrow the query with filters and retry).


            Note: `unavailable` is the only code that maps to multiple HTTP
            statuses, which represent different retry conditions: `502` means a
            command dependency could not accept the request, `503` means a
            required service (including the idempotency store) is temporarily
            unavailable, and `529` means the gateway is overloaded with no spare
            capacity. Use the HTTP status and operation description, not just
            `code`, to distinguish them.
        error:
          type: string
          description: >-
            Human-readable, English-only error message. For display only —
            phrasing may change without notice, so branch on `code`, not on this
            string.
        retry_after:
          type: integer
          description: >-
            Integer seconds to wait before retrying. Present on `429` (the time
            until the denying token bucket refills by one token) and on `529`
            (overload back-off hint). Mirrors the `Retry-After` response header.
        success:
          type: boolean
      required:
        - code
        - error
        - success
      title: CancelPlayPromptAndCollectDTMFDigitsRequestNotFoundError
    CancelPlayPromptAndCollectDTMFDigitsRequestTooManyRequestsError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
          description: >-
            Stable, machine-readable error class from a closed set of twelve
            values. Branch on this for programmatic handling. New codes are only
            added with a documented API change. Maps to the HTTP status as
            follows: `invalid_request` (400/415/422), `payload_too_large` and
            `result_set_too_large` (413), `unauthorized` (401), `forbidden`
            (403), `not_found` (404), `recording_not_active` (400); `conflict`
            and `room_full` (409), `rate_limited` (429), `unavailable`
            (502/503/529), `internal` (500).


            Note: `413` is the only status shared by two codes —
            `payload_too_large` means the request body exceeded its size cap,
            while `result_set_too_large` means a list response exceeded the
            system result ceiling (narrow the query with filters and retry).


            Note: `unavailable` is the only code that maps to multiple HTTP
            statuses, which represent different retry conditions: `502` means a
            command dependency could not accept the request, `503` means a
            required service (including the idempotency store) is temporarily
            unavailable, and `529` means the gateway is overloaded with no spare
            capacity. Use the HTTP status and operation description, not just
            `code`, to distinguish them.
        error:
          type: string
          description: >-
            Human-readable, English-only error message. For display only —
            phrasing may change without notice, so branch on `code`, not on this
            string.
        retry_after:
          type: integer
          description: >-
            Integer seconds to wait before retrying. Present on `429` (the time
            until the denying token bucket refills by one token) and on `529`
            (overload back-off hint). Mirrors the `Retry-After` response header.
        success:
          type: boolean
      required:
        - code
        - error
        - retry_after
        - success
      title: CancelPlayPromptAndCollectDTMFDigitsRequestTooManyRequestsError
    CancelPlayPromptAndCollectDTMFDigitsRequestInternalServerError:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SessionsUuidPlayAndGetDigitsDeleteResponsesContentApplicationJsonSchemaCode
          description: >-
            Stable, machine-readable error class from a closed set of twelve
            values. Branch on this for programmatic handling. New codes are only
            added with a documented API change. Maps to the HTTP status as
            follows: `invalid_request` (400/415/422), `payload_too_large` and
            `result_set_too_large` (413), `unauthorized` (401), `forbidden`
            (403), `not_found` (404), `recording_not_active` (400); `conflict`
            and `room_full` (409), `rate_limited` (429), `unavailable`
            (502/503/529), `internal` (500).


            Note: `413` is the only status shared by two codes —
            `payload_too_large` means the request body exceeded its size cap,
            while `result_set_too_large` means a list response exceeded the
            system result ceiling (narrow the query with filters and retry).


            Note: `unavailable` is the only code that maps to multiple HTTP
            statuses, which represent different retry conditions: `502` means a
            command dependency could not accept the request, `503` means a
            required service (including the idempotency store) is temporarily
            unavailable, and `529` means the gateway is overloaded with no spare
            capacity. Use the HTTP status and operation description, not just
            `code`, to distinguish them.
        error:
          type: string
          description: >-
            Human-readable, English-only error message. For display only —
            phrasing may change without notice, so branch on `code`, not on this
            string.
        retry_after:
          type: integer
          description: >-
            Integer seconds to wait before retrying. Present on `429` (the time
            until the denying token bucket refills by one token) and on `529`
            (overload back-off hint). Mirrors the `Retry-After` response header.
        success:
          type: boolean
      required:
        - code
        - error
        - success
      title: CancelPlayPromptAndCollectDTMFDigitsRequestInternalServerError
  securitySchemes:
    bearerAppAuth:
      type: http
      scheme: bearer
      description: >-
        Application auth. Send `Authorization: Bearer <app_uuid>:<api_key>`. See
        [Authentication](https://voice-platform.docs.buildwithfern.com/api/authentication)
        for details.

```

## Examples



**Response**

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

**SDK Code**

```python Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
import requests

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

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

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

print(response.json())
```

```javascript Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
const url = 'https://api.telekesher.dev/v1/sessions/uuid/play_and_get_digits';
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 Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
package main

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

func main() {

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

	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 Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
require 'uri'
require 'net/http'

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

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 Collect 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/play_and_get_digits")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Collect 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/play_and_get_digits', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
using RestSharp;

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

```swift Collect keypad input_cancelPlayPromptAndCollectDTMFDigits_example
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.telekesher.dev/v1/sessions/uuid/play_and_get_digits")! 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()
```