Replace all webhooks
webhooks.update(WebhookUpdateParams**kwargs) -> WebhookUpdateResponse
/api/v2/account/webhooks
Replace all webhooks for your account. This endpoint completely replaces the existing webhook configuration.
Parameters
Returns
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"
}
}