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

# Webhooks

> Receive HTTP calls from automation flows into your own systems.

The **Webhook step** in an [automation](/automations/steps) sends an HTTP request to a URL you control whenever a contact reaches that point in the flow. It's the bridge from Retainful's marketing logic back into your stack.

## What you can do with it

* Notify your backend when a customer enters a win-back flow, so support sees it in your CRM.
* Post to a Slack webhook when a VIP segment member abandons a large cart.
* Trigger a fulfillment-side action — add a gift, flag an account — when a flow milestone is reached.
* Feed your data warehouse with flow progress, joined later against revenue.

## Configure a webhook step

1. In the automation canvas, add a **Webhook** step where you want the call to fire.
2. Enter the **URL** of your endpoint (HTTPS).
3. The step sends the contact and event context as a JSON `POST` body — the same data available to that point of the flow (contact profile fields, trigger event payload).

## Building a reliable receiver

```javascript Express example theme={null}
app.post("/hooks/retainful", (req, res) => {
  // 1. Acknowledge fast — do the real work async
  res.status(200).end();

  // 2. Process from a queue, not inline
  queue.add("retainful-webhook", req.body);
});
```

* **Respond quickly with a 2xx.** Do slow work (database writes, third-party calls) after acknowledging, not before.
* **Expect retries and duplicates.** Network blips can cause re-delivery — make your handler idempotent (dedupe on contact + step + timestamp).
* **Validate what you receive.** Treat the payload as untrusted input; check the fields you depend on exist before using them.
* **Keep the URL secret-ish.** Use an unguessable path or a query token (`/hooks/retainful?token=...`) and reject calls without it.

## Inbound webhooks (into Retainful)

Going the other direction — your systems telling Retainful something happened — isn't a webhook you configure; it's the [Events API](/developers/api/events). Store webhooks from Shopify and WooCommerce are managed automatically by the [integrations](/integrations/overview) and need no setup from you.
