So, some property values on HubSpot are readonly because they are set by HubSpot automatically in some way.
Using the API, when I’m looking at a property, how can I reliably identify whether I can change the value or not?
At the moment I’m assuming anything that has a “calculated” value of “true” or where the description includes “automatically set by HubSpot” is readonly.
Is that the best approach?
@simon-fellsoft - have you tried using the properties API to discover the characteristics of a given object property? For example:
https://api.hubapi.com/crm/v3/properties/{objectType}/{propertyName}
I’ve always found this to be pretty comprehensive and useful.
Steve
Hey, @simon-fellsoft
The way I do it is to make a request to the Properties API for either a specific property or all properties for an Object and look for `modificationMetadata`
"modificationMetadata": {
"archivable": true,
"readOnlyDefinition": true,
"readOnlyValue": true
...
I hope this helps get you moving forward! — Jaycee
Great, that looks like what I was after - thanks.
Awesome! Thanks for letting us know that worked for you – Jaycee
Hi Jaycee,
Just noticed something that doesn’t seem to fit this pattern.
There is one HubSpot defined property - “hs_feedback_show_nps_web_survey” - where the value of modificationMetadata/readOnlyValue is ‘false’ (meaning an app should be able to set the value through the API) but where the description includes the explanation "This is automatically set by HubSpot). Is this an error?