---
title: "Replace a contact"
method: PATCH
path: "/contacts/{id}"
tags: ["Contacts"]
---

# Replace a contact

`PATCH /contacts/{id}`

## Request

- Base URL: `https://yungle.co/api/v1`
- URL: `https://yungle.co/api/v1/contacts/{id}`
- Auth: HTTP bearer

A full replacement, not a merge: any field you omit is cleared. Send the whole contact back.

## Request body

- object
  - `firstName` string, nullable
  - `lastName` string, nullable
  - `company` string, nullable
  - `email` string, required: The only required field. Case-insensitive and unique per workspace.
  - `phone` string, nullable
  - `type` string, nullable: client | colleague | partner | friend | family | other. Unknown values become "other".

## Response `200`

The updated contact.

- object
  - `contact` Contact, required
    - `id` string, required
    - `firstName` string, nullable, required
    - `lastName` string, nullable, required
    - `company` string, nullable, required
    - `email` string, required
    - `phone` string, nullable, required
    - `type` string, required: Currently one of: `client`, `friend`, `colleague`, `family`, `partner`, `other`. Treat unknown values as unknown, not as an error.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400`: The request was malformed or failed validation. Codes: `invalid_request`, `folder_error`.
- `401`: Missing or invalid credential. Codes: `unauthorized`.
- `402`: Needs a paid plan, or prepaid credit for metered usage. Codes: `upgrade_required`, `out_of_credit`.
- `403`: The credential lacks a required scope, or a shared link refused access. Codes: `insufficient_scope`, `password_required`, `wrong_password`, `guests_only`.
- `404`: No such resource in this workspace. Codes: `not_found`.
- `409`: Already exists, an Idempotency-Key conflict, or end-to-end encrypted content the server cannot serve. Codes: `conflict`, `e2ee_unsupported`.
- `429`: Rate limit or email budget exhausted. Wait for `Retry-After`. Codes: `rate_limited`, `email_budget_exhausted`.
- `500`: Our fault. `details.requestId` ties it to our logs. Codes: `internal_error`.

---

[API](https://skmtc.dev/yungle/apis/yungle-api.md) · [All operations](https://skmtc.dev/yungle/apis/yungle-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yungle/apis/yungle-api/revisions/fee7cb2d7419?raw)
