---
title: "Webhooks"
description: "Check that an event is from Goomzo, and manage your endpoints."
url: "https://docs.goomzo.africa/docs/developers/ts-sdk/webhooks"
docs_index: /llms.txt
lastUpdated: 2026-11-12
section: "Guides"
related:
  - /docs/developers/ts-sdk/messages
  - /docs/developers/ts-sdk/templates
  - /docs/developers/ts-sdk/customers
---

> For an index of all documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt). Any page is also available as Markdown by adding .md to its URL.

# Webhooks

> Check that an event is from Goomzo, and manage your endpoints.

`verifyWebhook` checks an event's signature and timestamp, and answers with the event, typed. See
[Signatures](https://docs.goomzo.africa/docs/developers/webhooks/signatures?utm_source=llms&utm_medium=ai).

## Requirements

- An endpoint, and its signing secret, which starts with `whsec_`. See [Webhooks](https://docs.goomzo.africa/docs/developers/webhooks?utm_source=llms&utm_medium=ai).

## Receive an event

Pass the body exactly as it arrived, as text:

```ts
import { verifyWebhook, WebhookVerificationError } from '@goomzo/sdk'

export async function POST(request: Request) {
  try {
    const event = await verifyWebhook(await request.text(), request.headers, process.env.GOOMZO_WEBHOOK_SECRET!)
    if (event.type === 'message.delivered') {
      await markDelivered(event.data.id)
    }
    return new Response(null, { status: 204 })
  } catch (error) {
    if (error instanceof WebhookVerificationError) return new Response(null, { status: 400 })
    throw error
  }
}
```

**Important:** Don't parse the body as JSON before checking it. The signature is of the body as it arrived.

## Manage endpoints

```ts
const endpoint = await goomzo.webhookEndpoints.create({
  url: 'https://example.com/webhooks/goomzo',
  events: ['message.delivered', 'message.failed'],
})
```

| Method                              | Does                                  |
| ----------------------------------- | ------------------------------------- |
| `webhookEndpoints.list()`           | Lists your endpoints.                 |
| `webhookEndpoints.get(id)`          | Gets one.                             |
| `webhookEndpoints.update(id, body)` | Changes an endpoint, or turns it off. |
| `webhookEndpoints.delete(id)`       | Deletes one.                          |

## Next steps

- [Events](https://docs.goomzo.africa/docs/developers/webhooks/events?utm_source=llms&utm_medium=ai)
- [Errors](https://docs.goomzo.africa/docs/developers/ts-sdk/errors?utm_source=llms&utm_medium=ai)

---

For an index of all available documentation, see [/llms.txt](https://docs.goomzo.africa/llms.txt)
