---
title: "Upsert a contact"
method: POST
path: "/api/public/customer/upsert/info"
tags: ["Customer"]
---

# Upsert a contact

`POST /api/public/customer/upsert/info`

Creates or finds an existing contact for whatsapp, web-whatsapp, or webchat channels. For whatsapp/web-whatsapp, the contact is identified by phone number. For webchat, the contact is identified by external_user_id. Optionally assigns an agent, updates metadata, sets a stage, and upserts custom field values on the associated customer.

## Headers

- `x-api-key` string, required

## Request body

- UpsertCustomerBodyDto
  - `channel_phone_number` string — Phone number or ID of the channel. Required for whatsapp/web-whatsapp.
  - `channel_id` string, uuid — UUID of the webchat channel. Required for webchat.
  - `channel` 'whatsapp' | 'web-whatsapp' | 'webchat', required — Channel type for the contact.
  - `stageId` string, uuid — Stage ID to assign to the contact.
  - `agentId` string, uuid — Agent ID to assign to the contact.
  - `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.
  - `contact_email` string — Email of the contact.
  - `contact_name` string — Display name of the contact.
  - `meta_data` object, required — Arbitrary metadata to set on the contact.
  - `custom_field_values` object[] — Custom field values to upsert on the customer, identified by definition key.
    - `key` string, required — The custom field definition key.
    - `value` string, required — The value to set.

## Response `201`

Contact created or found successfully.

## Other responses

- `400` — Bad request. Missing required fields for the given channel, or custom field definition keys not found.
- `401` — Unauthorized. Invalid API key.

---

[API](https://skmtc.net/vambe/apis/vambe-ai-api.md) · [All operations](https://skmtc.net/vambe/apis/vambe-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vambe/vambe-ai-api/revisions/e206709d4be5/schema)
