Delete association label

I am attempting to delete an association label between companies and a custom entity.

From Postman, the following works successfully:

POST https://api.hubapi.com/crm/v4/associations/2-122116974/0-2/batch/labels/archive

{
 "inputs": [
 {
 "types": [
 {
 "associationCategory": "USER_DEFINED",
 "associationTypeId": 81
 }
 ],
 "from": {
 "id": "3123974637"
 },
 "to": {
 "id": "6003640801"
 }
 }
 ]
}

When I attemp to do this in NodeJS, I get a response of 204, but the code does not seem to have an effect:

const hubspot = require('@hubspot/api-client');

const hubspotClient = new hubspot.Client({"accessToken":"YOUR_ACCESS_TOKEN"});

const BatchInputPublicAssociationMultiPost = { inputs: [{"types":[{"associationCategory":"HUBSPOT_DEFINED","associationTypeId":81}],"_from":{"id":"3123974637"},"to":{"id":"6003640801"}}] };
const fromObjectType = "2-122116974";
const toObjectType = "0-2";

try {
 const apiResponse = await hubspotClient.crm.associations.v4.batchApi.archiveLabels(fromObjectType, toObjectType, BatchInputPublicAssociationMultiPost);
 console.log(JSON.stringify(apiResponse, null, 2));
} catch (e) {
 e.message === 'HTTP request failed'
 ? console.error(JSON.stringify(e.response, null, 2))
 : console.error(e)
}

@ChristoV - forgive me if I’m reading anything wrongly here, but in the Postman example the association ID is USER_DEFINED - as you might expect, but in the JS its HUBSPOT_DEFINED.

Hope this is helpful.

Steve

Hi Steve,

Well spotted! Thank you. I completely missed this.