APIs & Integrations

JZhao
参加者

Can't delete a customer object

解決

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?
1件の承認済みベストアンサー
rOsborn123
解決策
投稿者 | Elite Partner
投稿者 | Elite Partner

Can't delete a customer object

解決

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 

元の投稿で解決策を見る

9件の返信
rOsborn123
解決策
投稿者 | Elite Partner
投稿者 | Elite Partner

Can't delete a customer object

解決

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 

JZhao
参加者

Can't delete a customer object

解決

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

0 いいね!
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

Can't delete a customer object

解決

Hi @JZhao 

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

JZhao
参加者

Can't delete a customer object

解決

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?

0 いいね!
mathew_murphy
参加者

Can't delete a customer object

解決
0 いいね!
himanshurauthan
ソートリーダー | Elite Partner
ソートリーダー | Elite Partner

Can't delete a customer object

解決

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,

 

Digital Marketing & Inbound Expert In Growth Hacking Technology
JZhao
参加者

Can't delete a customer object

解決

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?

himanshurauthan
ソートリーダー | Elite Partner
ソートリーダー | Elite Partner

Can't delete a customer object

解決

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,

Digital Marketing & Inbound Expert In Growth Hacking Technology
0 いいね!
JZhao
参加者

Can't delete a customer object

解決

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