Skip to content

Update webhook

Updates a webhook’s properties such as URL, topic, relation_id, or status.

HTTP method: POST

https://api.sender.net/v2/account/webhooks/{id}


ParameterTypeDescription
idstring requiredThe ID of the webhook you want to update.
topicstringThe new topic for the webhook. Must be one of the supported topics.
relation_idstringRequired if the selected topic is ‘groups/new-subscriber’ or ‘groups/unsubscribed’.
urlstringThe new webhook URL.
statusstringThe new status of the webhook. Can be ‘ACTIVE’ or ‘PAUSED’.

const url = new URL("https://api.sender.net/v2/account/webhooks/{id}");
let headers = {
"Authorization": "Bearer [your-token]",
"Content-Type": "application/json",
"Accept": "application/json",
};
let bodyContent = {
"id": 1829,
"topic": "campaigns/new",
"url": "https://hooks.zapier.com/hooks/catch/12345",
"status": "PAUSED"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(bodyContent)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));

Example Response
{
"id": "1829",
"account_id": "egy29b",
"url": "https://hooks.zapier.com/hooks/catch/12345",
"topic": "campaigns/new",
"group": null,
"total_deliveries": 117,
"total_failures": 0,
"response_time": 172,
"status": "PAUSED"
}