# Delete custom type

**URL:** <https://community.hubspot.com/t/delete-custom-type/64887>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [September 12, 2022, 12:11pm UTC](https://community.hubspot.com/t/delete-custom-type/64887 "2022-09-12T12:11:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barteksonarhome](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@barteksonarhome](https://community.hubspot.com/u/barteksonarhome)\
**Post date:** [September 12, 2022, 12:11pm UTC](https://community.hubspot.com/t/delete-custom-type/64887/1 "2022-09-12T12:11:29Z")

</div>

Hi. I created a custom object and I would like to delete this type.  
What I do:  
1. I delete all objects from this type, from"archive" too.  
2. I use:  
**DELETE**** /crm/v3/schemas/pXYZ\_name\_of\_type**  
**DELETE /crm/v3/schemas/2-5555555**  
**DELETE /crm/v3/schemas/pXYZ\_name\_of\_type + { archived: true }**  
**DELETE /crm/v3/schemas/2-5555555 + { archived: true }**  
response:

`Hubspot::Api::Error: {"status":"error","message":"Object type 2-5555555 is currently used in 3 places and cannot be deleted","correlationId":"XYZ","context":{"objectTypeId":["2-5555555"],"usageCount":["3"]},"category":"VALIDATION_ERROR","subCategory":"InboundDbObjectTypeError.CANNOT_DELETE_OBJECT_TYPE_IN_USE"}`

**DELETE /crm/v3/schemas/pXYZ\_name\_of\_type/purge**  
**DELETE /crm/v3/schemas/2-5555555/purge**  
response:

`Hubspot::Api::Error: {"status":"error","message":"Couldn't find soft deleted object type(s) for: ObjectTypeId{metaTypeId=2, innerId=5555555}","correlationId":"XYZ","category":"VALIDATION_ERROR"}`

After this [Accounts Dashboard | HubSpot](https://legacydocs.hubspot.com/docs/methods/crm-extensions/delete-object-type)  
response:

`Hubspot::Api::Error: {"status":"error","message":"This hapikey (XXXXXXX) does not have proper permissions! (requires all of [developers-write])","correlationId":"XYZ"}`

**GET /crm/v3/schemas/pXYZ\_name\_of\_type**  
**GET /crm/v3/schemas/2-5555555**

response

`{"results":[]}`

**GET /crm/v3/schemas/pXYZ\_name\_of\_type + { archived: true }**  
**GET /crm/v3/schemas/2-5555555 + { archived: true }**

response

`{\"status\":\"error\",\"message\":\"Paging through deleted objects is not yet supported for object type 2-555555 (property_search)\",\"correlationId\":\"XXXXXXX\",\"category\":\"VALIDATION_ERROR\"}`

How to delete custom type? How to find places where object type is still used?

---

<div class="post-metadata">

**Author:** ![LeeBartelme](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/leebartelme/32/95647_2.png) [@LeeBartelme](https://community.hubspot.com/u/LeeBartelme)\
**Post date:** [September 12, 2022, 2:45pm UTC](https://community.hubspot.com/t/delete-custom-type/64887/2 "2022-09-12T14:45:11Z")

</div>

In HubSpot you need to delete all the records for the custom object. After that, I would go into the properties for the custom object (the place where you can add new properties) and look at the used in column. Clicking on those numbers will show you where those properties are used in HubSpot. After you remove the references from those locations, you should be able to delete the schema.

---

<div class="post-metadata">

**Author:** ![barteksonarhome](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@barteksonarhome](https://community.hubspot.com/u/barteksonarhome)\
**Post date:** [September 13, 2022, 7:04am UTC](https://community.hubspot.com/t/delete-custom-type/64887/3 "2022-09-13T07:04:37Z")

</div>

Thanks for your answer! It’s still hard to find something when the custom type has a hundred properties, but is better than nothing. In my case, I have workflow connected with a custom object. It would be much easier if the API informed us about it.
