Skip to content
HubSpot Developer Changelog

Breaking Change: Enhanced Validations for Non-String Properties in HubSpot's CRMObject APIs

Starting April 7th, 2025, HubSpot will implement enhanced validations for non-string property values, including enumeration and multi-value enumeration property values submitted via the CRMObject APIs. This change aims to improve data integrity and user experience by prohibiting leading or trailing whitespace characters, including invisible unicode characters, from these property values. Additionally, 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'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 a VALIDATION_ERROR category, providing details on the validation issues encountered.

Error Message Example:

{ "status": "error", "message": "Property values were not valid: [{\"isValid\":false,\"message\":\"\"{{input_value}}\" includes leading or trailing whitespace.\",\"error\":\"LEADING_TRAILING_WHITESPACE\",\"name\":\"property_name\"}]", "correlationId": "{{sample_correlation_id}}", "category": "VALIDATION_ERROR" }

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 an 400 Bad Request error with a VALIDATION_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 now trigger a 400 Bad Request error, with the response indicating a VALIDATION_ERROR.
Important Note: the original release date for this change was initially scheduled for January 6th, 2025, but to better accommodate our customers, we are extending the release date to April 7th, 2025.

If you have questions or comments, join us in the developer forums.