---
title: "POST /contacts"
method: POST
path: "/contacts"
tags: ["Contacts"]
---

# POST /contacts

`POST /contacts`

Creates a new contact for a customer or site.

  - **firstName** is required
  - **email** is optional and must be a valid email address when provided. This will be added as a contact item.
  - At least one contact item is required: provide **email** and/or at least one entry in **contactItems**.
  - **contactType** is required and must be one of the following: `CUSTOMER`, `SITE`.
    - When **contactType** is `CUSTOMER`:
      - **customerId** is required
      - **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.
    - When **contactType** is `SITE`:
      - **siteId** is required
      - **isMain** is optional and defaults to false.
      - **isBilling** is optional and defaults to false.

## Request body

- CreateContactPayload
  - `firstName` string, required
  - `lastName` string
  - `position` string
  - `company` string
  - `contactItems` ContactItemPayload[]
    - `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.
  - `email` string, email
  - `isMain` boolean
  - `isBilling` boolean
  - `siteId` number
  - `customerId` number
  - `contactType` 'CUSTOMER' | 'SITE', required

## Response `201`

Resource created successfully

- 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)
