Delete specific association with label not working

Hi,

I’m trying to delete an association between 2 objects but for a specific label. However it’s deleting all associations between the 2 objects.

I know that the association label is correct because I can create the association with that specific label.

I’m using the v3 endpoint, just like this example:

curl --request POST \
 --url https://api.hubapi.com/crm/v3/associations/fromObjectType/toObjectType/batch/archive \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "inputs": [
 {
 "from": {
 "id": "37295"
 },
 "to": {
 "id": "37295"
 },
 "type": "contact_to_company"
 }
 ]
}'

What is “funny” is that I’m using v3 for all my calls, but if I do a DELETE request to delete an association, it also works, but DELETE is not part of v3, but for v4. Anyway…

Hi @AndreMiranda,

The doc for Associations API says that the DELETE endpoint will remove all of the associations between the two records, so it’s not possible to pick individual association labels

The V3 endpoint for /batch/archive also implies that it will remove all of the associations.

Unfortunately this can’t be done with the current API endpoints. The only thing I could suggest is to leave feedback in the HubSpot developer form describing your use case:

Hi @evaldas ! Thanks for your answer.

But, if you look closely at the V3 example in the documentation for batch archive, you will see a “type” property being passed in the api request. It seems that internally HubSpot is completely ignoring that.

Anyway, I had to do some changes and I ended up using a V4 endpoint for what I need, there is a specific endpoint to delete an Association with a specific label and that worked just fine.