We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Dec 8, 2021 12:51 PM
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) don't show my custom object (API after new POST say "already exists")
Please help me.
Solved! Go to Solution.
Dec 10, 2021 3:52 AM
@webdew I already use this API. Please read my first message.
I have quite a good solution.
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!
Dec 9, 2021 9:31 AM
Hi @barteksonarhome ,
Please use this test api's for custom objects:
https://developers.hubspot.com/docs/api/crm/crm-custom-objects
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.
Dec 10, 2021 3:52 AM
@webdew I already use this API. Please read my first message.
I have quite a good solution.
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!
Dec 8, 2021 5:53 PM - edited Dec 10, 2021 5:44 AM
@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?
Dec 8, 2021 3:34 PM
@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