Aug 17, 2022 3:58 AM
I am trying to delete meetings with the API. I created a bunch of meetings with endpoint
/crm/v3/objects/meetings
and stored away the IDs. Now I need to delete them but I can't get any of the examples to work.
I also tried going to a company and clicking a meetings "Copy Link" to extract a sample id to delete.
'https://app-eu1.hubspot.com/contacts/11111/company/111111/?engagement=123456789'
const id = '123456789'
const response = await hubspot().apiRequest({
headers: {
'Accept': 'application/json',
},
path: `/crm/v3/objects/meetings/${id}`,
method: 'DELETE',
})
console.log(response) // 204 no content
Even though I get a successful response, the meeting is still there. My stored away ids does not seem to delete anything either. Maybe im confusing ids, is meetingId equivalent to a engagementId?
It also seems it does not care if the thing to be deleted is actually deleted; I can put a non existing id like
Please help me with tips how to delete my list of ids. I am assuming I am missing something.
Solved! Go to Solution.
Aug 17, 2022 10:56 AM
I finally solved it using axios
const response = await axios.post(
`https://api.hubapi.com/crm/v3/objects/meetings/batch/archive`,
JSON.stringify({inputs: [{id: '123456789'}]}),
{
headers: {
"accept": "application/json",
"content-type": "application/json",
"authorization": `Bearer ${env.HUBSPOT_PRIVATE_APP_TOKEN}`
},
}
)
Aug 17, 2022 10:56 AM
I finally solved it using axios
const response = await axios.post(
`https://api.hubapi.com/crm/v3/objects/meetings/batch/archive`,
JSON.stringify({inputs: [{id: '123456789'}]}),
{
headers: {
"accept": "application/json",
"content-type": "application/json",
"authorization": `Bearer ${env.HUBSPOT_PRIVATE_APP_TOKEN}`
},
}
)