Skip to main content

webhooks

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

Overview

Namewebhooks
TypeResource
Idcloudflare.realtime_kit.webhooks

Fields

The following fields are returned by SELECT queries:

Operation successful

NameDatatypeDescription
dataobject
successboolean

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, app_id, webhook_idReturns webhook details for the given webhook ID.
listselectaccount_id, app_idReturns details of all webhooks for an App.
create_webhookinsertaccount_id, app_id, name, url, eventsAdds a new webhook to an App.
edit_webhookupdateaccount_id, app_id, webhook_idEdits the webhook details for the given webhook ID.
replace_webhookreplaceaccount_id, app_id, webhook_id, name, url, eventsReplace all details for the given webhook ID.
delete_webhookdeleteaccount_id, app_id, webhook_idRemoves a webhook for the given webhook ID.

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
account_idstringThe Cloudflare account ID.
app_idstringThe Access application ID.
webhook_idstringID of the webhook

SELECT examples

Returns webhook details for the given webhook ID.

SELECT
data,
success
FROM cloudflare.realtime_kit.webhooks
WHERE account_id = '{{ account_id }}' -- required
AND app_id = '{{ app_id }}' -- required
AND webhook_id = '{{ webhook_id }}' -- required
;

INSERT examples

Adds a new webhook to an App.

INSERT INTO cloudflare.realtime_kit.webhooks (
enabled,
events,
name,
url,
account_id,
app_id
)
SELECT
{{ enabled }},
'{{ events }}' /* required */,
'{{ name }}' /* required */,
'{{ url }}' /* required */,
'{{ account_id }}',
'{{ app_id }}'
RETURNING
data,
success
;

UPDATE examples

Edits the webhook details for the given webhook ID.

UPDATE cloudflare.realtime_kit.webhooks
SET
enabled = {{ enabled }},
events = '{{ events }}',
name = '{{ name }}',
url = '{{ url }}'
WHERE
account_id = '{{ account_id }}' --required
AND app_id = '{{ app_id }}' --required
AND webhook_id = '{{ webhook_id }}' --required
RETURNING
data,
success;

REPLACE examples

Replace all details for the given webhook ID.

REPLACE cloudflare.realtime_kit.webhooks
SET
enabled = {{ enabled }},
events = '{{ events }}',
name = '{{ name }}',
url = '{{ url }}'
WHERE
account_id = '{{ account_id }}' --required
AND app_id = '{{ app_id }}' --required
AND webhook_id = '{{ webhook_id }}' --required
AND name = '{{ name }}' --required
AND url = '{{ url }}' --required
AND events = '{{ events }}' --required
RETURNING
data,
success;

DELETE examples

Removes a webhook for the given webhook ID.

DELETE FROM cloudflare.realtime_kit.webhooks
WHERE account_id = '{{ account_id }}' --required
AND app_id = '{{ app_id }}' --required
AND webhook_id = '{{ webhook_id }}' --required
;