Skip to main content

ALTER NOTIFICATION INTEGRATION

Introduced or updated: v1.2.949

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>'
OptionDescription
ENABLEDEnables or disables the notification integration.
WEBHOOKChanges the webhook URL, method, or authorization header. Omitted properties keep their current values.
WEBHOOK_BODY_TEMPLATESets or replaces the JSON body template.
UNSET WEBHOOK_BODY_TEMPLATERemoves the template. Later notifications use the original message as the request body.
COMMENTChanges 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_MESSAGE is replaced only inside JSON string values.
  • The rendered body can contain up to 262,144 bytes.
  • Databend sends Content-Type: application/json automatically.

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;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today