Replace webhooks
client.webhooks.update(WebhookUpdateParams { webhooks } body, RequestOptionsoptions?): WebhookUpdateResponse { message, status, webhooks }
PUT/api/account/webhooks
Replace all webhooks for the account. This overwrites existing webhooks.
Parameters
Returns
Replace webhooks
import SendblueAPI from 'sendblue';
const client = new SendblueAPI({
apiKey: process.env['SENDBLUE_API_API_KEY'], // This is the default and can be omitted
apiSecret: process.env['SENDBLUE_API_API_SECRET'], // This is the default and can be omitted
});
const webhook = await client.webhooks.update({ webhooks: {} });
console.log(webhook.message);{
"message": "Webhooks updated successfully",
"status": "OK",
"webhooks": {
"call_log": [
"https://example.com"
],
"contact_created": [
"https://example.com"
],
"globalSecret": "whsec_global123",
"line_assigned": [
"https://example.com"
],
"line_blocked": [
"https://example.com"
],
"outbound": [
"https://example.com"
],
"receive": [
"https://example.com"
],
"typing_indicator": [
"https://example.com"
]
}
}Returns Examples
{
"message": "Webhooks updated successfully",
"status": "OK",
"webhooks": {
"call_log": [
"https://example.com"
],
"contact_created": [
"https://example.com"
],
"globalSecret": "whsec_global123",
"line_assigned": [
"https://example.com"
],
"line_blocked": [
"https://example.com"
],
"outbound": [
"https://example.com"
],
"receive": [
"https://example.com"
],
"typing_indicator": [
"https://example.com"
]
}
}