ALTER NOTIFICATION INTEGRATION
Modifies the settings of a named notification integration that sends notifications to a webhook endpoint.
NOTICE: This functionality works out of the box only in Databend Cloud.
Syntax
Webhook Notification
Each statement changes one option. Other options keep their current values.
ALTER NOTIFICATION INTEGRATION [ IF EXISTS ] <name> SET ENABLED = <bool>
ALTER NOTIFICATION INTEGRATION [ IF EXISTS ] <name>
SET WEBHOOK = ( URL = '<url>', METHOD = '<method>', AUTHORIZATION_HEADER = '<header>' )
ALTER NOTIFICATION INTEGRATION [ IF EXISTS ] <name>
SET WEBHOOK_BODY_TEMPLATE = '<json_template>'
ALTER NOTIFICATION INTEGRATION [ IF EXISTS ] <name>
UNSET WEBHOOK_BODY_TEMPLATE
ALTER NOTIFICATION INTEGRATION [ IF EXISTS ] <name>
SET COMMENT = '<string_literal>'
| Option | Description |
|---|---|
ENABLED | Enables or disables the notification integration. |
WEBHOOK | Changes the webhook URL, method, or authorization header. Omitted properties keep their current values. |
WEBHOOK_BODY_TEMPLATE | Sets or replaces the JSON body template. |
UNSET WEBHOOK_BODY_TEMPLATE | Removes the template. Later notifications use the original message as the request body. |
COMMENT | Changes the comment. |
Webhook Body Template
Use SET WEBHOOK_BODY_TEMPLATE to add or replace a template:
ALTER NOTIFICATION INTEGRATION feishu_alerts
SET WEBHOOK_BODY_TEMPLATE = '{"msg_type":"text","content":{"text":"[DatabendAlert] DATABEND_WEBHOOK_MESSAGE"}}';
Use UNSET WEBHOOK_BODY_TEMPLATE to remove it:
ALTER NOTIFICATION INTEGRATION feishu_alerts
UNSET WEBHOOK_BODY_TEMPLATE;
SET WEBHOOK_BODY_TEMPLATE = '' is an error. Use UNSET to clear the template.
The template rules are the same as for CREATE NOTIFICATION INTEGRATION:
- The template must contain exactly one non-empty, valid JSON value. It can contain up to 65,536 bytes.
DATABEND_WEBHOOK_MESSAGEis replaced only inside JSON string values.- The rendered body can contain up to 262,144 bytes.
- Databend sends
Content-Type: application/jsonautomatically.
Changing another option does not clear the template. For example, this statement changes only the comment:
ALTER NOTIFICATION INTEGRATION feishu_alerts
SET COMMENT = 'Feishu alerts for query errors';
Examples
Enable a Notification Integration
ALTER NOTIFICATION INTEGRATION SampleNotification
SET ENABLED = TRUE;
Change the Webhook URL
ALTER NOTIFICATION INTEGRATION SampleNotification
SET WEBHOOK = (URL = 'https://example.com/v2', METHOD = 'POST');
Set and Clear a Template
ALTER NOTIFICATION INTEGRATION feishu_alerts
SET WEBHOOK_BODY_TEMPLATE = '{"msg_type":"text","content":{"text":"DATABEND_WEBHOOK_MESSAGE"}}';
ALTER NOTIFICATION INTEGRATION feishu_alerts
UNSET WEBHOOK_BODY_TEMPLATE;