Hi @JZhao
You can only delete a custom object after all object instances of that type are deleted. To delete a custom object, use:
DELETE https://api.hubapi.com/crm/v3/schemas/{objectType}. If you need to create a new custom object with the same name as the deleted object, you must hard delete the schema by DELETE https://api.hubapi.com/crm/v3/schemas/{objectType}?archived=true
There are two endpoints:
DELETE /crm/v3/schemas/{objectType}/purge
DELETE /crm/v3/schemas/{objectType}
I used the NodeJS library of Hubspot and there I have to use to different functions:
hubspotClient.crm.schemas.coreApi.archive(fullyQualifiedName) where fullyQualifiedName = p99688696_car in the Cars Examle in the documentation
hubspotClient.crm.schemas.defaultApi.purge(objectTypeId) where objectTypeId = 2-529881 in the Cars Examle in the documentation;
Greets Ronald