Hey there,
We’ve successfully created a custom object via the API. No problems there.
At some point, we decided we wanted to add one or more properties to this custom object and figured we’d use the PATCH endpoint to make this happen. Something along these lines:
curl --location --request PATCH 'https://api.hubapi.com/crm/v3/schemas/<custom object name>?hapikey=<API KEY>' \
--data-raw '{
"name": "<custom object name>",
"properties": [
{
"groupName": "",
"displayOrder": "-1",
"hasUniqueValue": "false",
"hidden": "false",
"name": "newly_created_property_via_patch",
"type": "string",
"fieldType": "text",
"label": "Property Created Via Patched",
"description": "Testing custom objects with patching",
"options": []
}
]
}'
When we execute the above, we get a 200 but the new property that we’ve included in the “properties” array isn’t actually added to the custom object.
So, what’s the correct way to do this via the API (without deleting the custom object and recreating with all of the properties)? We know we can add these properties through the HubSpot UI but that’s not really an option for what we’re trying to do.
Thanks.
- Terence