Skip to content
Start here

Webhooks

List webhooks
client.Alerting.Destinations.Webhooks.List(ctx, query) (*SinglePage[Webhooks], error)
GET/accounts/{account_id}/alerting/v3/destinations/webhooks
Get a webhook
client.Alerting.Destinations.Webhooks.Get(ctx, webhookID, query) (*Webhooks, error)
GET/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
Create a webhook
client.Alerting.Destinations.Webhooks.New(ctx, params) (*DestinationWebhookNewResponse, error)
POST/accounts/{account_id}/alerting/v3/destinations/webhooks
Update a webhook
client.Alerting.Destinations.Webhooks.Update(ctx, webhookID, params) (*DestinationWebhookUpdateResponse, error)
PUT/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
Delete a webhook
client.Alerting.Destinations.Webhooks.Delete(ctx, webhookID, body) (*DestinationWebhookDeleteResponse, error)
DELETE/accounts/{account_id}/alerting/v3/destinations/webhooks/{webhook_id}
ModelsExpand Collapse
type Webhooks struct{…}
ID stringoptional

The unique identifier of a webhook

maxLength32
CreatedAt Timeoptional

Timestamp of when the webhook destination was created.

formatdate-time
LastFailure Timeoptional

Timestamp of the last time an attempt to dispatch a notification to this webhook failed.

formatdate-time
LastSuccess Timeoptional

Timestamp of the last time Cloudflare was able to successfully dispatch a notification using this webhook.

formatdate-time
Name stringoptional

The name of the webhook destination. This will be included in the request body when you receive a webhook notification.

Secret stringoptional

Optional secret that will be passed in the cf-webhook-auth header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body.

Type WebhooksTypeoptional

Type of webhook endpoint.

One of the following:
const WebhooksTypeDatadog WebhooksType = "datadog"
const WebhooksTypeDiscord WebhooksType = "discord"
const WebhooksTypeFeishu WebhooksType = "feishu"
const WebhooksTypeGchat WebhooksType = "gchat"
const WebhooksTypeGeneric WebhooksType = "generic"
const WebhooksTypeOpsgenie WebhooksType = "opsgenie"
const WebhooksTypeSlack WebhooksType = "slack"
const WebhooksTypeSplunk WebhooksType = "splunk"
URL stringoptional

The POST endpoint to call when dispatching a notification.