Replace a webhook
client.RealtimeKit.Webhooks.ReplaceWebhook(ctx, appID, webhookID, params) (*WebhookReplaceWebhookResponse, error)
PUT/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}
Replace all details for the given webhook ID.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Accepted Permissions (at least one required)
Replace a webhook
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/realtime_kit"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
response, err := client.RealtimeKit.Webhooks.ReplaceWebhook(
context.TODO(),
"app_id",
"webhook_id",
realtime_kit.WebhookReplaceWebhookParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
Events: cloudflare.F([]realtime_kit.WebhookReplaceWebhookParamsEvent{realtime_kit.WebhookReplaceWebhookParamsEventMeetingStarted, realtime_kit.WebhookReplaceWebhookParamsEventMeetingEnded, realtime_kit.WebhookReplaceWebhookParamsEventMeetingParticipantJoined, realtime_kit.WebhookReplaceWebhookParamsEventMeetingParticipantLeft, realtime_kit.WebhookReplaceWebhookParamsEventMeetingChatSynced, realtime_kit.WebhookReplaceWebhookParamsEventRecordingStatusUpdate, realtime_kit.WebhookReplaceWebhookParamsEventLivestreamingStatusUpdate, realtime_kit.WebhookReplaceWebhookParamsEventMeetingTranscript, realtime_kit.WebhookReplaceWebhookParamsEventMeetingSummary}),
Name: cloudflare.F("All events webhook"),
URL: cloudflare.F("https://webhook.site/b23a5bbd-c7b0-4ced-a9e2-78ae7889897e"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"