# Webhooks

Mav can tell your systems when something happens to a contact, like a reply, a qualified lead, a call or an opt-out. A webhook is an outbound notification that posts each event you pick to your URL as it happens.

A webhook belongs to your account, not to one agent. It covers every agent, including ones you add later, or only the agents you pick.

To add one in the Mav app, open **Integrations**, then **Outbound**, and click **Add notification**. Pick the agents and the events, choose **Webhook** and enter your URL. Leave every event unchecked to get them all. An agent’s page also lists the notifications that cover it, under **Outbound Notifications**.

To add one from your own code, use the **Webhooks API** below. The Mav app on Zapier uses it too: its New Event trigger adds a webhook when you turn a Zap on and removes it when you turn the Zap off. However a webhook is added, it shows in the same list in the Mav app, and the payload and delivery rules here are the same.

By default Mav posts the payload below as JSON. In the Mav app, set **Encoding** to **Form** to post it as a form instead. To send your own fields, add **Parameters**. Mav then sends only those, in the body of a `POST` or the query of a `GET`. A `GET` needs at least one parameter. Write a field in braces, like `{phone_national}`, `{contact_id}`, `{event}`, `{note}`, `{engagement_id}` or `{agent_name}`, and Mav fills it in from the contact or the event. The contact’s own fields work too. A field with no value sends as blank. A webhook added over the API always posts JSON.

## Payload

Without parameters, each event is one `POST` with this body. `activity` says what happened, and `contact` says who it happened to.

```json
{
  "activity": {
    "type": "outcome",
    "label": "qualified",
    "play_id": null,
    "next_engagement_id": "neg_3Fv8kQz1WpLc6R",
    "note": "Jordan Rivera qualified to talk to a rep.",
    "properties": {},
    "created_at": "2026-10-08T16:55:02Z",
    "updated_at": "2026-10-08T16:55:02Z"
  },
  "contact": {
    "id": "nct_7Hq2xKpR9vLm3N",
    "first_name": "Jordan",
    "last_name": "Rivera",
    "email": "jordan.rivera@example.com",
    "phone": "+13125550142",
    "opted_out": false,
    "created_at": "2026-10-06T16:42:18Z",
    "additional_info": {
      "current_carrier": "Example Mutual",
      "vehicles": [
        {
          "make": "Toyota"
        }
      ],
      "source": "API"
    },
    "referral": {}
  }
}
```

## Fields

- `activity.type` (string, required): `event`, `outcome` or `conversion`.
- `activity.label` (string, required): Which event fired, like `qualified` or `opted_out`. See Events below.
- `activity.next_engagement_id` (string, required): The conversation the event belongs to. Every event in one conversation shares it.
- `activity.play_id` (null): Always `null` on the current Mav app.
- `activity.note` (string): A short summary of what happened, written for people.
- `activity.properties` (object): Extra details some events carry, like the conversion’s title on `custom_conversion`. Often empty.
- `activity.created_at` (ISO 8601 timestamp, required): When it happened.
- `activity.updated_at` (ISO 8601 timestamp, required): When Mav last changed it.
- `contact` (object, required): The contact, with the same fields Find a contact returns. Fields you sent that Mav doesn’t use land in `contact.additional_info` under their own names.

## Authentication

When you add the webhook in the Mav app, set **Auth** to **Bearer** and enter a token. Over the API, send it as `webhook.bearer_token`. Mav sends it as a bearer token on every delivery, so your endpoint can check the request came from Mav.

```http
POST /your/webhook/path
Authorization: Bearer YOUR_WEBHOOK_TOKEN
Content-Type: application/json
User-Agent: Mav/20261008
```

## Testing

Once the webhook is saved, click **Send test** on its row in the list. Mav sends one sample event to your URL right away, with your bearer token, and shows whether it went through or why it failed. Managers and admins see the button.

The sample uses a made-up contact named Test Contact. `activity.label` is the first event you picked, or `started` if you get them all, and `activity.properties.test` is `true` so your code can skip it. Nothing is saved to your account. That means `activity.next_engagement_id`, `activity.created_at`, `activity.updated_at` and `contact.created_at` are `null` in the sample. A failed test isn’t retried.

## Delivery

- **Reply fast.** Mav waits 3 seconds to connect and 3 more for your answer. Reply `200` first, then do the work.
- **Any 2xx counts.** Every other status is a failure. Mav doesn’t follow redirects, so a `3xx` fails too.
- **Failures retry.** Mav retries a failed delivery up to 18 times over about four days. If the last try fails, Mav turns the webhook off and emails your account’s admins and managers, and Mav support. Saving the webhook in the Mav app turns it back on. For a webhook Zapier manages, turn the Zap off and on instead.
- **410 means gone.** If your URL answers `410 Gone`, Mav turns the webhook off right away instead of retrying.
- **Expect repeats.** A retry can deliver an event twice, and payloads carry no event ID. Dedupe on `contact.id`, `activity.label` and `activity.created_at`.
- **Use HTTPS.** Payloads carry your contacts’ personal details.

## Events

Every event you can pick, grouped by `activity.type`.

- `event`: `started`, `interested`, `stopped`, `reengagement_sent`, `phone_call_scheduled`, `phone_call_started`, `phone_call_connected`, `phone_call_rep_attempted`, `phone_call_rep_keys_pressed`, `phone_call_transferred`, `phone_call_transfer_failed`, `phone_call_completed`, `phone_call_missed`, `phone_call_received`, `quote_requested`, `quote_received`, `quote_updated`, `quote_failed`, `quote_agreed`
- `outcome`: `dormant`, `opted_out`, `filtered`, `undeliverable`, `qualified`, `not_interested`, `unqualified`
- `conversion`: `quoted`, `sold`, `link_clicked`, `custom_conversion`
