***

title: collect
slug: /reference/typescript/rest/calling/collect
description: Collect user input (DTMF or speech) on an active call via REST.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Start collecting user input on an active call. Supports DTMF digit collection
and speech recognition. Returns a `control_id` for managing the collection.

<EndpointSchemaSnippet endpoint="POST /api/calling/calls" />

## **Response Example**

<EndpointResponseSnippet endpoint="POST /api/calling/calls" />

## **Examples**

### Collect DTMF Digits

```typescript {10}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

// Collect DTMF digits
const result = await client.calling.collect("call-id-xxx", {
  digits: { max: 4, terminators: "#", digit_timeout: 5.0 },
  initial_timeout: 10.0,
});
```

### Collect Speech

```typescript {9}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

const result = await client.calling.collect("call-id-xxx", {
  speech: {
    end_silence_timeout: 1.0,
    language: "en-US",
  },
});
```

### Collect Both

```typescript {9}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

const result = await client.calling.collect("call-id-xxx", {
  digits: { max: 1, terminators: "#" },
  speech: { end_silence_timeout: 2.0 },
  initial_timeout: 15.0,
});
```