Skip to content
Get Started

Add webhooks

POST/api/account/webhooks

Add new webhooks to the account. Webhooks are appended to existing ones.

With a line-scoped temporary bearer token, only receive webhooks can be added. String webhook URLs are automatically scoped to the token’s phone numbers; webhook objects must use sendblue_numbers within the token’s allowed phone numbers.

Body ParametersJSONExpand Collapse
webhooks: array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Array of webhook URLs or webhook objects

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

globalSecret: optional string

Global secret for webhook signature verification

type: optional "receive" or "line_blocked" or "line_assigned" or 6 more

Type of webhook to add

One of the following:
"receive"
"line_blocked"
"line_assigned"
"outbound"
"typing_indicator"
"call_log"
"inbound_call"
"contact_profile"
"contact_created"
ReturnsExpand Collapse
message: optional string
status: optional string
webhooks: optional object { call_log, contact_created, contact_profile, 7 more }
call_log: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for call log events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

contact_created: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for contact created events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

contact_profile: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for durable contact-profile publication completion and failure events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

globalSecret: optional string

Global secret applied to all webhooks

inbound_call: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for inbound call events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

line_assigned: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for line assigned events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

line_blocked: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for line blocked events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

outbound: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for outbound message status updates

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

receive: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for inbound message events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

typing_indicator: optional array of string or WebhookConfiguration { url, secret, sendblue_numbers }

Webhooks for typing indicator events

One of the following:
string
WebhookConfiguration object { url, secret, sendblue_numbers }
url: string

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

sendblue_numbers: optional array of string

Receive webhooks only. When present, only inbound messages received by these Sendblue line numbers are delivered to this webhook.

Add webhooks

curl https://api.sendblue.co/api/account/webhooks \
    -H 'Content-Type: application/json' \
    -H "sb-api-key-id: $SENDBLUE_API_API_KEY" \
    -H "sb-api-secret-key: $SENDBLUE_API_API_SECRET" \
    -d '{
          "webhooks": [
            "https://example.com"
          ]
        }'
{
  "message": "Webhooks added successfully",
  "status": "OK",
  "webhooks": {
    "call_log": [
      "https://example.com"
    ],
    "contact_created": [
      "https://example.com"
    ],
    "contact_profile": [
      "https://example.com"
    ],
    "globalSecret": "whsec_global123",
    "inbound_call": [
      "https://example.com"
    ],
    "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 added successfully",
  "status": "OK",
  "webhooks": {
    "call_log": [
      "https://example.com"
    ],
    "contact_created": [
      "https://example.com"
    ],
    "contact_profile": [
      "https://example.com"
    ],
    "globalSecret": "whsec_global123",
    "inbound_call": [
      "https://example.com"
    ],
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ],
    "typing_indicator": [
      "https://example.com"
    ]
  }
}