# Can't delete a customer object

**URL:** <https://community.hubspot.com/t/cant-delete-a-customer-object/33851>\
**Category:** APIs & Integrations\
**Tags:** cms-content, companies, professional, contacts\
**Created:** [March 15, 2021, 1:07am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851 "2021-03-15T01:07:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![JZhao](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzhao/32/98997_2.png) [@JZhao](https://community.hubspot.com/u/JZhao)\
**Post date:** [March 15, 2021, 1:07am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/1 "2021-03-15T01:07:22Z")

</div>

What is the process to delete a customer object completely? I created a customer object and delete it by calling two APIs:

DELETE /crm/v3/schemas/{objectType}

DELETE /crm/v3/schemas/{objectType}/purge

both API returns successfully. However, I got “already existing” error when I try to re-create the object with the same name:

{

“status”: “error”,

“message”: “p8013920\_device already exists”,

“correlationId”: “7a19ce21-0e8b-4cee-8076-f7fa9bc4b0da”,

“context”: {

“name”: [

“p8013920\_device”

]

},

“category”: “OBJECT\_ALREADY\_EXISTS”,

“subCategory”: “InboundDbObjectTypeError.OBJECT\_TYPE\_ALREADY\_EXIST”

}

It keeps telling me the object already exists. How can I re-create the same object after deleting?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [March 15, 2021, 7:46am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/2 "2021-03-15T07:46:50Z")

</div>

Hi @JZhao,

Are you deleting the objects first before making the delete request?

Before deleting the schema, any existing records of this schema must be deleted first otherwise, this call will fail.

If it’s a success then please make sure after fetching the schema again, check if it includes the deleted one or not.

Regards,

---

<div class="post-metadata">

**Author:** ![JZhao](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzhao/32/98997_2.png) [@JZhao](https://community.hubspot.com/u/JZhao)\
**Post date:** [March 16, 2021, 9:15am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/3 "2021-03-16T09:15:47Z")

</div>

I already deleted all objects for the secheme. I am able to query sechema with archive=true which means they are not deleted completely. I have tried to delete and purge them as I mentioned above but none of them works. How can I delete them?

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [March 17, 2021, 11:34am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/4 "2021-03-17T11:34:31Z")

</div>

Thank you for the clarification @JZhao.

I tested the same and haven’t found any API to delete it completely.

What I’ll suggest here is - if you want to re-use the schema, instead of recreating it let’s update it.

But if we need the deleted endpoint, I hope someone from the HubSpot development team can answer it.

Regards,

---

<div class="post-metadata">

**Author:** ![JZhao](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzhao/32/98997_2.png) [@JZhao](https://community.hubspot.com/u/JZhao)\
**Post date:** [March 17, 2021, 12:08pm UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/5 "2021-03-17T12:08:19Z")

</div>

Thanks @himanshurauthan , thanks for testing it. Do you know who can help on that?

---

<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 17, 2021, 4:12pm UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/6 "2021-03-17T16:12:15Z")

</div>

Hi @JZhao

Make sure that there are no records exist within the the Custom Object before using the DELETE /crm/v3/schemas/{objectType}

---

<div class="post-metadata">

**Author:** ![JZhao](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzhao/32/98997_2.png) [@JZhao](https://community.hubspot.com/u/JZhao)\
**Post date:** [March 17, 2021, 9:20pm UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/7 "2021-03-17T21:20:09Z")

</div>

As I already mentioned in the question, the two API are run successfully

DELETE /crm/v3/schemas/{objectType}

DELETE /crm/v3/schemas/{objectType}/purge

that means no records exist otherwise these API will fail.

The question is how to recreate the object with the same name. It doesn’t allow me to create the customer object with the same name and the error is object already exists. How can I delete the customer object completely?

---

<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:** [April 11, 2023, 10:59pm UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/8 "2023-04-11T22:59:34Z")

</div>

See this link for [how to delete a custom object schema completely](https://community.hubspot.com/t5/APIs-Integrations/Delete-Custom-Object-Error/m-p/422651/highlight/true#M41970).

---

<div class="post-metadata">

**Author:** ![rOsborn123](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rosborn123/32/9140_2.png) [@rOsborn123](https://community.hubspot.com/u/rOsborn123)\
**Post date:** [March 26, 2021, 12:39am UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/9 "2021-03-26T00:39:24Z")

</div>

Hit this endpoint:  
DELETE /crm/v3/schemas/{objectType}?archived=true  
after hitting

DELETE /crm/v3/schemas/{objectType}  
Then you’ll be able to create a new custom object with the same name. It’s in the docs and I’ve done it many times before

---

<div class="post-metadata">

**Author:** ![JZhao](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jzhao/32/98997_2.png) [@JZhao](https://community.hubspot.com/u/JZhao)\
**Post date:** [March 29, 2021, 6:57pm UTC](https://community.hubspot.com/t/cant-delete-a-customer-object/33851/10 "2021-03-29T18:57:50Z")

</div>

I already did DELETE /crm/v3/schemas/{objectType}?archived=true but it shows it doesn’t exist error.
