webhooks
Creates, updates, deletes, gets or lists a webhooks resource.
Overview
| Name | webhooks |
| Type | Resource |
| Id | clickhouse.clickstack.webhooks |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Webhook ID (example: 507f1f77bcf86cd799439011) |
name | string | Webhook name (example: Production Alerts) |
body | string | Optional request body template (example: {"alert": "{{title}}", "severity": "{{level}}"}) |
created_at | string (date-time) | Creation timestamp (example: 2025-01-01T00:00:00.000Z) (wire: createdAt) |
description | string | Webhook description, shown in the UI (example: Sends critical alerts to the #incidents channel) |
service | string | Webhook service type (slack) (example: slack) |
updated_at | string (date-time) | Last update timestamp (example: 2025-06-15T10:30:00.000Z) (wire: updatedAt) |
url | string | Slack incoming webhook URL (example: https://hooks.slack.com/services/EXAMPLE) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | service_id, organization_id | limit, offset | 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. |
create | insert | service_id, organization_id, name, service, url | 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. | |
update | update | service_id, click_stack_webhook_id, organization_id, name, service, url | 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 ({}) 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. | |
delete | delete | service_id, click_stack_webhook_id, organization_id | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
click_stack_webhook_id | string | Webhook ID (wire: clickStackWebhookId) |
organization_id | string | ClickHouse 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_id | string (uuid) | ID of the ClickStack service. (wire: serviceId) |
limit | integer | Maximum number of results to return. |
offset | integer | Number of results to skip before returning. |
SELECT examples
- list
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: webhooks
props:
- name: service_id
value: "{{ service_id }}"
description: Required parameter for the webhooks resource.
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the webhooks resource.
- name: name
value: "{{ name }}"
description: |
Webhook name. Must be unique per service within the team.
- name: service
value: "{{ service }}"
description: |
Webhook service type.
valid_values: ['slack', 'incidentio', 'generic']
- name: url
value: "{{ url }}"
description: |
Webhook destination URL.
- name: description
value: "{{ description }}"
description: |
Webhook description, shown in the UI.
- name: body
value: "{{ body }}"
description: |
Optional request body template. Only for generic/incidentio; rejected for slack.
- name: headers
value: "{{ headers }}"
- name: query_params
value: "{{ query_params }}"
UPDATE examples
- update
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 ({}) 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
- delete
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
;