Skip to content
Start here

Edit a webhook

client.RealtimeKit.Webhooks.EditWebhook(ctx, appID, webhookID, params) (*WebhookEditWebhookResponse, error)
PATCH/accounts/{account_id}/realtime/kit/{app_id}/webhooks/{webhook_id}

Edits the webhook details for the given webhook ID.

Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
Accepted Permissions (at least one required)
Realtime AdminRealtime
ParametersExpand Collapse
appID string

The app identifier tag.

maxLength32
webhookID string
params WebhookEditWebhookParams
AccountID param.Field[string]

Path param: The account identifier tag.

maxLength32
Enabled param.Field[bool]optional

Body param

Events param.Field[[]WebhookEditWebhookParamsEvent]optional

Body param: Events that the webhook will get triggered by

const WebhookEditWebhookParamsEventMeetingStarted WebhookEditWebhookParamsEvent = "meeting.started"
const WebhookEditWebhookParamsEventMeetingEnded WebhookEditWebhookParamsEvent = "meeting.ended"
const WebhookEditWebhookParamsEventMeetingParticipantJoined WebhookEditWebhookParamsEvent = "meeting.participantJoined"
const WebhookEditWebhookParamsEventMeetingParticipantLeft WebhookEditWebhookParamsEvent = "meeting.participantLeft"
const WebhookEditWebhookParamsEventRecordingStatusUpdate WebhookEditWebhookParamsEvent = "recording.statusUpdate"
const WebhookEditWebhookParamsEventLivestreamingStatusUpdate WebhookEditWebhookParamsEvent = "livestreaming.statusUpdate"
const WebhookEditWebhookParamsEventMeetingChatSynced WebhookEditWebhookParamsEvent = "meeting.chatSynced"
const WebhookEditWebhookParamsEventMeetingTranscript WebhookEditWebhookParamsEvent = "meeting.transcript"
const WebhookEditWebhookParamsEventMeetingSummary WebhookEditWebhookParamsEvent = "meeting.summary"
Name param.Field[string]optional

Body param: Name of the webhook

URL param.Field[string]optional

Body param: URL the webhook will send events to

formaturi
ReturnsExpand Collapse
type WebhookEditWebhookResponse struct{…}
Data WebhookEditWebhookResponseData
ID string

ID of the webhook

formatuuid
CreatedAt Time

Timestamp when this webhook was created

formatdate-time
Enabled bool

Set to true if the webhook is active

Events []WebhookEditWebhookResponseDataEvent

Events this webhook will send updates for

One of the following:
const WebhookEditWebhookResponseDataEventMeetingStarted WebhookEditWebhookResponseDataEvent = "meeting.started"
const WebhookEditWebhookResponseDataEventMeetingEnded WebhookEditWebhookResponseDataEvent = "meeting.ended"
const WebhookEditWebhookResponseDataEventMeetingParticipantJoined WebhookEditWebhookResponseDataEvent = "meeting.participantJoined"
const WebhookEditWebhookResponseDataEventMeetingParticipantLeft WebhookEditWebhookResponseDataEvent = "meeting.participantLeft"
const WebhookEditWebhookResponseDataEventMeetingChatSynced WebhookEditWebhookResponseDataEvent = "meeting.chatSynced"
const WebhookEditWebhookResponseDataEventRecordingStatusUpdate WebhookEditWebhookResponseDataEvent = "recording.statusUpdate"
const WebhookEditWebhookResponseDataEventLivestreamingStatusUpdate WebhookEditWebhookResponseDataEvent = "livestreaming.statusUpdate"
const WebhookEditWebhookResponseDataEventMeetingTranscript WebhookEditWebhookResponseDataEvent = "meeting.transcript"
const WebhookEditWebhookResponseDataEventMeetingSummary WebhookEditWebhookResponseDataEvent = "meeting.summary"
Name string

Name of the webhook

UpdatedAt Time

Timestamp when this webhook was updated

formatdate-time
URL string

URL the webhook will send events to

formaturi
Success bool

Edit 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.EditWebhook(
    context.TODO(),
    "app_id",
    "webhook_id",
    realtime_kit.WebhookEditWebhookParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  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"