Skip to main content
POST

Overview

Create or update a customer contact with intelligent AI-powered data processing. This endpoint automatically creates the contact if it doesn’t exist, or updates it if it does, along with optional metadata, custom field values, stage assignment, and agent assignment - all in a single request. Supports WhatsApp, Web-WhatsApp, and Webchat channels. For WhatsApp-based channels the contact is identified by phone number; for webchat, the contact is identified by an external user ID you provide.

Use Cases

  • CRM Data Import: Bulk import customer data from external CRM systems
  • Form Submissions: Create customers from web form submissions with flexible data
  • E-commerce Integration: Sync customer data from your e-commerce platform
  • Lead Capture: Capture leads with any structure of data
  • Customer Onboarding: Create customer profiles during signup flows
  • Data Migration: Migrate customer data from legacy systems
  • Webchat User Tracking: Create contacts for authenticated webchat users with your own external IDs

Authentication

This endpoint requires authentication using an API key. Include your API key in the request header:

Request Body

Common Fields

WhatsApp / Web-WhatsApp Fields

Required when channel is "whatsapp" or "web-whatsapp":

Webchat Fields

Required when channel is "webchat":

Custom Field Values

The custom_field_values array lets you set values on the associated customer using custom field definition keys. Each entry has: If a custom field definition is marked as an identifier, the value will participate in customer deduplication automatically.

Response Structure

Returns the created or updated AI contact object:

Example Requests

WhatsApp Contact

Webchat Contact

Example Response

Common Use Cases

1. Import CRM Data with Custom Fields

2. Create Webchat Contact from Authenticated User

3. Process Form Submission

4. E-commerce Customer Sync

5. Bulk Customer Import

Key Features

Upsert Behavior

The contact lookup depends on the channel:
  • If contact exists: Returns the existing contact and applies any updates (name, agent, stage, metadata, custom fields)
  • If contact doesn’t exist: Creates a new contact and customer
  • Idempotent: Safe to call multiple times with the same data

Custom Field Values

  • Values are set on the customer (not the contact), so they are shared across all contacts for that customer
  • Fields are identified by their definition key (e.g. "rut", "company_name")
  • If a field definition is marked as an identifier, the value participates in automatic customer deduplication
  • All custom field definition keys must exist beforehand; the endpoint returns a 400 error listing any missing keys
  • Supported field types: text, number, date, boolean, options

AI-Powered Data Processing

The meta_data field uses AI to:
  • Extract structured data from unstructured metadata
  • Match fields to your custom field definitions
  • Convert data types automatically
  • Handle flexible formats for phone numbers, dates, etc.

Automatic Processing

All in one request:
  1. Create/update contact
  2. Assign to pipeline stage
  3. Assign to agent
  4. Process and save metadata
  5. Upsert custom field values

Channel Types

Error Responses

Important Notes

  • Channel Phone Number: Must be a WhatsApp number/channel you own and have configured
  • Channel ID: Must be a webchat channel UUID you own
  • External User ID: Your own unique identifier for the webchat user; used to deduplicate contacts
  • Phone Format: Automatically cleaned (spaces, dashes, etc. are removed)
  • Custom Field Keys: Must match existing custom field definitions; create definitions first in the Vambe dashboard
  • AI Processing: Metadata is processed asynchronously with AI
  • Immediate Response: Returns contact immediately, metadata processing continues in background

Best Practices

1. Use Custom Fields for Structured Data

Prefer custom_field_values over meta_data when you have well-defined fields. Custom fields are typed, searchable, and can be marked as identifiers for deduplication.

2. Include Source Information

3. Validate Data Before Sending

Migration from Deprecated Endpoint

If you’re migrating from the deprecated POST /api/public/whatsapp/message/note/send endpoint: Old:
New (This endpoint):
The new endpoint provides better structure and automatic AI processing of all metadata!

Headers

x-api-key
string
required

API key needed to authorize the request

Body

application/json
channel
enum<string>
required

Channel type for the contact.

Available options:
whatsapp,
web-whatsapp,
webchat
channel_phone_number
string

Phone number or ID of the channel. Required for whatsapp/web-whatsapp.

Minimum string length: 1
channel_id
string<uuid>

UUID of the webchat channel. Required for webchat.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
stageId
string<uuid>

Stage ID to assign to the contact.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
agentId
string<uuid>

Agent ID to assign to the contact.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
contact_phone_number
string

Phone number of the contact. Required for whatsapp/web-whatsapp.

external_user_id
string

External user identifier used to find or create the webchat contact. Required for webchat.

Minimum string length: 1
contact_email
string

Email of the contact.

contact_name
string

Display name of the contact.

meta_data
object

Arbitrary metadata to set on the contact.

custom_field_values
object[]

Custom field values to upsert on the customer, identified by definition key.

Response

Contact created or found successfully.