APIs & Integrations

JMelichar
Member

Unable to delete Custom Object

Hi, 

 

Im trying to delete a custom object via an API call. 

 

Im sending a DELETE request to https://api.hubapi.com/crm/v3/schemas/2-120**** 

 

and I'm geting a 400 response:

 

{
"status": "error",
"message": "Cannot delete association definition 41. It still has 1 OBJECT_REQUIREMENT usages. Example usages: [OBJECT_REQUIREMENT: 2-124****/8920****].",
"correlationId": "8ae1e821-040b-43e9-9a73-59ee2db180c5",
"category": "VALIDATION_ERROR"
}
 

We have deleted all records of the custom object that we are trying to delete (2-120**** ). The error message seems to indicate that there is an association to another custom object record (2-124****/8920****), but this record doesn't seem to exist.

 

I have also tried to delete the association via an API call, but there Im geting the same error:

 

{
"status": "error",
"message": "Cannot delete association definition 41. It still has 1 OBJECT_REQUIREMENT usages. Example usages: [OBJECT_REQUIREMENT: 2-124****/8920****].",
"correlationId": "074b4a54-adbb-412a-a783-f7dab7a303c8"
}

 

Can you please advise on how to proceed ?

 

Than you

0 Upvotes
3 Replies 3
JMelichar
Member

Unable to delete Custom Object

@LindaH Hi, given the error message that we are receiving is there anything that you would suggest we check? I would also be happy to provide any additional information in order to debug this problem.

0 Upvotes
lindahl
Contributor | Diamond Partner
Contributor | Diamond Partner

Unable to delete Custom Object

Hi there @JMelichar ,

 

It's a little bit hard to debug without seeing the portal and the record itself, but usually the common situation is that the object property was used in forms, you may also need to take a look at the associate records, sometimes HubSpot does archive or soft delete, not a complete deletion. Would that be ok for you to take a look again?

0 Upvotes
JMelichar
Member

Unable to delete Custom Object

Hi, 

 

We have checked the custom object again and could not find any associations.

 

Is there anything in particular that we should check next?

 

When I list association between the custom object we are trying to delete (2-120****) and the one mentioned in the error message (2-124****), I get the following: 

 

{
    "results": [
        {
            "category": "USER_DEFINED",
            "typeId": 42,
            "label": null
        }
    ]
}
 
The error message however mention association definition 41. Im not sure how that relates to the "typeId": 42 seen above.
0 Upvotes