mndrAPI Docs
Contacts

Upsert Contact

Create or update a contact by email in a single call.

POST /api/v1/contacts/upsert

The most commonly used endpoint for integrations. If the email exists, the contact is updated — merging custom fields and preserving existing values for unset fields.

Parameters

Same as Create Contactemail is required, all other fields are optional.

Merge Behavior

  • phone, firstName, lastName — updates only if provided (non-null)
  • customFields — deep-merged with existing fields
  • tags — replaces existing tags only if provided and non-empty
  • emailSubscriptionStatus, whatsappSubscriptionStatus — updates only if provided

Example

Request
curl -X POST /api/v1/contacts/upsert \
  -H "x-api-key: mndr_..." \
  -H "Content-Type: application/json" \
  -d '{
  "email": "jane@example.com",
  "firstName": "Jane",
  "customFields": { "plan": "pro" }
}'
Response — new contact (201)
{
  "contact": { ... },
  "created": true
}
Response — existing contact updated (200)
{
  "contact": { ... },
  "created": false
}

On this page