# Having an issue using the Delete specific labels api endpoint

**URL:** <https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [June 29, 2023, 11:24am UTC](https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372 "2023-06-29T11:24:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SNgantweni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@SNgantweni](https://community.hubspot.com/u/SNgantweni)\
**Post date:** [June 29, 2023, 11:24am UTC](https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372/1 "2023-06-29T11:24:44Z")

</div>

Hi, I’m having issues with the following api when testing on Postman:

`/crm/v4/associations/{fromObjectType}/{toObjectType}/batch/labels/archive`

So, I having issues with removing an association label from a custom created association. I’m using the apiRequest method to call the api.

```lia-code-sample
await hubSpotClient
 .apiRequest({
 method: 'POST',
 path: `/crm/v4/associations/${customObjectTypeId}/${contactObjectTypeId)}/batch/labels/archive`,
 headers: {
 accept: 'application/json',
 authorization: `Bearer ${auth}`,
 },
 body: {
 associationCategory: 'USER_DEFINED',
 associationTypeId: associationTypeId,
 fromObjectId: customObjectId,
 toObjectId: contactId,
 },
 })

```

The api call brings back a 204 response, but when I check on Hubspot the label hasn’t been removed. I also tried testing on Postman and got the same result. A 204 response and the label not being removed.

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [June 29, 2023, 1:38pm UTC](https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372/2 "2023-06-29T13:38:40Z")

</div>

Hi @SNgantweni

I hope this code can solve your query

await hubSpotClient.apiRequest({  
method: ‘POST’,  
path: `/crm/v4/associations/${customObjectTypeId}/${contactObjectTypeId}/batch/labels/archive`,  
headers: {  
accept: ‘application/json’,  
authorization: `Bearer ${auth}`,  
},  
body: {  
associationCategory: ‘USER\_DEFINED’,  
associationTypeId: associationTypeId,  
fromObjectId: customObjectId,  
toObjectId: contactId,  
},  
});

Hope this will helps you out. Please mark it as **Solution Accepted & Upvote** to help other Community member.  
Thanks!

---

<div class="post-metadata">

**Author:** ![SNgantweni](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@SNgantweni](https://community.hubspot.com/u/SNgantweni)\
**Post date:** [June 29, 2023, 1:57pm UTC](https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372/3 "2023-06-29T13:57:31Z")

</div>

Hi Gaurav, thank you for replying. Unfortunately I’m still getting the same issue.

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [June 29, 2023, 4:04pm UTC](https://community.hubspot.com/t/having-an-issue-using-the-delete-specific-labels-api-endpoint/84372/4 "2023-06-29T16:04:40Z")

</div>

Hi @SNgantweni

I think you should use the “PUT” method

for example

Example PUT URL:  
[https://api.hubapi.com/crm-associations/v1/associations/delete](https://api.hubapi.com/crm-associations/v1/associations/delete)

Example PUT JSON, removing the association from a contact with vid 25 to a ticket with ID 100:  
{  
“fromObjectId”: 25,  
“toObjectId”: 100,  
“category”: “HUBSPOT\_DEFINED”,  
“definitionId”: 15  
}

Returns a 204 No Content response on success.

Refer to the link below for more information

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Flegacy%2Fcrm-associations-v1%2Fget-crm-associations-v1-associations-objectIdHUBSPOTDEFINEDdefinition-id)**
