> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# Keypad Input

> Capture the digits a caller enters on their phone keypad, store them in DTMF_INPUT, and map key presses to transfer actions on Synthflow voice agents.

![Keypad Input section in Global Settings with Enable keypad input turned on, Idle timeout at 2 seconds, Terminator set to #, and one action mapping the key 1 to a warm transfer](https://storage.googleapis.com/granular-changelog/doc-images/keypad_input.png)

Keypad Input lets a voice agent receive the digits a caller enters on their phone keypad. Use it for input that speech recognition gets wrong on a noisy line, such as an account number or an order ID. It also covers menu-style shortcuts such as "press 1 to talk to a person".

Every key the caller presses is stored in the `DTMF_INPUT` [variable](/variables#keypad-input). A key press can also run a [transfer action](/call-transfers) directly, without waiting for the agent to decide.

Keypad Input is off by default and is not available for chat agents. To send digits to a phone menu on an outbound call, use [IVR Handling](/set-up-ivr-handling) instead.

## Setup

1. Open the agent in the [agent editor](/the-agent-editor) and select **Settings** in the header.
2. In **Global Settings**, open **Keypad Input**.
3. Turn on **Enable keypad input**.
4. Set the **Idle timeout** and the **Terminator**.
5. Optional: map keys to transfer actions under **Actions**.
6. Select **Publish**.

## Key sequences

The caller can press `0` to `9`, `*`, and `#`. The first key interrupts the agent if it is speaking. Each following key is added to the same sequence.

A sequence is complete when either of these happens first:

| Setting          | Default   | Description                                                                                                                   |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Idle timeout** | 2 seconds | How long the agent waits after the last key before it responds. Ranges from 1 to 30 seconds. The timer restarts on every key. |
| **Terminator**   | `#`       | The key that completes the sequence immediately. It is not saved as a digit.                                                  |

Both settings apply to every key press on the agent. A caller who enters `48213#` completes the sequence at once. A caller who enters `48213` and stops completes it 2 seconds later.

The agent receives a completed sequence as the caller's turn and responds to it. Tell the agent in the prompt what the digits mean, for example "When the caller enters digits, treat them as the order ID."

> **Tip**
>
> Set a longer **Idle timeout** for long numbers. Callers pause while they read an account number from a card, and a 2-second timeout can split it into two sequences.

## Actions

An action mapping runs a transfer action as soon as the caller's keys match it. The transfer starts immediately and does not wait for the agent's response.

Attach the transfer action to the agent first. Only transfer actions attached to the agent appear in the list.

1. In the agent editor, select **Actions** and attach the transfer action.
2. In **Global Settings** → **Keypad Input**, select **Add actions**.
3. Choose how the mapping matches:
   * **presses**: the caller enters this exact key sequence, such as `1` or `99`.
   * **enters any**: the caller enters this number of keys, from 1 to 32, whatever they are. Use it to transfer after a 6-digit account number.
4. Choose the action to run.
5. Select **Add action** for each further mapping, then **Save**.

Rules for mappings:

* A key sequence cannot include the terminator key.
* The agent waits before running a mapping whose keys start a longer one. With mappings for `1` and `12`, pressing `1` runs the first only after the caller stops.
* Keys pressed while a mapped transfer is in progress are ignored.
* Keys that match no mapping follow the [key sequence](#key-sequences) rules and go to the agent.

Detaching a mapped action from the agent breaks the mapping. The mapping shows **Action not attached to this agent**. You cannot publish until you attach the action again or choose another one.

A mapped warm transfer can also ask the person receiving it to accept the call. The **Accept key** lets them accept with a key press, and the **Announcement** tells them which key to press. Both are settings on the transfer action, under [Human Detection](/call-transfers#human-detection).

## Call logs

Open the call in **Logs** → **Call Logs** to see what the caller entered and what it ran.

| Tab            | What it shows                                                                                                                                                                                                                       |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Transcript** | Each completed key sequence, in the place it happened in the conversation.                                                                                                                                                          |
| **Actions**    | A **Received key** entry for each completed sequence, such as **Received key '1'**. When the keys ran a mapped transfer, the transfer action follows it with its own status. Its **Request** shows the accept key and announcement. |
| **Variables**  | The `DTMF_INPUT` variable under **Collected**, holding every key the caller pressed during the call.                                                                                                                                |

The `DTMF_INPUT` variable is one value for the whole call. Keys are added in the order they were pressed, with nothing between sequences. A caller who enters `1234`, then later `5678`, ends the call with `DTMF_INPUT` set to `12345678`. The terminator key is never included.

Keys that ran a mapped transfer are left out of the variable while the call is in progress, so the agent and its actions do not see them. **Call Logs** and the post-call webhook include them.

To filter the list to calls where a mapped transfer ran, add an **Action** filter and choose the transfer action.

## API

Through the API, [Create Assistant](/api-reference/platform-api/agents/create-assistant) and [Update Assistant](/api-reference/platform-api/agents/update-assistant) set keypad input and its action mappings. Send the whole keypad object on an update. Settings you leave out return to their defaults.

The [post-call webhook](/webhooks#post-call-webhook) includes `DTMF_INPUT` with the call's other variables.

## FAQ

#### Why did the agent not react to a key press?

Check that **Enable keypad input** is on and that the agent was published after you turned it on. The agent reads the keypad signals your phone carrier sends alongside the call (RFC 2833). It does not listen for key tones in the audio.

#### Can a key press run a custom action or end the call?

No. A mapping runs a transfer action only. For anything else, let the sequence reach the agent and tell it in the prompt which action to run for which digits.

#### Can I use the digits in a transfer or a custom action?

Yes. Use `DTMF_INPUT` wherever you [use variables](/variables#where-to-use-variables), such as a custom action's request or a transfer's phone number.

#### Can the person receiving a transfer accept it with a key press?

Yes. That is the **Accept key** on the transfer action, under [Human Detection](/call-transfers#human-detection). The **Announcement** next to it tells them which key to press. Both are separate from Keypad Input and work whether Keypad Input is on or off.