Skip to content
  • Auto
  • Light
  • Dark
Get Started
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Add new webhooks

post/api/v2/account/webhooks

Add new webhooks to your account. This endpoint appends webhooks to the existing list.

Body ParametersExpand Collapse
webhooks: array of string or object { url, secret }

Array of webhook URLs or webhook objects to add

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

globalSecret: optional string

Optional global secret to apply to all webhooks

type: optional "receive" or "call_log" or "line_blocked" or 3 more

Webhook type (default to 'receive')

Accepts one of the following:
"receive"
"call_log"
"line_blocked"
"line_assigned"
"outbound"
"contact_created"
ReturnsExpand Collapse
status: "OK" or "ERROR"
Accepts one of the following:
"OK"
"ERROR"
message: optional string
webhooks: optional WebhookConfiguration { call_log, contact_created, globalSecret, 5 more }

Updated webhook configration (partial)

call_log: optional array of string or object { url, secret }

Webhooks for call logs

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

contact_created: optional array of string

Webhooks for contact creation (URL strings only)

globalSecret: optional string

Global secret applied to all webhooks

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

Webhooks for line assignment

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

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

Webhooks for blocked lines

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

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

Webhooks for outbound messages

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

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

Webhooks for inbound messages

Accepts one of the following:
UnionMember0 = string

Simple webhook URL (HTTPS only)

WebhookObject = object { url, secret }
url: string

Webhook URL (HTTPS only)

formaturi
secret: optional string

Secret for webhook verification

secret: optional string

Legacy secret field

Add new webhooks
curl https://api.sendblue.co/api/v2/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/new-webhook",
            {
              "url": "https://example.com/webhook-with-secret",
              "secret": "my-webhook-secret"
            }
          ]
        }'
{
  "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"
  }
}