# Connect n8n to Customermates: Webhooks, REST API

Connect n8n with a Webhook node for CRM changes and HTTP Request nodes for the Customermates REST API; the MCP endpoint is there for JSON-RPC clients. The [Customermates community node](https://github.com/customermates/n8n-nodes-crm) (`@customermates/n8n-nodes-crm`) supports the configurable record API from version 2.0.0; update older installs before using its CRM operations.

## When does n8n fit?

n8n fits when your team prefers visual flows over code, when record events need transforming before they go to another service, or when you already run n8n for other automations. For conversational CRM work, use [MCP](/docs/mcp) alongside or instead.

## How do I trigger n8n from CRM changes?

**Add a Webhook node in n8n**

Copy the URL it generates.

**Subscribe in Customermates**

Open [Webhooks](https://customermates.com/dashboard?open=%2Fsettings%2Fwebhooks), click [Add](https://customermates.com/dashboard?open=%2Fsettings%2Fwebhooks%3Ffocus%3Dcontrol%253Asettings-webhooks-add) and paste the URL. Under **Events**, select **Record created**, **Record updated** or **Record moved to Trash**, then choose the list and optional filters to watch. Add a **Secret** and click **Save**. Creating a webhook needs **Create** on **API & Webhooks**.

**Handle the payload**

Verify the signature, then use the event ID and the stable `typeId`/`recordId` reference from the record event payload in downstream steps.

With the [Customermates community node](https://github.com/customermates/n8n-nodes-crm), its **Customermates Trigger** creates this webhook subscription for you when the workflow is activated (published).

[Webhooks](/docs/webhooks) documents payloads, retries and signature verification. Deliveries can arrive out of order or repeat; deduplicate by event ID.

## When does a trigger start receiving events?

Since n8n 2.x, activation returns before n8n has finished setting up the trigger. The subscription usually exists within a second, and changes made before then are not delivered later. If something activates a workflow and immediately creates records, first wait until n8n's `GET /rest/workflows/{id}/publication-status` reports `published`, or until the subscription appears under [Webhooks](https://customermates.com/dashboard?open=%2Fsettings%2Fwebhooks). Self-hosted n8n can restore waiting activation with `N8N_USE_WORKFLOW_PUBLICATION_SERVICE=false`.

## How do I create, read, update or delete records from n8n?

Use an **HTTP Request** node with an `x-api-key` credential and JSON matching the [OpenAPI spec](/docs/openapi). The record routes work for every list in your workspace:

| Goal | Method and path |
|---|---|
| Find lists by name | `POST /api/v1/model/discover` |
| Read fields, relationships and stable IDs | `POST /api/v1/model/read` |
| Query or search records | `POST /api/v1/records/query` or `POST /api/v1/records/search` |
| Read one record | `POST /api/v1/records/read` |
| Create, update, delete, link, or unlink | `POST /api/v1/records/mutate` |
| Preview a deletion | `POST /api/v1/records/preview-deletion` |
| Export (JSON or XLSX) or import | `POST /api/v1/records/export` or `POST /api/v1/records/import` |
| List, restore or permanently delete Trash items | `POST /api/v1/trash/query`, `POST /api/v1/trash/restore`, `POST /api/v1/trash/preview`, `POST /api/v1/trash/delete-permanently` or `POST /api/v1/trash/empty` |
| Preview or apply a configuration change | `POST /api/v1/model/preview` or `POST /api/v1/model/apply` |
| Aggregate values for a report | `POST /api/v1/reports/query` |
| Follow, cancel or resume a pending operation | `POST /api/v1/operations/status`, `POST /api/v1/operations/cancel` or `POST /api/v1/operations/resume` |

**Breaking change:** these routes replaced the former entity-specific endpoints, which were removed. Update HTTP Request nodes that still call a contact, organization, deal, service or task endpoint.

**Breaking change:** Email and Phone are no longer field types. When the contact details update is installed, each former Email or Phone field moves into its list's contact details field (the field type Phone, email & social, value type `channels`): the old field ID disappears from records, the record model, exports and webhook events, and its addresses and numbers are read and written as `identities` of the record, with `provider` `mail` or `phone` and the address or number as `value`. Update n8n workflows, HTTP Request nodes and other REST clients that read, filter or write the old field IDs: send `identities` inside the `create` or `update` mutation of `POST /api/v1/records/mutate`, with the identities to keep, and read them from `identities` in record responses and `data.record.identities` in webhook events. A field that could not be moved stays a Text field with its ID, for example one that a webhook body template names.

The base URL is the address at which you open Customermates. A mutation carries a stable `typeId`, an idempotency key and the expected configuration revision; updates and deletes also carry the record reference and expected version. Fields are typed assignments, and links name a relationship definition. A deletion may require a current impact preview hash. See [filter syntax](/docs/filter-syntax) for query shapes.

## How do I call MCP tools from n8n?

Send `POST <BASE_URL>/api/v1/mcp` with `Content-Type: application/json`, `Accept: application/json, text/event-stream` and your `x-api-key` credential. For example, to discover record types:

```json
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"discover_record_types","arguments":{}}}
```

The result may arrive as a server-sent event; parse the JSON-RPC `data:` line. A tool refusal has `result.isError: true`, and arguments outside a tool's schema are rejected before execution. Use `get_record_model` to read IDs, `query_crm_records` to query and `mutate_crm_record` to change a record or link. See the [MCP catalog](/docs/mcp#tool-catalog).

## How do I run scheduled jobs?

n8n's schedule trigger plus the record API can find records matching a saved query, export them or apply a validated mutation. A [Customermates routine](/docs/app-routines) can instead run Mate on a schedule inside the product. Deal stages, task priorities and your own lists are workspace configuration; discover their IDs before filtering or writing.

## How does authentication work?

Open [API keys & connectors](https://customermates.com/dashboard?open=%2Fsettings%2Fconnections) and create a key with [Add](https://customermates.com/dashboard?open=%2Fsettings%2Fconnections%3Ffocus%3Dcontrol%253Asettings-api-keys-generate). Store it as an n8n **Header Auth** credential named `x-api-key` and reuse that credential across nodes. The key acts with its owner's permissions. A wrong, expired or deleted key gets an authentication failure, and a key of an inactive owner cannot act. See [API keys](/docs/api-keys).

## What are the common gotchas?

- **Relationships:** use `mutate_crm_record` with `link` or `unlink`; do not send legacy arrays such as `organizationIds`.
- **Retries:** reuse the same idempotency key for the exact same mutation payload. A changed payload needs a new key.
- **Webhooks:** deliveries are not strictly ordered or exactly once. Deduplicate by event ID and use the payload timestamp for ordering.

## Does n8n work on the Free plan?

The n8n trigger needs a webhook, so it does not work while a workspace on Customermates Cloud is on Free: creating the subscription is refused with the Starter price in the message, and an existing trigger receives nothing until the workspace chooses a paid plan. Actions that read or write records go through the REST API and count toward the Free request limit of 30 per minute and 200 per day. Self-hosted installs have no such limit.

## Next

- [Webhooks](/docs/webhooks): event payloads and delivery.
- [OpenAPI](/docs/openapi): REST contracts.
- [MCP](/docs/mcp): AI and tool calls.
