Back to Blog
Error-Code Fixes

Twilio Error 12101: Invalid TwiML Verb or Attribute: Causes and How to Fix It

Your TwiML contains a verb or attribute that Twilio does not recognise. Error 12101 is a syntax error in your TwiML. Here is the full fix.

DA
Danial A
Senior Twilio Consultant, Telphi Consulting
June 21, 2026
6 min read
Twilio
Error
Webhook
TwiML
Troubleshooting
Twilio Error 12101: Invalid TwiML Verb or Attribute: Causes and How to Fix It

Twilio error 12101 means your TwiML document is valid XML and successfully parsed, but it contains a verb element or attribute name that does not exist in Twilio's TwiML specification for the resource type being processed. TwiML for voice calls and TwiML for SMS messaging have different allowed verb sets, and using a verb from one context in the other, or using a misspelled verb name, produces this error. The fix requires aligning your TwiML document with the exact verbs and attributes defined in the current Twilio TwiML reference.

What Causes This Error

Using a voice-only TwiML verb such as Dial, Gather, Record, Play, or Conference in a response to an SMS webhook is a common cause, since the Messaging TwiML spec only allows Message, Redirect, and a limited subset of verbs that apply to messaging flows. Typos in verb or attribute names are a second cause: TwiML verbs are case-sensitive and must be capitalized exactly as specified, so a typo like <say> instead of <Say> or <sms> instead of <Message> will produce 12101 because Twilio's parser performs an exact case-sensitive match. Using deprecated TwiML verbs that were valid in older API versions but have been removed from the current TwiML specification, such as the deprecated <Sms> verb that was replaced by <Message>, generates 12101 on accounts that target the current TwiML API version. Inventing custom verb names or using verbs from other XML-based telephony systems (such as VXML or CCXML) that are not part of Twilio's TwiML specification will always produce this error.

How to Fix It Step by Step

Check the Twilio Debugger in the Console under Monitor, then Debugger to find the 12101 alert: the alert detail shows the specific verb or attribute name that was unrecognized, which tells you exactly what to fix in your TwiML. Open the Twilio TwiML reference documentation for the resource type that triggered the error (Voice TwiML or Messaging TwiML) and confirm that every verb in your TwiML document appears in the reference with identical capitalization. For voice TwiML, the allowed top-level verbs include Dial, Enqueue, Gather, Hangup, Leave, Message, Pause, Play, Queue, Record, Redirect, Reject, Say, and Sms (deprecated); for messaging TwiML, the primary verb is Message with optional nested Body and Media verbs. If you are using a TwiML helper library, check that the library version you have installed matches the Twilio API version your account is using and update the library if it is outdated, since older library versions may generate deprecated verbs.

How to Prevent It from Recurring

Use the official Twilio TwiML builder library for your language exclusively rather than constructing TwiML XML strings manually: the builder library exposes only valid verbs as class methods, making it structurally impossible to generate an unrecognized verb name through the builder API. Add Twilio's TwiML XSD schema validation to your unit tests by downloading the official TwiML schema and validating generated TwiML documents against it in CI, catching invalid verbs and attributes before deployment. Maintain a clear separation in your codebase between voice webhook handlers and messaging webhook handlers, with separate TwiML generation functions for each, to prevent voice verbs from accidentally being included in messaging responses or vice versa. When upgrading your Twilio helper library version, review the library's changelog for any deprecated or removed verbs and update your TwiML generation code accordingly before deploying.

When to Call a Specialist

If Twilio's Debugger shows 12101 but the specific verb it identifies looks correct in your TwiML source code, there may be a character encoding issue where a look-alike Unicode character has been substituted for an ASCII letter in the verb name, which is visually identical but recognized as a different character by Twilio's XML parser. A specialist can run a byte-level comparison of your TwiML verb names against the expected ASCII character codes to identify any invisible character substitutions. You should also seek specialist help if you are building a complex multi-stage TwiML application (such as an IVR with nested Gather verbs and Dial with nested Conference) where specific verb nesting combinations are allowed in some contexts but not others, and determining exactly which combination is triggering 12101 requires a systematic TwiML structure audit. TwiML verb compatibility questions that span multiple Twilio product types (Voice, Messaging, Fax) benefit from specialist knowledge of the exact allowed verb set for each product.

Conclusion

Error 12101 is a TwiML verb or attribute recognition failure that is fixed by correcting the specific unrecognized name to exactly match the current Twilio TwiML specification. If this error is blocking your production system, contact our team and we will diagnose and fix it within the hour.

Share this article:
0 views

Ready to Transform Your Business Communications?

Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.

Comments (0)

Join the discussion and share your thoughts (AI-moderated for quality)

Protected by AI moderation

Be the first to comment

No comments yet. Share your thoughts below.