Reminder: Breaking Change for Enhanced Validations for Non-String Properties in HubSpot's CRMObject APIs
Days until the change takes effect: 60 days
Starting April 7th, 2025, HubSpot will introduce enhanced validation rules for non-string property values, including enumeration and multi-value enumeration submitted via the CRMObject APIs. This change aims to improve data integrity and user experience by:
- Prohibiting any leading or trailing whitespace characters, including invisible unicode characters, from the property values.
- Backfilling existing non-string property values and enumeration options to remove any whitespace or invisible characters from the beginning or end of all property values.
What's changing?
Stricter Validation for Non-String Properties
- Current Behavior: Enumeration values and other non-string properties that include leading or trailing whitespace characters, including invisible unicode characters (e.g., no-break spaces), are accepted and may lead to data inconsistencies or reporting issues.
- New Behavior: Non-string property values, including enumeration options and multi-value enumeration properties, must not contain leading or trailing whitespace or invisible unicode characters. Values with these characters will result in a
400
Bad Request error with aVALIDATION_ERROR
category, providing details on the validation issues encountered.
Error Message Example:
Backfilling of Existing Non-String Properties
- All existing non-string property values and enumeration options will be backfilled to remove any whitespace or invisible characters from the beginning or end of all property values.
What does this mean for developers?
Ensure all data submissions via the CRMObject APIs for non-string properties, including enumeration options and multi-value enumeration properties, strictly adhere to the new validation rule. Developers should review and update any integrations, scripts, or automated processes that submit non-string property values to HubSpot to ensure compliance with the new validation rules.
Lastly, error-handling routines should be implemented or updated to manage responses from the CRMObject APIs that indicate invalid non-string property values due to the enhanced validations.
For example:
- Before the Change for Enumeration Options: If the valid enumeration options are ["one", "two", "three"], submitting a value like " two" (with leading space) or "two " (with trailing space) would be accepted.
- After the Change for Enumeration Options: Submitting " two" or "two " as an enumeration value will result in a
400
Bad Request error with aVALIDATION_ERROR
response because it contains leading or trailing whitespace or invisible characters. - Before the Change for Non-String Property Values: Submitting a property value like ‘“ 7”’ (a string with a leading space before the digit) would have been accepted.
- After the Change for Non-String Property Values: Submitting a value like ‘“ 7”’ or ‘“7 “‘ for a number property will trigger a
400
Bad Request error, with the response indicating aVALIDATION_ERROR
.
Note: The initial announcement for this change was made on June 6, 2024, and the release was scheduled for January 6, 2025. However, it was extended to April 7, 2025, to accommodate customers, providing 10 months' notice till the change is released.
Questions or comments? Join us in the developer forums for a peer-to-peer discussion.