Skip to content
Get Started

Get webhooks

client.webhooks.list(RequestOptionsoptions?): WebhookListResponse { status, webhooks }
GET/api/account/webhooks

Get all webhooks configured for the authenticated account

ReturnsExpand Collapse
WebhookListResponse { status, webhooks }
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

Get 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 webhooks = await client.webhooks.list();

console.log(webhooks.status);
{
  "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
{
  "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"
    ]
  }
}