Skip to content
Get Started

Add webhooks

post/api/account/webhooks

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

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

Array of webhook URLs or webhook objects

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

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

globalSecret: optional string

Global secret for webhook signature verification

type: optional "receive" or "line_blocked" or "line_assigned" or "outbound"

Type of webhook to add

Accepts one of the following:
"receive"
"line_blocked"
"line_assigned"
"outbound"
ReturnsExpand Collapse
message: optional string
status: optional string
webhooks: optional object { globalSecret, line_assigned, line_blocked, 2 more }
globalSecret: optional string

Global secret applied to all webhooks

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

Webhooks for line assigned events

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

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

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

Webhooks for line blocked events

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

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

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

Webhooks for outbound message events

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

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

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

Webhooks for inbound message events

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

Webhook endpoint URL for receiving callbacks

formaturi
secret: optional string

Secret for webhook signature verification

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": {
    "globalSecret": "whsec_global123",
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ]
  }
}
Returns Examples
{
  "message": "Webhooks added successfully",
  "status": "OK",
  "webhooks": {
    "globalSecret": "whsec_global123",
    "line_assigned": [
      "https://example.com"
    ],
    "line_blocked": [
      "https://example.com"
    ],
    "outbound": [
      "https://example.com"
    ],
    "receive": [
      "https://example.com"
    ]
  }
}