# Create custom\_object doesn't work

**URL:** <https://community.hubspot.com/t/create-custom-object-doesnt-work/48209>\
**Category:** APIs & Integrations\
**Tags:** cms-content, professional\
**Created:** [December 8, 2021, 5:51pm UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209 "2021-12-08T17:51:51Z")\
**Posts on this page:** 5\
**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:** [December 8, 2021, 5:51pm UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209/1 "2021-12-08T17:51:51Z")

</div>

Hi. I have created a custom object by “post /crm/v3/schemas”. I have deleted it by “delete /crm/v3/schemas/object\_id”. When I “get /crm/v3/schemas” I don’t get this new custom object. But when I try again “post /crm/v3/schemas” a get **“category”:“OBJECT\_ALREADY\_EXISTS”,“subCategory”:“InboundDbObjectTypeError.OBJECT\_TYPE\_ALREADY\_EXIST”**  
I deleted custom object with  
1. delete /crm/v3/schemas/object\_id  
2. delete /crm/v3/schemas/object\_id/purge  
3. delete /crm/v3/schemas/object\_id?archived=true  
4. delete /crm/v3/schemas/object\_id/purge?archived=true  
Frontend settings → objects → custom objects ([https://app.hubspot.com/sales-products-settings/XXXXX/object/YYYY](https://app.hubspot.com/sales-products-settings/XXXXX/object/YYYY)) don’t show my custom object (API after new POST say “already exists”)  
Please help me.

---

<div class="post-metadata">

**Author:** ![KyleParker](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@KyleParker](https://community.hubspot.com/u/KyleParker)\
**Post date:** [December 8, 2021, 8:34pm UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209/2 "2021-12-08T20:34:38Z")

</div>

@barteksonarhome are you using the object id formatted with the dash (e.g. 2-xxx)?

I encountered a similar issue when using call #1, but as soon as I used #3, I was able to recreate a new custom object using the same name.

DELETE [https://api.hubspot.com/crm/v3/schemas/2-xxx?archived=true](https://api.hubspot.com/crm/v3/schemas/2-xxx?archived=true)

---

<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:** [December 8, 2021, 10:53pm UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209/3 "2021-12-08T22:53:29Z")

</div>

@KyleParkerUnfortunately I use object id formatted p{accout\_id}object\_name.

Ok, I tried multiple times to delete schema by p-start id and 2-start id. Now object successfully deleted.

But still, I don’t know how to  
1. Create custom\_object type Foo  
2. Delete custom\_object type Foo  
3. Create the same custom\_object type Foo

Anybody knows how to do it?

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [December 9, 2021, 2:31pm UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209/4 "2021-12-09T14:31:38Z")

</div>

Hi @barteksonarhome ,  
Please use this test api’s for custom objects:

[https://developers.hubspot.com/docs/api/crm/crm-custom-objects  
 ](https://developers.hubspot.com/docs/api/crm/crm-custom-objects)

 ![webdew_0-1639060126669.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/0/0152130dffa61e6c776b97dbf15ae3e1723b5a85.png)

 ![webdew_2-1639060281744.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/b/9bfdd97e1b2f04b0d4665baf569e186ac80ac3b0.png)

Hope this helps!  
If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<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:** [December 10, 2021, 8:52am UTC](https://community.hubspot.com/t/create-custom-object-doesnt-work/48209/5 "2021-12-10T08:52:52Z")

</div>

[@webdew](https://community.hubspot.com/t5/user/viewprofilepage/user-id/131510) I already use this API. Please read my first message.  
I have quite a good solution.

```lia-code-sample
for 1..100 do
 post /crm/v3/schemas { FOO } -> FOO id = 2-111111
 delete /crm/v3/schemas/2-111111
 delete /crm/v3/schemas/2-111111?archived=true
 delete /crm/v3/schemas/2-111111/purge
 post /crm/v3/schemas { FOO } -> FOO id = 2-222222
 result = get /crm/v3/schemas
 if result includes FOO => success += 1
end

```

the success rate is around 60%. For HubSpot API is a pretty good result 🙂  
Thanks for all answers!
