# Webhooks ## Fetch all webhooks details `client.realtimeKit.webhooks.getWebhooks(stringappId, WebhookGetWebhooksParamsparams, RequestOptionsoptions?): WebhookGetWebhooksResponse` **get** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks` Returns details of all webhooks for an App. ### Parameters - `appId: string` The app identifier tag. - `params: WebhookGetWebhooksParams` - `account_id: string` The account identifier tag. ### Returns - `WebhookGetWebhooksResponse` - `data: Array` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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.getWebhooks('app_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.data); ``` #### Response ```json { "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 } ``` ## Add a webhook `client.realtimeKit.webhooks.createWebhook(stringappId, WebhookCreateWebhookParamsparams, RequestOptionsoptions?): WebhookCreateWebhookResponse` **post** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks` Adds a new webhook to an App. ### Parameters - `appId: string` The app identifier tag. - `params: WebhookCreateWebhookParams` - `account_id: string` Path param: The account identifier tag. - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Body param: Events that this webhook will get triggered by - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Body param: Name of the webhook - `url: string` Body param: URL this webhook will send events to - `enabled?: boolean` Body param: Set whether or not the webhook should be active when created ### Returns - `WebhookCreateWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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); ``` #### Response ```json { "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 } ``` ## Fetch details of a webhook `client.realtimeKit.webhooks.getWebhookById(stringappId, stringwebhookId, WebhookGetWebhookByIDParamsparams, RequestOptionsoptions?): WebhookGetWebhookByIDResponse` **get** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}` Returns webhook details for the given webhook ID. ### Parameters - `appId: string` The app identifier tag. - `webhookId: string` - `params: WebhookGetWebhookByIDParams` - `account_id: string` The account identifier tag. ### Returns - `WebhookGetWebhookByIDResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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.getWebhookById('app_id', 'webhook_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.data); ``` #### Response ```json { "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 } ``` ## Replace a webhook `client.realtimeKit.webhooks.replaceWebhook(stringappId, stringwebhookId, WebhookReplaceWebhookParamsparams, RequestOptionsoptions?): WebhookReplaceWebhookResponse` **put** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}` Replace all details for the given webhook ID. ### Parameters - `appId: string` The app identifier tag. - `webhookId: string` - `params: WebhookReplaceWebhookParams` - `account_id: string` Path param: The account identifier tag. - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Body param: Events that this webhook will get triggered by - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Body param: Name of the webhook - `url: string` Body param: URL this webhook will send events to - `enabled?: boolean` Body param: Set whether or not the webhook should be active when created ### Returns - `WebhookReplaceWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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.replaceWebhook('app_id', 'webhook_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); ``` #### Response ```json { "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 } ``` ## Edit a webhook `client.realtimeKit.webhooks.editWebhook(stringappId, stringwebhookId, WebhookEditWebhookParamsparams, RequestOptionsoptions?): WebhookEditWebhookResponse` **patch** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}` Edits the webhook details for the given webhook ID. ### Parameters - `appId: string` The app identifier tag. - `webhookId: string` - `params: WebhookEditWebhookParams` - `account_id: string` Path param: The account identifier tag. - `enabled?: boolean` Body param - `events?: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Body param: Events that the webhook will get triggered by - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.chatSynced"` - `"meeting.transcript"` - `"meeting.summary"` - `name?: string` Body param: Name of the webhook - `url?: string` Body param: URL the webhook will send events to ### Returns - `WebhookEditWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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.editWebhook('app_id', 'webhook_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.data); ``` #### Response ```json { "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 } ``` ## Delete a webhook `client.realtimeKit.webhooks.deleteWebhook(stringappId, stringwebhookId, WebhookDeleteWebhookParamsparams, RequestOptionsoptions?): WebhookDeleteWebhookResponse` **delete** `/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}` Removes a webhook for the given webhook ID. ### Parameters - `appId: string` The app identifier tag. - `webhookId: string` - `params: WebhookDeleteWebhookParams` - `account_id: string` The account identifier tag. ### Returns - `WebhookDeleteWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Example ```node 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.deleteWebhook('app_id', 'webhook_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(response.data); ``` #### Response ```json { "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 } ``` ## Domain Types ### Webhook Get Webhooks Response - `WebhookGetWebhooksResponse` - `data: Array` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Webhook Create Webhook Response - `WebhookCreateWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Webhook Get Webhook By ID Response - `WebhookGetWebhookByIDResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Webhook Replace Webhook Response - `WebhookReplaceWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Webhook Edit Webhook Response - `WebhookEditWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean` ### Webhook Delete Webhook Response - `WebhookDeleteWebhookResponse` - `data: Data` - `id: string` ID of the webhook - `created_at: string` Timestamp when this webhook was created - `enabled: boolean` Set to true if the webhook is active - `events: Array<"meeting.started" | "meeting.ended" | "meeting.participantJoined" | 6 more>` Events this webhook will send updates for - `"meeting.started"` - `"meeting.ended"` - `"meeting.participantJoined"` - `"meeting.participantLeft"` - `"meeting.chatSynced"` - `"recording.statusUpdate"` - `"livestreaming.statusUpdate"` - `"meeting.transcript"` - `"meeting.summary"` - `name: string` Name of the webhook - `updated_at: string` Timestamp when this webhook was updated - `url: string` URL the webhook will send events to - `success: boolean`