Issue
When submitting a bundle registration, you receive the error message "Unexpected error, please try again. (Error 400)" when trying to save the form, even though your text appears to be well under the 1024 character limit when checking with standard word counter tools.
Product
Programmable Voice
Environment
Twilio Console
Cause
The backend system counts the actual byte size of the submitted text, which includes hidden formatting elements and special characters, rather than just the visible letters.
Standard word processors count a line break as zero or one character, but web applications often process a single line break as two characters (a carriage return and a line feed). Additionally, typographic "smart" quotes (curly quotes) can take up to three bytes each in backend encoding, whereas standard straight quotes only take one byte. If your text contains multiple line breaks, smart quotes, or long URLs, the hidden data footprint can easily push a text that visibly looks like 990 characters over the absolute 1024 limit.
Resolution
To resolve this error, you must reduce the hidden formatting and byte weight of your text payload:
- Remove unnecessary line breaks: Consolidate your text into solid paragraphs and remove empty lines between list items.
- Replace special characters: Change all typographic curly quotes (“ ”) to standard straight quotes (" ").
- Shorten URLs: Remove unnecessary elements from links, such as
https://www.or tracking parameters at the end of the URL, to save space.
How to verify the exact server error using Chrome Developer Tools:
If you need to confirm that a specific field is throwing the 400 Bad Request error, you can inspect the backend response directly in your browser:
- Open Google Chrome and navigate to the page where the form is located.
- Right-click anywhere on the blank space of the page and select Inspect.
- In the Developer Tools panel that opens, click the Network tab.
- Attempt to submit your form to reproduce the error.
- Look at the list of network requests and locate the failed POST request (it will be highlighted in red with a
400status). - Click on the name of the failed request, and a secondary side panel will open.
- Click the Response (or Preview) tab in that secondary panel. This will display the raw JSON response from the server containing the exact 1024-character limit error message. and stating the exact field where the issue is happening, for example:
Here we can observe that the limit was triggered by the "use_case_consent_description" field.
Additional Information
To prevent this issue before submitting your form, you can paste your text into a free online "String Byte Length Calculator" or use a code editor (like Notepad++ or Visual Studio Code with hidden characters enabled) to see exactly how much byte space your text requires.