Skip to main content

webhooks

Creates, updates, deletes, gets or lists a webhooks resource.

Overview​

Namewebhooks
TypeResource
Idclickhouse.clickstack.webhooks

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringWebhook ID (example: 507f1f77bcf86cd799439011)
namestringWebhook name (example: Production Alerts)
bodystringOptional request body template (example: {"alert": "{{title}}", "severity": "{{level}}"})
created_atstring (date-time)Creation timestamp (example: 2025-01-01T00:00:00.000Z) (wire: createdAt)
descriptionstringWebhook description, shown in the UI (example: Sends critical alerts to the #incidents channel)
servicestringWebhook service type (slack) (example: slack)
updated_atstring (date-time)Last update timestamp (example: 2025-06-15T10:30:00.000Z) (wire: updatedAt)
urlstringSlack incoming webhook URL (example: https:​//hooks.slack.com/services/EXAMPLE)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectservice_id, organization_idlimit, offsetThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves webhooks for the authenticated team (paginated). Results are capped at limit (default and maximum 1000). When totalCount exceeds the number of returned items, page with limit/offset to retrieve them all.
createinsertservice_id, organization_id, name, service, urlThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new webhook for the authenticated team.
updateupdateservice_id, click_stack_webhook_id, organization_id, name, service, urlThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Replaces an existing webhook. Readable optional fields (description, body) are a full replace: omitting them clears them. The write-only fields headers and queryParams are never returned on read, so omitting them preserves the stored values; send an explicit empty object (&#123;&#125;) to clear them. Exception: if the destination (url or service) changes, omitted headers/ queryParams are cleared rather than preserved so stored secrets are never forwarded to a new destination.
deletedeleteservice_id, click_stack_webhook_id, organization_idThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a webhook. Blocked with a 409 while any alert still references it — reassign or remove those alerts first — so deletion never leaves an alert pointing at a missing webhook (which would silently drop notifications). Mirrors the internal webhook delete guard.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
click_stack_webhook_idstringWebhook ID (wire: clickStackWebhookId)
organization_idstringClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID)
service_idstring (uuid)ID of the ClickStack service. (wire: serviceId)
limitintegerMaximum number of results to return.
offsetintegerNumber of results to skip before returning.

SELECT examples​

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves webhooks for the authenticated team (paginated). Results are capped at limit (default and maximum 1000). When totalCount exceeds the number of returned items, page with limit/offset to retrieve them all.

SELECT
id,
name,
body,
created_at,
description,
service,
updated_at,
url
FROM clickhouse.clickstack.webhooks
WHERE service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
AND limit = '{{ limit }}'
AND offset = '{{ offset }}'
;

INSERT examples​

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new webhook for the authenticated team.

INSERT INTO clickhouse.clickstack.webhooks (
name,
service,
url,
description,
body,
headers,
query_params,
service_id,
organization_id
)
SELECT
'{{ name }}' /* required */,
'{{ service }}' /* required */,
'{{ url }}' /* required */,
'{{ description }}',
'{{ body }}',
'{{ headers }}',
'{{ query_params }}',
'{{ service_id }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;

UPDATE examples​

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Replaces an existing webhook. Readable optional fields (description, body) are a full replace: omitting them clears them. The write-only fields headers and queryParams are never returned on read, so omitting them preserves the stored values; send an explicit empty object (&#123;&#125;) to clear them. Exception: if the destination (url or service) changes, omitted headers/ queryParams are cleared rather than preserved so stored secrets are never forwarded to a new destination.

UPDATE clickhouse.clickstack.webhooks
SET
name = '{{ name }}',
service = '{{ service }}',
url = '{{ url }}',
description = '{{ description }}',
body = '{{ body }}',
headers = '{{ headers }}',
query_params = '{{ query_params }}'
WHERE
service_id = '{{ service_id }}' --required
AND click_stack_webhook_id = '{{ click_stack_webhook_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
AND name = '{{ name }}' --required
AND service = '{{ service }}' --required
AND url = '{{ url }}' --required
RETURNING
request_id,
result,
status;

DELETE examples​

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a webhook. Blocked with a 409 while any alert still references it — reassign or remove those alerts first — so deletion never leaves an alert pointing at a missing webhook (which would silently drop notifications). Mirrors the internal webhook delete guard.

DELETE FROM clickhouse.clickstack.webhooks
WHERE service_id = '{{ service_id }}' --required
AND click_stack_webhook_id = '{{ click_stack_webhook_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;