---
title: "PUT /contacts/{contactId}"
method: PUT
path: "/contacts/{contactId}"
tags: ["Contacts"]
---

# PUT /contacts/{contactId}

`PUT /contacts/{contactId}`

Updates a customer contact or site contact.

  - **firstName** is required
  - NOTE: To update the main contact of a `CUSTOMER`, please use the /customers endpoint.
    - When the contact to update is of type `CUSTOMER`:
      - **isMain** cannot be set to true and is optional. To update the main contact, use the '/customers' endpoint.
      - **isBilling** is optional and defaults to false.
  - NOTE: To unset the main contact of a `SITE` as non-main is not allowed, either use the create endpoint or update another contact of this site and set it as the main contact.
    - When the contact to update is of type `SITE`:
      - **isMain** is optional and defaults to false.
      - **isBilling** is optional and defaults to false.
      - If the contact to update is the main and billing contact of the `SITE`, the **isBilling** flag will have no impact and the contact details will be updated. If you want to change the contact that is assigned as the billing contact, please use the create method or update another contact of this site and set it as a billing contact.
  - **contactItems** is required and must contain at least one item.
    - It will replace the existing contact items.
    - To update a specific contact item, you have to provide the id of the contact item to update. Otherwise, new contact items will be added.

## Path parameters

- `contactId` integer, required

## Request body

- UpdateContactPayload
  - `firstName` string, required
  - `lastName` string
  - `position` string
  - `company` string
  - `isMain` boolean
  - `isBilling` boolean
  - `contactItems` ContactItemPayload[], required
    - `id` number
    - `contactType` 'email' | 'phone' | 'mobile' | 'other' | 'fax' | 'website', required — The type of this contact item. It can be one of the following: email, phone, mobile, other, fax, website
    - `contactValue` string, required — The value of this contact item.

## Response `200`

Successful Response

- ContactByIdResponse
  - `result` string, required
  - `data` Contact, required
    - `id` number, required
    - `firstName` string, nullable, required
    - `lastName` string, nullable, required
    - `position` string, nullable, required
    - `company` string, nullable, required
    - `contactItems` ContactItem[], nullable, required
      - `id` number, required
      - `contactType` 'email' | 'phone' | 'mobile' | 'other' | 'fax' | 'website', required — The type of this contact item. It can be one of the following: email, phone, mobile, other, fax, website
      - `contactValue` string, required — The value of this contact item.
    - `contactType` 'CUSTOMER' | 'SITE', required
    - `isMain` boolean, required
    - `isBilling` boolean, required
    - `customerId` number, nullable, required
    - `siteId` number, nullable, required
    - `createdAt` string, date-time, nullable, required
    - `modifiedAt` string, date-time, nullable, required
    - `links` Links[], required
      - `href` string, required
      - `rel` string, required
      - `type` 'GET' | 'POST' | 'PUT' | 'PATCH', required

## Other responses

- `4XX` — Client Request Errors
- `5XX` — Server Errors

---

[API](https://skmtc.dev/fergus/apis/fergus-api.md) · [All operations](https://skmtc.dev/fergus/apis/fergus-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fergus/fergus-api/revisions/b4f232a22363/schema)
