Hello @MG2023
To update the reminder for an engagement/task in HubSpot using the updated API endpoint, you can use the “Engagements API” which allows you to update an engagement/task by its ID.
Here is an example code snippet on how to update an engagement/task’s reminder from “No Reminder” to “1 day before”
const engagementId = "ENGAGEMENT_ID_HERE";
const updateData = {
engagements: [
{
id: engagementId,
metadata: {
taskReminder: {
type: "OFFSET",
offset: {
amount: 1,
unit: "DAY",
},
},
},
},
],
};
const options = {
method: "PATCH",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${YOUR_ACCESS_TOKEN}`,
},
body: JSON.stringify(updateData),
};
fetch(`https://api.hubapi.com/engagements/v1/engagements/modify`, options)
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.log(error));
Replace “ENGAGEMENT_ID_HERE” with the actual ID of the engagement/task you want to update, and replace “YOUR_ACCESS_TOKEN” with your actual HubSpot API access token.
This code sends a PATCH request to the “Engagements API” endpoint with the ID of the engagement/task you want to update, and the metadata object that specifies the taskReminder as an offset of 1 day before the due date. This will update the task’s reminder to 1 day before the due date.