---
title: "[BETA] add and update contact"
method: POST
path: "/instances/{id}/client/action/upsert-contact"
tags: ["contact"]
---

# [BETA] add and update contact

`POST /instances/{id}/client/action/upsert-contact`

Creates a new contact or updates an existing one in the address book. The contact will be synchronized to the device's address book if syncToAddressbook is true. Note: This endpoint is currently in beta and may change without notice.

## Path parameters

- `id` integer, required

## Request body

- object
  - `phoneNumber` string, required — The phone number of the contact
  - `firstName` string, required — The first name of the contact
  - `lastName` string, required — The last name of the contact
  - `syncToAddressbook` boolean — Whether to sync the contact to the device's address book

## Response `200`

Contact saved or updated successfully

- object
  - `instanceId` string
  - `data` object
    - `chatId` object
      - `server` string
      - `user` string
      - `_serialized` string
  - `links` object
    - `self` string
  - `status` 'success' | 'error'

## Other responses

- `401` — Unauthorized — invalid or missing bearer token
- `403` — Forbidden — insufficient permissions or account blocked
- `404` — Not found — instance does not exist or does not belong to you
- `409` — Conflict — instance is not ready
- `422` — Validation error — invalid or missing request parameters
- `429` — Too many requests — rate limit exceeded

---

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