Skip to content
Start here

View webhooks

client.Stream.Webhooks.Get(ctx, query) (*WebhookGetResponse, error)
GET/accounts/{account_id}/stream/webhook

Retrieves a list of webhooks.

Security
API Token

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

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Stream WriteStream Read
ParametersExpand Collapse
query WebhookGetParams
AccountID param.Field[string]Optional

The account identifier tag.

maxLength32
ReturnsExpand Collapse
type WebhookGetResponse struct{…}
Modified TimeOptional

The date and time the webhook was last modified.

formatdate-time
NotificationURL stringOptional

The URL where webhooks will be sent.

formaturi
NotificationURL stringOptional

The URL where webhooks will be sent.

formaturi
Secret stringOptional

The secret used to verify webhook signatures.

View webhooks

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/stream"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  webhook, err := client.Stream.Webhooks.Get(context.TODO(), stream.WebhookGetParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", webhook.Modified)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "modified": "2014-01-02T02:20:00Z",
    "notification_url": "https://example.com",
    "notificationUrl": "https://example.com",
    "secret": "secret"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "modified": "2014-01-02T02:20:00Z",
    "notification_url": "https://example.com",
    "notificationUrl": "https://example.com",
    "secret": "secret"
  }
}