# Adding properties to an existing custom object via the API

**URL:** <https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [March 18, 2021, 7:39pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134 "2021-03-18T19:39:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarh33l](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tarh33l/32/39562_2.png) [@tarh33l](https://community.hubspot.com/u/tarh33l)\
**Post date:** [March 18, 2021, 7:39pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134/1 "2021-03-18T19:39:12Z")

</div>

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:

```lia-code-sample
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

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 19, 2021, 7:44pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134/2 "2021-03-19T19:44:42Z")

</div>

Hi @tarh33l

Check out the [properties api](https://developers.hubspot.com/docs/api/crm/properties) which you would use for all objects

---

<div class="post-metadata">

**Author:** ![tarh33l](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tarh33l/32/39562_2.png) [@tarh33l](https://community.hubspot.com/u/tarh33l)\
**Post date:** [March 22, 2021, 3:13pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134/3 "2021-03-22T15:13:37Z")

</div>

Well, that was pretty bone-headed on my part :(. Thanks for pointing me in the right direction.

On a related note - it appears that we can only refer to the custom object in API calls (like the properties endpoints) using the “fullyQualifiedName” on the custom object, as opposed to the name we originally used when we defined the object.

So, for example, if the name we pass in the POST for “/crm/v3/schemas” is “my\_custom\_object”, the resulting fullyQualifiedName will be something like “p12345\_my\_custom\_object”. This really isn’t ideal since the calls we’re making to create the properties on said custom object don’t know the fully qualified name.

Is there a way to add properties to the object using the original name of the custom object instead of the fully qualified name?

Thanks.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 22, 2021, 8:54pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134/4 "2021-03-22T20:54:50Z")

</div>

Hey @tarh33l

You are going to have to stick with FQN or you can also use the objectTypeId. I prefer the object type as it is visible in the url when in the HubSpot app UI.

eg: [https://app.hubspot.com/contacts/:portalid/objects/\*\*:objectTypeId\*\*/views/all/list](https://app.hubspot.com/contacts/:portalid/objects/ **:objectTypeId** /views/all/list).

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [March 22, 2021, 8:56pm UTC](https://community.hubspot.com/t/adding-properties-to-an-existing-custom-object-via-the-api/34134/5 "2021-03-22T20:56:52Z")

</div>

PS, I don’t think it was a bone headed move. 🙃
