PgBeam Docs
Webhooks

UpdateWebhookEndpoint

Update a webhook endpoint

Updates a webhook endpoint.

Usage

result, err := client.Webhooks.UpdateWebhookEndpoint(ctx, "prj_xxx", "whk_xxx", pgbeam.WebhookEndpointInput{
    URL: "https://example.com/hooks/pgbeam",
  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
webhookIDstringYesUnique webhook endpoint identifier (prefixed, e.g. whk_xxx).
reqpgbeam.WebhookEndpointInputYesRequest body
req.URLstringYesHTTPS endpoint that receives event deliveries.
req.Secret*stringNoShared secret used to sign delivery payloads. Write-only.
req.Format*stringNoPayload format for delivered events.
req.EventTypes*[]stringNoEvent types to deliver. Empty means all events.
req.Enabled*boolNoWhether deliveries are active for this endpoint.
req.Description*stringNoHuman-readable label for the endpoint.

Response

(*pgbeam.WebhookEndpoint, error) — updated webhook endpoint.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Webhooks.UpdateWebhookEndpoint(ctx, "prj_xxx", "whk_xxx", pgbeam.WebhookEndpointInput{
    URL: "https://example.com/hooks/pgbeam",
    Secret: "...",
    Format: "json",
    EventTypes: nil,
    Enabled: true,
    Description: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.

On this page