APIs & Integrations

Roi_Divon
Member

Ignore unknown properties when updating contact

Is there a way for the API not to fail when sending an update contact request with “unknown” properties?
(So I won’t get “undefined: Property values were not valid” error)
For example, if I pass 3 props, and only 2 are listed, the contact will be updated with the 2 known props and the 3rd one will be ignored

1 Reply 1
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Ignore unknown properties when updating contact

Hi @Roi_Divon,

Which API are you using? If you’re sending requests using the Update a contact endpoint in the Contacts API, you should omit any properties that you don’t want to update from the properties array. For example, if you want to update a contact’s firstname and lastname properties, but not their email property, you would omit the email from the request:

{
  "properties": [
    {
      "property": "firstname",
      "value": "Test"
    },
    {
      "property": "lastname",
      "value": "Contact"
    }
  ]
}
0 Upvotes