Skip to main content

Method

func (s *WebhooksSvcImpl) Update(webhookId string, params *UpdateWebhookRequest) (*UpdateWebhookResponse, error)
func (s *WebhooksSvcImpl) UpdateWithContext(ctx context.Context, webhookId string, params *UpdateWebhookRequest) (*UpdateWebhookResponse, error)

Parameters

webhookId
string
required
The unique identifier of the webhook to update
params
*UpdateWebhookRequest
required
The webhook update parameters
Endpoint
*string
The new URL endpoint for the webhook
Events
[]string
Updated array of event types to subscribe to
Status
*string
The new status for the webhook

Response

Object
string
Always "webhook"
Id
string
The unique identifier of the updated webhook

Example

client := resend.NewClient("re_123456789")

newEndpoint := "https://example.com/webhooks/new-endpoint"
params := &resend.UpdateWebhookRequest{
    Endpoint: &newEndpoint,
    Events: []string{
        resend.EventEmailSent,
        resend.EventEmailDelivered,
    },
}

response, err := client.Webhooks.Update("wh_abc123", params)
if err != nil {
    panic(err)
}

fmt.Println("Updated webhook:", response.Id)

Build docs developers (and LLMs) love