How to accept user keypad input?
# support
r
Is it possible to accept a caller's keypad input? I am using a Vapi number with a webhook, and I was attempting a simplistic proof-of-concept by accepting a 4-digit code and repeating back to the user, but the assistant fails to capture the keypad input. Maybe I'm doing something incorrect? Call IDs: -
a028a49f-13a1-4a07-8c9b-143675f83290
with a
#
at the end, code
1234#
-
38a9f402-8d7b-42d4-960c-05d694d0e205
without a
#
at the end, code
1234
Timestamp: - Roughly
16:57:23:938
(June 18, 2025) Response expected: - "You have entered 1234." Response received: - Nothing (silence) - Call ended after silence timeout
v
To accept user keypad input in Vapi, add the following to your assistant configuration:
Copy code
json
{
  "keypadInputPlan": {
    "enabled": true,
    "delimiters": "#",
    "timeoutSeconds": 2
  }
}
Make sure your webhook or assistant logic is set up to handle keypad input events and respond accordingly. If you still get silence, double-check that
keypadInputPlan
is enabled and review your webhook logs for incoming keypad input events. [See more details in the Vapi changelog.](https://docs.vapi.ai/changelog/2025/2/27) Sources: - [Vapi Changelog: February 27, 2025](https://docs.vapi.ai/changelog/2025/2/27) - [Vapi Default Tools: DTMF/Keypad Input](https://docs.vapi.ai/tools/default-tools)
r
My assistant does have the
keypadInputPlan
enabled as such:
Copy code
keypadInputPlan: {
    enabled: true,
    timeoutSeconds: 0.5,
  },
Also, my messages prompt is as follows:
Copy code
messages: [
      {
        role: "system",
        content: `You are a helpful customer support assistant for ACME Corporation.

[Identity]

- You are friendly, efficient, and knowledgeable

- You help customers with product information, order status, and basic troubleshooting


[KEYPAD INPUT HANDLING]

- Monitor for keypad inputs from the user
- Capture the keypad input and save it as the variable 'code'.
- If the user presses '#' at any time, then they are done entering their code. Store the keypad input as 'code', excluding the '#' keypress.
- Once the keypad input is complete, repeat back the 'code' to the user.
- If the user does not press '#' within 2 seconds, then assume they are done entering their code and repeat back the 'code' to the user.

[Important]

- When a user's keypad input is detected, it will appear in the conversation as: "User's Keypad Entry: X" where X is the digit pressed`,
      },
    ]
@Vapi Support Bot
v
Your configuration for keypad input appears correct. However, to help narrow down the issue: Could you check your webhook logs to see if any keypad input events are being received for the affected calls? This will help determine if the problem is with event delivery or with the assistant's prompt logic. If you need guidance on what to look for in the logs, let me know! Sources: - [Vapi Changelog: February 27, 2025](https://docs.vapi.ai/changelog/2025/2/27) - [Vapi Default Tools: DTMF/Keypad Input](https://docs.vapi.ai/tools/default-tools)
r
I don't see any keypad input events being received in the logs. What should I be looking for? @Vapi Support Bot
v
To help you further: Could you share a sample of your webhook log output (with sensitive info redacted) so I can check if keypad input events are missing or just not being recognized? This will help determine if the issue is with event delivery or log interpretation. Sources: - [Vapi Changelog: February 27, 2025](https://docs.vapi.ai/changelog/2025/2/27) - [Vapi Default Tools: DTMF/Keypad Input](https://docs.vapi.ai/tools/default-tools)
k
If you plan on not using a delimiter, make sure the object is still present in the request with an empty array:
Copy code
{
  "keypadInputPlan": {
    "enabled": true,
    "timeoutSeconds": 2,
    "delimiters": []
  }
}
r
I'm using Typescript, and that doesn't appear to be a valid option in the Node SDK. If I use an empty array, it fails to build. These are the types for the
KeypadInputPlan
, which also state that the delimiter is an optional field. Is it actually a required field?
Copy code
export interface KeypadInputPlan {
    /**
     * This keeps track of whether the user has enabled keypad input.
     * By default, it is off.
     *
     * @default false
     */
    enabled?: boolean;
    /**
     * This is the time in seconds to wait before processing the input.
     * If the input is not received within this time, the input will be ignored.
     * If set to "off", the input will be processed when the user enters a delimiter or immediately if no delimiter is used.
     *
     * @default 2
     */
    timeoutSeconds?: number;
    /**
     * This is the delimiter(s) that will be used to process the input.
     * Can be '#', '*', or an empty array.
     */
    delimiters?: Vapi.KeypadInputPlanDelimiters;
}
Copy code
/**
 * This is the delimiter(s) that will be used to process the input.
 * Can be '#', '*', or an empty array.
 */
export type KeypadInputPlanDelimiters = "#" | "*" | "";
export declare const KeypadInputPlanDelimiters: {
    readonly Hash: "#";
    readonly Asterisk: "*";
    readonly Empty: "";
};
Also, I tried setting a delimiter to
#
or empty
""
, and it's still failing to acknowledge any keypad input.
k
Can you please provide a call id for your recent tests?
r
Yeah, here are two call IDs with the latest Node SDK v`0.9.2` and the config: Call IDs: 1.
c1fa8414-00d1-423d-b142-f5693289fca1
with the delimiter set as
""
2.
f9768ff3-e48b-42f1-b018-7a8a0c4ade51
with the delimiter set as
#
Keypad Input Config
Copy code
keypadInputPlan: {
    enabled: true,
    timeoutSeconds: 0.5,
    delimiters: "#",
  },
Similar thing happens and they timeout and the assistant doesn't repeat the code back.
k
Add "keypad-input" server message for your assistant and increase the timeout to 2 or 3. You can also use a \* as the delimiter.
r
Okay, I tried your suggestion with no luck. I also created an assistant in the dashboard to see if it was a configuration issue on my server-side/webhook setup, but I got the same results. - I set the delimiter as
*
and
#
- Is the "keypad-input" a valid option? It didn't exist in the server message dropdown or in the Node SDK Typings Here are three call IDs for the Assistant I created in the dashboard: -
cc0bf13c-d293-4c5a-bcce-92105bc447fe
(Jun 27, 2025, 09:53) -
a3ccd2e1-2330-4690-85d3-870d14bd9128
(Jun 27, 2025, 09:44 ) -
18b8e014-dc5e-4224-88c5-b8f453356334
(Jun 27, 2025, 08:51)
k
In the transcriber settings, enable numerals
r
Same thing. I enabled numerals, but it doesn't register keypad inputs. It will only recognize when I speak the numbers. Call logs: -
c25654ef-1a8e-44ab-b6ae-9b2dd9a34707
(Jun 30, 2025, 09:34) -
7e9301dc-6126-4be2-b891-43d1280bc8b2
(Jun 30, 2025, 09:32) -
11c6da0b-83f0-4563-999f-a392fd07c18b
(Jun 30, 2025, 09:27)
I've attempted updating the transcriber and assistant model settings as well as the system prompt as follows, but it's still failing to recognize the caller's keypad input:
Copy code
[Identity]  
- You are a customer service assistant for ACME Corporation, providing professional and clear support.  
- You are friendly, efficient, and knowledgeable.  
- You assist customers with product information, order status, and basic troubleshooting.  
- You speak in a clear, calm, and professional manner.  

[Style]  
- Maintain a friendly and supportive tone.  
- Use polite and professional language.  
- Keep responses concise and to the point.  

[Response Guidelines]  
- Use plain language to confirm information and ask clarifying questions if needed.  
- Monitor for and accurately capture keypad inputs.  
- If numbers are mentioned, ensure clarity by spelling them out when necessary.  

[Task & Goals]  
1. Greet the user warmly and request their identity verification code, which is a 4-digit number.  
<wait for keypad input>  
2. Monitor and record the user's 4-digit keypad input as `code` once received. Listen for input completion either by `#` or `*`, or an absence of input within 3 seconds.  
3. Politely confirm and repeat the `code` back to the user by saying: "The code you entered is: [code]. Thank you."  
4. If incomplete after 3 seconds, repeat the code received thus far.  

[Error Handling / Fallback]  
- If no response is received, gently remind the user to enter their code.  
- If an error occurs in capturing the input, apologize and request the user to enter their code again.  

[Additional Instructions]  
- Capture keypad input and log any sequence of pressed numbers, disregarding `#` or `*`, as `User's Keypad Entry: X` (where 'X' is the digit pressed).  
- Provide confirmations promptly to maintain an efficient flow of interaction.
@Vapi
k
As a quick test, could you try importing a phone number from Twilio or Telnyx and see if that provider is able to detect the keypad input? Your assistant configuration looks correct, but I am starting to suspect that VAPI numbers are not capable of detecting DTMF.
r
Okay, I think that was it. I used a Telnyx number, and it was able to detect the keypad input. Thank you for your help Kyle!
k
Glad the issue was resolved. Please reach out to us if you have any other questions regarding this issue
6 Views