Skip to main content
POST
Python
This endpoint performs an upsert: it first tries to match by email, then falls back to phone if no email match is found. If no match is found, a new contact is created.

How Matching Works

The endpoint matches contacts in this order:
1

Match by email

If email is provided, searches for an existing contact with the same email in your company.
2

Match by phone

If no email match is found and phone is provided, searches by phone number.
3

Create new

If no match is found, creates a new contact.
Need to update a contact’s email? Prefer Update by ID for a deterministic update. Upsert only avoids creating a new record if a phone number is also provided and matches an existing contact.

Custom Fields

Store additional data using the customFields object. Fields are flexible key-value pairs:
When updating an existing contact, custom fields are deep merged — only the fields you include are changed, existing fields are preserved. Control channel-specific marketing consent when creating or updating a contact:
Both fields are optional. Omitting a channel leaves its current consent status unchanged. Setting true opts the contact in, false opts them out.

Phone Numbers

For WhatsApp messaging, include a phone number in E.164 format:
Format requirements:
  • Include country code (e.g., +39 for Italy, +1 for US)
  • No spaces, dashes, or parentheses
  • Example: +12025551234 (US), +393391234567 (Italy)
Invalid phone numbers will cause WhatsApp message sending to fail.

Common Errors

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

email
string
required

Email address of the contact

phone
string

Phone number of the contact

status
string

Contact status

source
string

Contact source tag

sourceType
enum<string>

Contact source type classification

Available options:
database,
minimo,
third_party
customFields
object

Custom fields specific to the contact

Channel-specific marketing consent preferences

Response

Successful response

data
object[]