Users can enable the “Validate phone numbers for this property” option on any property of field type “Phone number” (see screenshot).
When it’s enabled, HubSpot rejects numbers that contain inner spaces (e.g. +974 1111111) with the error “Number must match format ‘+18884827768’ or ‘+18884827768 ext 123’”.
I’d like to replicate this validation on our end so we don’t spam the HubSpot API with requests that are going to fail anyway.
The problem: we can’t tell whether this option is enabled through the API. The property schema doesn’t expose the flag.
Request:
GET https://api.hubapi.com/crm/v3/schemas/0-1
Response (the phone property):
........
{
"updatedAt": "2024-09-12T14:21:53.426Z",
"createdAt": "2019-08-06T02:41:08.269Z",
"name": "phone",
"label": "Phone Number",
"type": "string",
"fieldType": "phonenumber",
"description": "A contact's primary phone number",
"groupName": "contactinformation",
"options": [],
"displayOrder": 4,
"calculated": false,
"externalOptions": false,
"hasUniqueValue": false,
"hidden": false,
"hubspotDefined": true,
"modificationMetadata": {
"archivable": true,
"readOnlyDefinition": true,
"readOnlyValue": false
},
"formField": true,
"textDisplayHint": "phone_number",
"dataSensitivity": "non_sensitive"
}
fieldType is "phonenumber", but there is no field that tells us whether “Validate phone numbers for this property” is turned on or off.
