FG
๐Ÿ”Œ APIs & SDKsTwilio

Wrong `PromptAttributes` interface implementation

Freshabout 3 years ago
Mar 14, 20260 views
Confidence Score84%
84%

Problem

Issue Summary Right now I'm following the docs to use `Pay.Prompt` noun but there is a problem while using TypeScript. The interface includes the following: [code block] And as we can see the attribute is `for_` (with the `_`) and inside the docs: https://www.twilio.com/es-mx/docs/voice/twiml/pay/prompt#for It's `for` only (without the `_`), if we try to use `Pay.Prompt` like the following: [code block] It throws an error: `Argument of type '{ for: string; }' is not assignable to parameter of type 'PromptAttributes'.` So, we need to use `for_` but the Twilio parser does not detect `for_`. Another thing is that it looks like the docs are also out of date: The errorTypes are: [code block] And there is no `invalid-postal-code` for example when the current docs state that it is actually there. Maybe it could be another good idea to add the usage of the errorTypes inside the docs? so we know it's an array and how to use it with `cardType` could be really useful. Steps to Reproduce 1. Create a Twilio Serverless function 2. Add TS support 3. Use the `Pay` verb 4. Add the `Prompt` noun support Code Snippet [code block] Exception/Log [code block] Technical details: twilio-node version: ^3.80.0 twilio/runtime-handler: ^1.25.0 node version: 16.16.0 typescript: 4.0.0 ts-node: 10.7.0 @types/node 17.0.21 Workaround: There is a workaround by adding `// @ts-ignore` above the line like: [code block]

Error Output

error:
`Argument of type '{ for: string; }' is not assignable to parameter of type 'PromptAttributes'.`

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Wrong `PromptAttributes` interface implementation

Low Risk

Hi @asfo , I've tried to recreate your issue but did not get the same error. In order to properly debug this issue, please file a support ticket.

84

Trust Score

1 verification

100% success
  1. 1

    Hi @asfo , I've tried to recreate your issue but did not get the same error. In

    Hi @asfo , I've tried to recreate your issue but did not get the same error. In order to properly debug this issue, please file a support ticket.

Validation

Resolved in twilio/twilio-node GitHub issue #825. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

twiliosmsapicode-generationtype:-twilio-enhancementstatus:-waiting-for-feature