Can't detect HubSpot phone validation setting via API

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.


Hi @Sachavskyi and thanks for reaching out to the HubSpot Community!

The schema/property endpoints don’t currently expose the “Validate phone numbers for this property” toggle, but there is a separate Property Validations API that lets you retrieve and set validation rules for a property.

You can find more details in these resources:

I’d love to hear from our Top Experts: Hi @Anton, @Mike_Eastwood and @zach_threadint do you have suggestions to help @Sachavskyi, please?

Have a great day and thanks so much for your help!
Bérangère

This post was created with the assistance of AI tools

Hey @Berangere ! Thanks for your response.
Yes, the Property Validations API looks like what I need. However, it would be great to have these validation rules included directly in the /crm/v3/schemas/0-1 and /crm/v3/properties/0-1 responses.

Hi @Sachavskyi, I’m glad it helped! :orange_heart:

Regarding the feedback, I’d suggest sharing it via our HubSpot Developer Feedback Form that way, the right team can have their eyes on it too!

Thanks so much for sharing this, we appreciate your valuable feedback!

Bérangère

Hi @Sachavskyi

To verify the property, you can use this property validation API. Here is the link to the doc: Property validations API - HubSpot docs

Thanks!