I’ve tried both vid and email and both at the same time without any luck trying as a query parameter and in the request body. I’m not sure what I’m doing wrong so any help is appreciated. Here’s how I’m doing it:
try {
response = HTTP.post("https://api.hubapi.com/contacts/v1/lists/" + membership['static-list-id'] + "/remove?vid=" + contactId + "&email=fake@test.com&hapikey=" + list.hubspot_key, {
headers: {
'content-type': 'application/json'
},
data: {
vid: contactId,
email: "fake@test.com"
}
});
} catch (err) {
throw new Error("Failed to unsubscribe contact from list with HubSpot. " + err.message);
}
Hi there, the format for the data payload should actually be a list of vids in a parameter called “vids” (you have that in there as the singular currently).