Skip to content
Get Started

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.

ParametersExpand Collapse
body: WebhookUpdateParams { webhooks }
webhooks: Webhooks
call_log?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for call log events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

contact_created?: Array<string>

Webhooks for contact created events (URL strings only)

globalSecret?: string

Global secret applied to all webhooks

line_assigned?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for line assigned events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

line_blocked?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for line blocked events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

outbound?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for outbound message status updates

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

receive?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for inbound message events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

typing_indicator?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for typing indicator events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

ReturnsExpand Collapse
WebhookUpdateResponse { message, status, webhooks }
message?: string
status?: string
webhooks?: Webhooks { call_log, contact_created, globalSecret, 5 more }
call_log?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for call log events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

contact_created?: Array<string>

Webhooks for contact created events (URL strings only)

globalSecret?: string

Global secret applied to all webhooks

line_assigned?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for line assigned events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

line_blocked?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for line blocked events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

outbound?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for outbound message status updates

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

receive?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for inbound message events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

typing_indicator?: Array<string | WebhookConfiguration { url, secret } >

Webhooks for typing indicator events

Accepts one of the following:
string
WebhookConfiguration { url, secret }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret?: string

Secret for webhook signature verification

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"
    ]
  }
}