Hi. I created a custom object and I would like to delete this type.
What I do: 1. I delete all objects from this type, from"archive" too. 2. I use: DELETE /crm/v3/schemas/pXYZ_name_of_type DELETE /crm/v3/schemas/2-5555555 DELETE /crm/v3/schemas/pXYZ_name_of_type + { archived: true } DELETE /crm/v3/schemas/2-5555555 + { archived: true } response:
Hubspot::Api::Error: {"status":"error","message":"Object type 2-5555555 is currently used in 3 places and cannot be deleted","correlationId":"XYZ","context":{"objectTypeId":["2-5555555"],"usageCount":["3"]},"category":"VALIDATION_ERROR","subCategory":"InboundDbObjectTypeError.CANNOT_DELETE_OBJECT_TYPE_IN_USE"}
Hubspot::Api::Error: {"status":"error","message":"This hapikey (XXXXXXX) does not have proper permissions! (requires all of [developers-write])","correlationId":"XYZ"}
GET /crm/v3/schemas/pXYZ_name_of_type GET /crm/v3/schemas/2-5555555
response
{"results":[]}
GET /crm/v3/schemas/pXYZ_name_of_type + { archived: true } GET /crm/v3/schemas/2-5555555 + { archived: true }
response
{\"status\":\"error\",\"message\":\"Paging through deleted objects is not yet supported for object type 2-555555 (property_search)\",\"correlationId\":\"XXXXXXX\",\"category\":\"VALIDATION_ERROR\"}
How to delete custom type? How to find places where object type is still used?
In HubSpot you need to delete all the records for the custom object. After that, I would go into the properties for the custom object (the place where you can add new properties) and look at the used in column. Clicking on those numbers will show you where those properties are used in HubSpot. After you remove the references from those locations, you should be able to delete the schema.
In HubSpot you need to delete all the records for the custom object. After that, I would go into the properties for the custom object (the place where you can add new properties) and look at the used in column. Clicking on those numbers will show you where those properties are used in HubSpot. After you remove the references from those locations, you should be able to delete the schema.
Sep 13, 20223:04 AM - edited Sep 13, 20223:04 AM
Contributor
Delete custom type
SOLVE
Thanks for your answer! It's still hard to find something when the custom type has a hundred properties, but is better than nothing. In my case, I have workflow connected with a custom object. It would be much easier if the API informed us about it.