Add a webhook
client.realtimeKit.webhooks.createWebhook(stringappId, WebhookCreateWebhookParams { account_id, events, name, 2 more } params, RequestOptionsoptions?): WebhookCreateWebhookResponse { data, success }
POST/accounts/{account_id}/realtime/kit/{app_id}/webhooks
Adds a new webhook to an App.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Add a webhook
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const response = await client.realtimeKit.webhooks.createWebhook('app_id', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
events: [
'meeting.started',
'meeting.ended',
'meeting.participantJoined',
'meeting.participantLeft',
'meeting.chatSynced',
'recording.statusUpdate',
'livestreaming.statusUpdate',
'meeting.transcript',
'meeting.summary',
],
name: 'All events webhook',
url: 'https://webhook.site/b23a5bbd-c7b0-4ced-a9e2-78ae7889897e',
});
console.log(response.data);{
"data": {
"id": "0d1f069d-43bb-489a-ad8c-7eb95592ba8e",
"created_at": "2022-05-28T07:01:53.075Z",
"enabled": true,
"events": [
"meeting.started",
"meeting.ended",
"meeting.participantJoined",
"meeting.participantLeft",
"meeting.chatSynced",
"recording.statusUpdate",
"livestreaming.statusUpdate",
"meeting.transcript",
"meeting.summary"
],
"name": "All events webhook",
"updated_at": "2022-05-28T07:01:53.075Z",
"url": "https://webhook.site/b23a5bbd-c7b0-4ced-a9e2-78ae7889897e"
},
"success": true
}"{\n message: \"Unauthorized\"\n}\n"Returns Examples
{
"data": {
"id": "0d1f069d-43bb-489a-ad8c-7eb95592ba8e",
"created_at": "2022-05-28T07:01:53.075Z",
"enabled": true,
"events": [
"meeting.started",
"meeting.ended",
"meeting.participantJoined",
"meeting.participantLeft",
"meeting.chatSynced",
"recording.statusUpdate",
"livestreaming.statusUpdate",
"meeting.transcript",
"meeting.summary"
],
"name": "All events webhook",
"updated_at": "2022-05-28T07:01:53.075Z",
"url": "https://webhook.site/b23a5bbd-c7b0-4ced-a9e2-78ae7889897e"
},
"success": true
}"{\n message: \"Unauthorized\"\n}\n"