> For the complete documentation index, see [llms.txt](https://docs.insurgrid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.insurgrid.com/get-started/04-webhook-endpoint.md).

# Set up a webhook endpoint

A webhook endpoint is just a URL on your server that accepts an HTTP `POST`. When something happens, InsurGrid sends the data there. This is the one prerequisite the webhook quickstarts need.

## The rules

Your endpoint must:

1. **Be reachable over HTTPS.** Not plain HTTP. (In local development you'll get an HTTPS URL with a tunnel — see [next page](https://docs.insurgrid.com/get-started/05-local-development.md).)
2. **Accept a `POST`** with a JSON body.
3. **Return a `2xx` status quickly.**

> **New term — `2xx`:** any HTTP status code from 200 to 299 (like `200 OK` or `202 Accepted`). To InsurGrid it means "I received it, thanks." Anything else (or a timeout) tells us delivery failed, and we'll retry.

## Acknowledge first, work later

Return `2xx` *immediately*, then do your real processing (saving to your database, calling other services) afterwards — in a background job, a queue, or after you've sent the response.

Why: we expect a fast acknowledgement. If your handler does slow work *before* replying, you may time out, we'll count it as failed, and we'll retry — so you'd process the same event several times.

**Do this:**

```js
// server (Node/Express)
app.post("/hooks/insurgrid", (req, res) => {
  res.sendStatus(200);        // acknowledge first
  queue.add("process-webhook", req.body);   // then work, off the request
});
```

**Not this:**

```js
// server — DON'T: slow work before replying
app.post("/hooks/insurgrid", async (req, res) => {
  await doSlowProcessing(req.body);   // may time out → we retry → duplicate work
  res.sendStatus(200);
});
```

## Register it

In your dashboard, open **Webhooks → Endpoint** while the toggle at the top right shows **Test mode**. Enter the endpoint's URL, tick the events you want to receive, choose an authentication type, and select **Register endpoint**. You get one endpoint per mode — you'll register your production endpoint in **Live** mode later.

The full walkthrough, including every authentication option, is in [Endpoint](https://docs.insurgrid.com/data-webhook-page/destination.md).

{% hint style="warning" %}
The default authentication, **No authentication**, sends requests with no credentials you can verify. It's fine while testing; before you go live, pick **HMAC (SHA-256) signature** so you can [verify every request](https://docs.insurgrid.com/guides/signing-verification.md).
{% endhint %}

You now have everything you need. Continue to the [first quickstart](https://docs.insurgrid.com/quickstarts/a-receive-policy-data.md) — but if you're developing locally, read the next page first.

Next: [Expose your local endpoint →](https://docs.insurgrid.com/get-started/05-local-development.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.insurgrid.com/get-started/04-webhook-endpoint.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
