- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Read-only Properties on API
SOLVEOct 8, 2019 6:21 PM
Hi,
I'd like to ask if there's a workaround on adding/updating option values of read-only definition properties (e.g., Lead Status, Lifecylce Stage). It can be done on hubspot UI, but using the API calls from the docs gives errors on read-only definition. Could it be done? We're trying to intergrate using the API after the client connects to the app.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Oct 9, 2019 1:03 PM
Hi @avyer,
I did a search on the Community here for that error message and I found this thread: https://community.hubspot.com/t5/APIs-Integrations/Can-t-update-options-for-field-with-quot-optionsA..., where the poster was able to update the enumeration options by making a PATCH request instead of a PUT request. I'll see if I can get an update to our documentation for that, since I'm not actually seeing it documented. But in the meantime, you can try doing your updates that way. I believe you need to send all options in the request, as opposed to just the new option.
So for example you'd make a PATCH request to /properties/v1/contacts/properties/named/hs_lead_status, and then you could pass in a body of something like:
{ "options": [ { "label": "New", "displayOrder": 0, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "NEW" }, { "label": "Open", "displayOrder": 1, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "OPEN" }, { "label": "In Progress", "displayOrder": 2, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "IN_PROGRESS" }, { "label": "Open Deal", "displayOrder": 2, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "OPEN_DEAL" }, { "label": "Unqualified", "displayOrder": 3, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "UNQUALIFIED" }, { "label": "Attempted to Contact", "displayOrder": 4, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "ATTEMPTED_TO_CONTACT" }, { "label": "Connected", "displayOrder": 5, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "CONNECTED" }, { "label": "Bad Timing", "displayOrder": 6, "hidden": false, "readOnly": null, "doubleData": null, "description": null, "value": "BAD_TIMING" }, { "label": "A new status option", "displayOrder": 7, "hidden": false, "readOnly": false, "doubleData": null, "description": null, "value": "A_NEW_STATUS_OPTION" } ] }
I hope that helps.
Leland ScanlanHubSpot Developer Support |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content