> For the complete documentation index, see [llms.txt](https://run.emailchaser.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://run.emailchaser.com/api-reference/webhooks.md).

# Webhooks

## List webhooks

> Lists all registered webhook endpoints for the authenticated user's space.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.ListWebhooksResponse":{"type":"object","properties":{"total":{"type":"integer"},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/models.WebhookResponse"}}}},"models.WebhookResponse":{"type":"object","properties":{"createdAt":{"type":"string"},"id":{"type":"integer"},"isEnabled":{"type":"boolean"},"name":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/webhooks":{"get":{"description":"Lists all registered webhook endpoints for the authenticated user's space.","tags":["Webhooks"],"summary":"List webhooks","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ListWebhooksResponse"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"500":{"description":"Failed to retrieve webhooks","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorResponse"}}}}}}}}}
```

## Register a webhook

> Registers a webhook endpoint that will be called when the given event type occurs (e.g. LeadCreated, CampaignStatusChanged, EmailReply). The URL must use HTTPS.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.RegisterWebhookResponse":{"type":"object","properties":{"message":{"type":"string"},"webhook":{"$ref":"#/components/schemas/models.WebhookResponse"}}},"models.WebhookResponse":{"type":"object","properties":{"createdAt":{"type":"string"},"id":{"type":"integer"},"isEnabled":{"type":"boolean"},"name":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}}},"models.ErrorInvalidWebhookType":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToRegisterWebhook":{"type":"object","properties":{"error":{"type":"string"}}},"models.RegisterWebhookRequest":{"type":"object","required":["type","url"],"properties":{"name":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}}}}},"paths":{"/webhooks":{"post":{"description":"Registers a webhook endpoint that will be called when the given event type occurs (e.g. LeadCreated, CampaignStatusChanged, EmailReply). The URL must use HTTPS.","tags":["Webhooks"],"summary":"Register a webhook","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true}],"responses":{"201":{"description":"Webhook registered successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.RegisterWebhookResponse"}}}},"400":{"description":"Invalid request body, webhook type or URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidWebhookType"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"500":{"description":"Failed to register webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToRegisterWebhook"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.RegisterWebhookRequest"}}},"description":"Webhook to register","required":true}}}}}
```

## Update a webhook

> Updates a registered webhook's name, URL, event type or enabled state. Only provided fields are changed. Disabling a webhook stops deliveries without deleting it.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.UpdateWebhookResponse":{"type":"object","properties":{"message":{"type":"string"},"webhook":{"$ref":"#/components/schemas/models.WebhookResponse"}}},"models.WebhookResponse":{"type":"object","properties":{"createdAt":{"type":"string"},"id":{"type":"integer"},"isEnabled":{"type":"boolean"},"name":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}}},"models.ErrorInvalidWebhookType":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorWebhookNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToUpdateWebhook":{"type":"object","properties":{"error":{"type":"string"}}},"models.UpdateWebhookRequest":{"type":"object","properties":{"isEnabled":{"type":"boolean"},"name":{"type":"string","maxLength":255,"minLength":1},"type":{"type":"string"},"url":{"type":"string"}}}}},"paths":{"/webhooks/{id}":{"put":{"description":"Updates a registered webhook's name, URL, event type or enabled state. Only provided fields are changed. Disabling a webhook stops deliveries without deleting it.","tags":["Webhooks"],"summary":"Update a webhook","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Webhook ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Webhook updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateWebhookResponse"}}}},"400":{"description":"Invalid webhook ID, request body, type or URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidWebhookType"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorWebhookNotFound"}}}},"500":{"description":"Failed to update webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToUpdateWebhook"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.UpdateWebhookRequest"}}},"description":"Webhook fields to update","required":true}}}}}
```

## Delete a webhook

> Deletes a registered webhook endpoint. Events of its type will no longer be delivered to its URL.

```json
{"openapi":"3.1.1","info":{"title":"Emailchaser API","version":"1.0"},"servers":[{"url":"https://api.emailchaser.com/r"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"models.DeleteWebhookResponse":{"type":"object","properties":{"id":{"type":"integer"},"message":{"type":"string"}}},"models.ErrorInvalidWebhookID":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorUnauthorized":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorWebhookNotFound":{"type":"object","properties":{"error":{"type":"string"}}},"models.ErrorFailedToDeleteWebhook":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/webhooks/{id}":{"delete":{"description":"Deletes a registered webhook endpoint. Events of its type will no longer be delivered to its URL.","tags":["Webhooks"],"summary":"Delete a webhook","parameters":[{"schema":{"type":"string"},"description":"Bearer <API_KEY>","name":"Authorization","in":"header","required":true},{"schema":{"type":"integer"},"description":"Webhook ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"Webhook deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.DeleteWebhookResponse"}}}},"400":{"description":"Invalid webhook ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorInvalidWebhookID"}}}},"401":{"description":"Unauthorized - invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorUnauthorized"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorWebhookNotFound"}}}},"500":{"description":"Failed to delete webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/models.ErrorFailedToDeleteWebhook"}}}}}}}}}
```
