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

Open in Claude
Open in ChatGPT

Replace all webhooks

webhooks.update(WebhookUpdateParams**kwargs) -> WebhookUpdateResponse
put/api/v2/account/webhooks

Replace all webhooks for your account. This endpoint completely replaces the existing webhook configuration.

ParametersExpand Collapse
call_log: Optional[List[CallLog]]

Webhooks for call logs

Accepts one of the following:
CallLogUnionMember0 = str

Simple webhook URL (HTTPS only)

class CallLogWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

contact_created: Optional[List[str]]

Webhooks for contact creation (URL strings only)

global_secret: Optional[str]

Global secret applied to all webhooks

line_assigned: Optional[List[LineAssigned]]

Webhooks for line assignment

Accepts one of the following:
LineAssignedUnionMember0 = str

Simple webhook URL (HTTPS only)

class LineAssignedWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

line_blocked: Optional[List[LineBlocked]]

Webhooks for blocked lines

Accepts one of the following:
LineBlockedUnionMember0 = str

Simple webhook URL (HTTPS only)

class LineBlockedWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

outbound: Optional[List[Outbound]]

Webhooks for outbound messages

Accepts one of the following:
OutboundUnionMember0 = str

Simple webhook URL (HTTPS only)

class OutboundWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

receive: Optional[List[Receive]]

Webhooks for inbound messages

Accepts one of the following:
ReceiveUnionMember0 = str

Simple webhook URL (HTTPS only)

class ReceiveWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

secret: Optional[str]

Legacy secret field

ReturnsExpand Collapse
class WebhookUpdateResponse:
status: Literal["OK", "ERROR"]
Accepts one of the following:
"OK"
"ERROR"
message: Optional[str]
webhooks: Optional[WebhookConfiguration]

Updated webhook configration (partial)

call_log: Optional[List[CallLog]]

Webhooks for call logs

Accepts one of the following:
CallLogUnionMember0 = str

Simple webhook URL (HTTPS only)

class CallLogWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

contact_created: Optional[List[str]]

Webhooks for contact creation (URL strings only)

global_secret: Optional[str]

Global secret applied to all webhooks

line_assigned: Optional[List[LineAssigned]]

Webhooks for line assignment

Accepts one of the following:
LineAssignedUnionMember0 = str

Simple webhook URL (HTTPS only)

class LineAssignedWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

line_blocked: Optional[List[LineBlocked]]

Webhooks for blocked lines

Accepts one of the following:
LineBlockedUnionMember0 = str

Simple webhook URL (HTTPS only)

class LineBlockedWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

outbound: Optional[List[Outbound]]

Webhooks for outbound messages

Accepts one of the following:
OutboundUnionMember0 = str

Simple webhook URL (HTTPS only)

class OutboundWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

receive: Optional[List[Receive]]

Webhooks for inbound messages

Accepts one of the following:
ReceiveUnionMember0 = str

Simple webhook URL (HTTPS only)

class ReceiveWebhookObject:
url: str

Webhook URL (HTTPS only)

formaturi
secret: Optional[str]

Secret for webhook verification

secret: Optional[str]

Legacy secret field

Replace all webhooks
from sendblue_api import SendblueAPI

client = SendblueAPI(
    api_key="My API Key",
    api_secret="My API Secret",
)
webhook = client.webhooks.update(
    webhooks={
        "receive": ["https://example.com/webhook1", {
            "url": "https://example.com/webhook2",
            "secret": "webhook-secret",
        }],
        "call_log": ["https://example.com/call-webhook"],
        "contact_created": ["https://example.com/contact-webhook"],
        "global_secret": "my-global-secret",
    },
)
print(webhook.status)
{
  "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"
  }
}