> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.moyoinnovations.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.moyoinnovations.com/_mcp/server.

# Webhooks

> Get notified in your own systems when something changes in Moyo Suite.

A webhook sends an HTTPS `POST` to your URL each time an event you subscribe
to happens in your workspace. Use them to keep an accounting system,
Zapier/Make scenario, or ERP in sync without polling.

## Setting up an endpoint

Add an endpoint under **Settings → Webhooks**: enter the URL and choose the
events to receive, or `*` for all of them. The signing secret is shown once,
when you create the endpoint; rotate it from the same screen.

You can only subscribe to the events listed below. The API rejects any
other name with `422`, and `GET /api/v1/webhooks/events` returns the same
list.

## Events

### CRM

| Event                  | When it is sent                                |
| ---------------------- | ---------------------------------------------- |
| `lead.created`         | A lead was created.                            |
| `lead.updated`         | A lead's details were changed.                 |
| `lead.deleted`         | A lead was deleted.                            |
| `contact.created`      | A contact was created.                         |
| `contact.updated`      | A contact's details were changed.              |
| `contact.deleted`      | A contact was deleted.                         |
| `account.created`      | An account was created.                        |
| `account.updated`      | An account's details were changed.             |
| `account.deleted`      | An account was deleted.                        |
| `deal.created`         | A deal was created.                            |
| `deal.updated`         | A deal's details were changed.                 |
| `deal.stage_updated`   | A deal moved to another pipeline stage.        |
| `deal.deleted`         | A deal was deleted.                            |
| `activity.created`     | An activity (task, call, meeting) was created. |
| `activity.completed`   | An activity was marked complete.               |
| `conversation.created` | A new conversation was started.                |

### Billing

| Event                | When it is sent                                                                                         |
| -------------------- | ------------------------------------------------------------------------------------------------------- |
| `invoice.created`    | An invoice was created (as a draft).                                                                    |
| `invoice.sent`       | An invoice was issued to the customer (left draft/pending).                                             |
| `invoice.paid`       | An invoice became fully paid (by payments and/or credit notes).                                         |
| `invoice.voided`     | An invoice was cancelled or voided.                                                                     |
| `payment.received`   | A payment was recorded against an invoice.                                                              |
| `credit_note.issued` | A credit or debit note was issued against an invoice. The payload's `note_type` is `credit` or `debit`. |
| `quotation.sent`     | A quotation was sent to the customer.                                                                   |
| `quotation.accepted` | A quotation was accepted.                                                                               |
| `quotation.rejected` | A quotation was rejected.                                                                               |

### Expense

| Event               | When it is sent                              |
| ------------------- | -------------------------------------------- |
| `expense.submitted` | An expense claim was submitted for approval. |
| `expense.approved`  | An expense claim was approved.               |
| `expense.rejected`  | An expense claim was rejected.               |

### Inventory

| Event                       | When it is sent                                    |
| --------------------------- | -------------------------------------------------- |
| `stock.adjusted`            | A product's stock quantity changed.                |
| `stock.below_reorder_point` | A product's stock dropped below its reorder point. |

### Workspace

| Event                  | When it is sent                          |
| ---------------------- | ---------------------------------------- |
| `subscription.changed` | The workspace's plan or modules changed. |

## Payload

Every delivery has the same envelope. The event's own fields are in `data`.

```json
{
  "id": "5b7a0e8e-6a0c-4a51-9d1e-0f3b9a7c2d10",
  "event": "invoice.paid",
  "api_version": "2026-10-01",
  "occurred_at": "2026-10-01T09:30:12.481Z",
  "tenant_id": "0c1f6d2e-9a54-4b7e-8d3f-2b1a7e6c5d4f",
  "data": {
    "invoice_id": "9f2d4c1a-3b5e-4f6a-8c7d-1e2f3a4b5c6d",
    "invoice_number": "INV-00042",
    "account_id": "7a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5d",
    "status": "paid",
    "previous_status": "sent",
    "currency": "USD",
    "total": "1200.00",
    "amount_paid": "1200.00",
    "amount_credited": "0.00",
    "due_date": "2026-10-15"
  }
}
```

* `id` identifies the event. Retries of the same event reuse it, so use it
  to ignore duplicates.
* Money amounts are strings, so no precision is lost.
* The eight original CRM events (`lead.created`, `contact.created`,
  `account.created`, `deal.created`, `deal.stage_updated`,
  `activity.created`, `activity.completed`, `conversation.created`) also
  repeat their `data` fields at the top level, as they always have.
  Integrations built before `api_version` 2026-10-01 keep working.

## Verifying a delivery

Each request carries these headers:

| Header             | Value                                 |
| ------------------ | ------------------------------------- |
| `X-Moyo-Event`     | The event name, e.g. `invoice.paid`   |
| `X-Moyo-Delivery`  | A unique id for this delivery attempt |
| `X-Moyo-Signature` | `t=<unix timestamp>,v1=<signature>`   |

The signature is an HMAC-SHA256, keyed with your endpoint's secret, of
`<timestamp>.<raw request body>`. Compute it over the exact bytes you
received and compare it with `v1` using a constant-time comparison. Reject
requests whose timestamp is more than a few minutes old.

## Retries

A delivery that doesn't get a `2xx` response is retried up to 6 times. The
wait starts at 30 seconds and doubles after each attempt, up to 30 minutes.
Each attempt is listed under the endpoint's delivery history, where you can
also redeliver it by hand.

## Failing endpoints are switched off

If an endpoint's last 5 deliveries all use up their retries without a `2xx`,
Moyo switches the endpoint off and emails the workspace owners with the
endpoint, the last event and the last error. Events that happen while it is off
are not replayed. Fix your receiver, turn the endpoint back on under **Settings
→ Webhooks**, and use **Redeliver** on any failed deliveries you still need.

## Related

* [Data Import & Export](/guides/data-import-export)
* [Team & Permissions](/guides/team-permissions): managing webhooks needs
  the `core:webhook` permissions.