SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Fix Amplitude 400 Bad Request Invalid ID Length Error

Issue

When sending events to Amplitude via Segment, you may encounter a 400 Bad Request error with the message: "Invalid id length for user_id or device_id". This error occurs when the user_id or device_id in the event payload is shorter than the minimum length required by Amplitude. You may see this error in the Segment Console’s Delivery Overview for your Amplitude destination.

 

Product

Twilio Segment

 

Environment

Segment Console

 

Cause

Amplitude enforces a strict validation rule that requires all user_id and device_id values to be at least 5 characters long. If an event is sent with a user_id or device_id shorter than this minimum, Amplitude will reject the event and return a 400 Bad Request error.

 

Resolution

To resolve this issue and allow shorter user_id or device_id values to be accepted by Amplitude, follow these steps:
  1. In the Segment Console, navigate to Connections > Destinations and select your Amplitude (Actions) destination.
  2. Open your active Mappings (for example, Log Event V2).
  3. Locate the Minimum ID Length settings field.
  4. Override the default value to match the shortest user_id or device_id you intend to send.
  5. Save your changes.
This update will inject a min_id_length exception flag into the outgoing payload, instructing Amplitude to accept user IDs shorter than the default minimum.
 

Additional Information 

For more details, see the Amplitude Actions Destination Documentation.

 

Have more questions? Submit a request
Powered by Zendesk