---
updatedAt: 2026-11-03T17:10:16.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Real-Time Contact Updating

We recommend regularly updating contacts via the Backend API (server-to-server) when some contact updates happen in your app's backend and frontend.

Let’s consider updating contacts in detail.

## Using Backend API

Transfer contact data to eSputnik using the `Add/update a contact` API method.

The method creates a new or updates an existing contact in real time (**synchronously**). This means when you receive the `200` response you can be sure that contact data is already actualized in eSputnik.

For example, you can use the `Add/update a contact` method to collect data on subscription changes.

**Features:**

* One request allows you to add or update one contact.
* If a contact card with an identifier from the request already exists in eSputnik, it will be updated. A contact will be created with all additional data from the request if it hasn't existed.
* When updating a contact using [Add/update a contact](https://docs.esputnik.com/reference/addcontact-1), the request updates only the fields it carries. Fields omitted from the request keep their current values.

**Method type**: `POST`. The description of the method, fields, and request body format are available [here](https://docs.esputnik.com/reference/addcontact-1).

**URL to send request:** `https://api.esputnik.com/api/v1/contact`

Identical requests to [Add/update a contact](https://docs.esputnik.com/reference/addcontact-1) sent within one minute are treated as duplicates. Requests to [Generate event v3](https://docs.esputnik.com/reference/registerevent_2) do not have this deduplication: identical event requests are processed separately. A request with a different payload is a different request. A repeated request gets the `409 Duplicated request` response without the contact ID. To get the ID, find the contact by `externalCustomerId` with [Search contacts](https://docs.esputnik.com/reference/searchcontacts-1).

A client-side timeout doesn't mean the data wasn't saved: the request can reach the system and be processed after the client stops waiting for the response. Repeating it is safe — if the first request was processed, deduplication prevents the contact from being created twice, and the response is `409 Duplicated request`.

Deduplication looks at the request body, not at how the first attempt ended. If a malformed body was rejected with `400`, sending the same body again within a minute returns `409 Duplicated request` and hides the original error. Read the response to the first attempt, not to the repeats.

If you send an `Add/update a contact` request with an existing contact's phone number but a new email address, the method creates a new contact by default instead of updating the existing one — email takes priority for matching. To deduplicate by phone instead, use the bulk [Add/update contacts](https://docs.esputnik.com/reference/contactsbulkupdate-1) method with `dedupeOn: sms` in the request body.

If you send an event that starts a workflow for this contact, wait for the response confirming the contact was created before sending the event — otherwise the workflow can start before the contact ID exists, and the sending block will fail with an error. As an extra safeguard, add the **Timer** and **Get contact** blocks at the start of the workflow.

<Callout icon="📘" theme="info">
  You need to obtain an [API key](https://docs.esputnik.com/reference/api-keys#creating-a-key) and use it for authentication. This key provides access to your eSputnik account, so make sure to keep it secure and never expose it publicly or through insecure communication channels.
</Callout>

### API Use Case for Web-to-App Project

1. A user has completed onboarding on the site (answered the questionnaire questions).

2. The `Add/update a contact` API method creates a contact profile with data collected on the site and external ID as the main identifier.

3. The user has downloaded and opened the mobile app.

4. SDK creates the anonymous contact with the Device ID.

5. The user logged in to the app.

6. The `SetUserAttributes` request with the external ID updates the existing contact with the Device ID and push token and deletes the anonymous contact.

## Updating a Contact by ID

[Update a contact](https://docs.esputnik.com/reference/updatecontact-1) identifies the contact by the ID in the request URL. The `dedupeOn` parameter isn't used here — it belongs to the **[Add/update contacts](https://docs.esputnik.com/reference/contactsbulkupdate-1)** bulk API method (`v1/contacts`).

The request needs only the fields you want to change: `channels` is optional, and fields omitted from the request keep their current values.

This method also restores a deleted contact: the profile returns from **Deleted** with the values from the request. A contact deleted with `erase=true` isn't restored: the request creates a new contact with a new ID and only the data from the request.