---
updatedAt: 2026-07-13T17:57:57.000Z
agentTools:
  projectIndex: https://docs.endearhq.com/llms.txt
---

# Send customer data

## Merge semantics

Endear automatically deduplicates customer profiles in the background. The system runs every few hours, so duplicates may appear briefly in the customer list before resolving on their own — no manual action is required.

Records are merged when:

* **Email matches** — Identical email addresses are the primary signal and always trigger a merge.
* **Phone number + name similarity** — A matching phone number combined with names that are at least 80% similar will merge profiles even when their email addresses differ.

When two profiles merge:

* All data consolidates into a single profile.
* Transaction history and customer interactions are preserved.
* The most complete profile becomes the primary record.

For duplicates the automated system doesn't catch, customers can also be merged manually in the Endear app. See [Understanding Endear's automated customer deduplication process](https://help.endearhq.com/en/articles/11879254-understanding-endear-s-automated-customer-deduplication-process) for more detail.

## Custom fields

Customers support custom fields keyed by name. Define them either:

* Directly in the Endear app, or
* Programmatically via the [`createCustomerField`](https://docs.endearhq.com/reference/customers#createcustomerfield) mutation.

Once a field is defined, set values on each customer through the `custom_fields` array on `bulkUpsertExternalCustomers`.

## Push customer records

### Example customer records

Let's assume you have customers that look something like this:

| id      | first\_name | last\_name | email\_address         | tags     | created\_at          | updated\_at          | deleted\_at          |
| :------ | :---------- | :--------- | :--------------------- | :------- | :------------------- | :------------------- | :------------------- |
| cust\_1 | Jane        | Doe        | <jane.doe@example.com> | \["vip"] | 2023-04-21T17:08:47Z | 2023-05-09T11:18:12Z |                      |
| cust\_2 | John        | Doe        | <john.doe@example.com> | \[]      | 2023-04-21T17:08:47Z | 2023-05-09T11:18:12Z | 2023-05-09T11:18:12Z |
| cust\_3 |             |            | <josh.doe@example.com> | \[]      | 2023-04-21T17:08:47Z | 2023-05-09T11:18:12Z |                      |

### Example mutation

You can push these records using any HTTP compatible library:

```Text JavaScript
fetch("https://api.endearhq.com", {
  method: "POST",
  headers: {
    "content-type": "application/json",
    "x-endear-api-key": "{{API_KEY}}",
  },
  body: JSON.stringify({
    query: `
      mutation BulkUpsertExternalCustomers($customers: [ExternalCustomerInput!]!) {
        bulkUpsertExternalCustomers(customers: $customers) {
            status
        }
      }
    `,
    variables: {
      customers: [
      	{
          id: "cust_1",
          first_name: "Jane",
          last_name: "Doe",
          email_address: "jane.doe@example.com",
          tags: ["vip"],
          created_at: "2023-04-21T17:08:47Z",
          updated_at: "2023-05-09T11:18:12Z",
          deleted_at: null,
        },
        {
          id: "cust_2",
          first_name: "John",
          last_name: "Doe",
          email_address: "john.doe@example.com",
          tags: [],
          created_at: "2023-04-21T17:08:47Z",
          updated_at: "2023-05-09T11:18:12Z",
          deleted_at: "2023-05-09T11:18:12Z",
        },
        {
          id: "cust_3",
          first_name: null,
          last_name: null,
          email_address: "josh.doe@example.com",
          tags: [],
          created_at: "2023-04-21T17:08:47Z",
          updated_at: "2023-05-09T11:18:12Z",
          deleted_at: null,
        }
      ],
    },
  }),
});
```