> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paubox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook client

> Manage webhook endpoints with the Paubox Go SDK.

Webhook methods are on the same `*paubox.Client` you use to send email.

```go theme={null}
client, err := paubox.NewClient("YOUR_API_KEY")
```

## List webhook endpoints

```go theme={null}
endpoints, err := client.ListWebhookEndpoints(ctx)
for _, ep := range endpoints {
    fmt.Printf("%d: %s (active: %v)\n", ep.ID, ep.TargetURL, ep.Active)
}
```

## Create a webhook endpoint

```go theme={null}
endpoint, err := client.CreateWebhookEndpoint(ctx, &paubox.CreateWebhookEndpointRequest{
    TargetURL:  "https://example.com/webhooks/paubox",
    Events:     []string{"inbound_mail_received", "api_mail_log_delivered"},
    SigningKey:  "whsec_abc123",
})
```

## Get a webhook endpoint

```go theme={null}
endpoint, err := client.GetWebhookEndpoint(ctx, 42)
```

## Update a webhook endpoint

```go theme={null}
active := false
endpoint, err := client.UpdateWebhookEndpoint(ctx, 42, &paubox.UpdateWebhookEndpointRequest{
    Active: &active,
})
```

## Delete a webhook endpoint

```go theme={null}
deleted, err := client.DeleteWebhookEndpoint(ctx, 42)
```
