Replace all webhooks
client.webhooks.update(WebhookUpdateParams { webhooks } body, RequestOptionsoptions?): WebhookUpdateResponse { status, message, webhooks }
/api/v2/account/webhooks
Replace all webhooks for your account. This endpoint completely replaces the existing webhook configuration.
Parameters
Returns
Replace all webhooks
import SendblueAPI from 'sendblue';
const client = new SendblueAPI({
apiKey: 'My API Key',
apiSecret: 'My API Secret',
});
const webhook = await client.webhooks.update({
webhooks: {
receive: [
'https://example.com/webhook1',
{ url: 'https://example.com/webhook2', secret: 'webhook-secret' },
],
call_log: ['https://example.com/call-webhook'],
contact_created: ['https://example.com/contact-webhook'],
globalSecret: 'my-global-secret',
},
});
console.log(webhook.status);
{
"status": "OK",
"message": "message",
"webhooks": {
"call_log": [
"https://example.com/webhook"
],
"contact_created": [
"https://example.com"
],
"globalSecret": "globalSecret",
"line_assigned": [
"https://example.com/webhook"
],
"line_blocked": [
"https://example.com/webhook"
],
"outbound": [
"https://example.com/webhook"
],
"receive": [
"https://example.com/webhook"
],
"secret": "secret"
}
}Returns Examples
{
"status": "OK",
"message": "message",
"webhooks": {
"call_log": [
"https://example.com/webhook"
],
"contact_created": [
"https://example.com"
],
"globalSecret": "globalSecret",
"line_assigned": [
"https://example.com/webhook"
],
"line_blocked": [
"https://example.com/webhook"
],
"outbound": [
"https://example.com/webhook"
],
"receive": [
"https://example.com/webhook"
],
"secret": "secret"
}
}