# How to delete property

**URL:** <https://community.hubspot.com/t/how-to-delete-property/72663>\
**Category:** APIs & Integrations\
**Created:** [January 11, 2023, 1:34pm UTC](https://community.hubspot.com/t/how-to-delete-property/72663 "2023-01-11T13:34:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExpliuM](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ExpliuM](https://community.hubspot.com/u/ExpliuM)\
**Post date:** [January 11, 2023, 1:34pm UTC](https://community.hubspot.com/t/how-to-delete-property/72663/1 "2023-01-11T13:34:44Z")

</div>

I’m doing the following thing,  
Im using ‘@hubspot/api-client’

I’m creating a schema with 3 properties (let’s call them prop1/2/3).  
after a while, I need to delete one of the props, lets say prop3.  
while trying to archive it by the use of `.crm.properties.coreApi.archive`  
and I’m getting the following error:  
```

“message”:“Property: prop2\_9ixvlsia of object type 2-11327296 is currently used in 1 places and cannot be deleted”,“correlationId”:“234b23af-d50e-44bb-b1ba-92f8f6bcfdc8”,“errors”:[{“subCategory”:“PropertyValidationError.PROPERTY\_USAGE”,“message”:“Property prop2\_9ixvlsia of object type 2-11327296 in use by OBJECT\_REQUIREMENT (display type OBJECT\_REQUIREMENT) ID 2-11327296/150701085: [Object Manager Settings](https://app.hubspot.com/object-manager-settings/23362975/creator-editor/2-11327296)”

```

what am I doing wrong here?  
I already realized that its because my schema is still configured to use it, but I don’t know how to change my schema props list…any hint about how to do that?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [January 11, 2023, 7:05pm UTC](https://community.hubspot.com/t/how-to-delete-property/72663/2 "2023-01-11T19:05:53Z")

</div>

Hey, @ExpliuM 👋 I haven’t tested this yet, but have you tried updating your schema by making a [PATCH request](https://developers.hubspot.com/docs/api/crm/crm-custom-objects#update-existing-custom-objects) to — [https://api.hubapi.com/crm/v3/schemas/\*{objectTypeId}?](https://api.hubapi.com/crm/v3/schemas/*%7BobjectTypeId%7D?)\* I am curious if we send a request with Prop 1 and Prop 2 set as required but don’t include Prop3 in the Required group, if it removes the “required” flag it and resolves the error.

I’ll try a test using Postman and post back here as well.

Talk soon! — Jaycee

---

<div class="post-metadata">

**Author:** ![ExpliuM](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ExpliuM](https://community.hubspot.com/u/ExpliuM)\
**Post date:** [January 12, 2023, 7:17am UTC](https://community.hubspot.com/t/how-to-delete-property/72663/3 "2023-01-12T07:17:43Z")

</div>

Well, I’m afraid that’s not the solution because `ObjectTypeDefinitionPatch` gets only labels, requiredProperties, searchableProperties, primaryDisplayProperty, secondaryDisplayProperties and restorable.

I noticed that the response sends me to a page where I can change the schema  
[https://app.hubspot.com/object-manager-settings/23362975/creator-editor/2-11327296](https://app.hubspot.com/object-manager-settings/23362975/creator-editor/2-11327296%22)  
after updating the schema via this link I do manage to archive the required property  
but I’m interested in doing this same action via the API, any ideas?

adding here, ObjectTypeDefinitionPatch definition:  
```

export declare class ObjectTypeDefinitionPatch {

‘labels’?: ObjectTypeDefinitionLabels;

‘requiredProperties’?: Array\<string\>;

‘searchableProperties’?: Array\<string\>;

‘primaryDisplayProperty’?: string;

‘secondaryDisplayProperties’?: Array\<string\>;

‘restorable’?: boolean;

```  
and a Use example:  
```

hubspot.Client({“accessToken”:“YOUR\_ACCESS\_TOKEN”});

const labels = {  
“singular”: “My object”,  
“plural”: “My objects”  
};  
const ObjectTypeDefinitionPatch = { labels, requiredProperties: [“my\_object\_property”], searchableProperties: [“my\_object\_property”], primaryDisplayProperty: “my\_object\_property” };  
const objectType = “objectType”;  
const apiResponse = await hubspotClient.crm.schemas.coreApi.update(objectType, ObjectTypeDefinitionPatch);  
console.log(JSON.stringify(apiResponse.body, null, 2));  
```

---

<div class="post-metadata">

**Author:** ![ExpliuM](https://avatars.discourse-cdn.com/v4/letter/e/e56c9b/32.png) [@ExpliuM](https://community.hubspot.com/u/ExpliuM)\
**Post date:** [January 12, 2023, 9:04am UTC](https://community.hubspot.com/t/how-to-delete-property/72663/4 "2023-01-12T09:04:40Z")

</div>

Found the solution, I should update the property not to be form field (formField=false) before I try to archive it.

---

<div class="post-metadata">

**Author:** ![mathew\_murphy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mathew_murphy/32/73754_2.png) [@mathew\_murphy](https://community.hubspot.com/u/mathew_murphy)\
**Post date:** [July 18, 2023, 2:41pm UTC](https://community.hubspot.com/t/how-to-delete-property/72663/5 "2023-07-18T14:41:05Z")

</div>

Does this still work for you?

I’ve set a property to have formField = false and I still get told it’s on a form so I can’t remove it.

The form seems to be one that’s automatically created for any custom object schema, and it doesn’t show up if I fetch a list of forms via the API, so I’m stuck with how to delete a property via API.

---

<div class="post-metadata">

**Author:** ![mathew\_murphy](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mathew_murphy/32/73754_2.png) [@mathew\_murphy](https://community.hubspot.com/u/mathew_murphy)\
**Post date:** [July 19, 2023, 2:46pm UTC](https://community.hubspot.com/t/how-to-delete-property/72663/6 "2023-07-19T14:46:31Z")

</div>

HubSpot support tell me there’s no way to do it any more, so [I started a discussion thread in ideas](https://community.hubspot.com/t5/HubSpot-Ideas/Need-a-way-to-delete-properties-from-custom-object-schemas-via/idi-p/822093/highlight/true).
