# createContact

Create a contact; needs sellerFirstName, sellerLastName, and type (LISTING | INVESTMENT | BUYER | UNDETERMINED); phones/emails optional. Search findContacts by the name and each phone/email first: a match is a same-person-or-new question for the user BEFORE creating.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "createContact", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `CreateContactInput!` (required)
  - `address`: `AddressInput`
    - `id`: `String`
    - `line1`: `String!` (required)
    - `line2`: `String`
    - `city`: `String!` (required)
    - `state`: `String!` (required)
    - `zip`: `String!` (required)
  - `addressString`: `String`
  - `type`: `PipelineItemType` (one of `LISTING`, `INVESTMENT`, `UNDETERMINED`, `BUYER`)
  - `sellerFirstName`: `String!` (required)
  - `sellerLastName`: `String!` (required)
  - `addMailingAddresses`: `[CreateContactMailingAddressInput!]`
    - `addressString`: `String!` (required). Raw single-line address; resolved via MailingAddressResolutionService (property → address → raw).
    - `propertyElasticsearchId`: `ID`. Instant-duplicate case: the property (Property.id / esId) the user copied this mailing address from: e.g. "use my subject property as the mailing address". When set, the mailing row links straight to that property (no ES search).
    - `verificationStatus`: `VerificationStatus` (one of `VERIFIED`, `UNVERIFIED`, `WRONG`)
    - `ranking`: `Int`. Display order; lower is higher (0 = primary).
  - `addPhoneNumbers`: `[CreateContactPhoneNumberInput!]`
    - `phoneNumber`: `String!` (required)
    - `verificationStatus`: `VerificationStatus!` (required, one of `VERIFIED`, `UNVERIFIED`, `WRONG`)
    - `phoneType`: `PhoneType` (one of `MOBILE`, `RESIDENTIAL`, `LANDLINE`, `UNKNOWN`)
    - `note`: `String`
    - `ranking`: `Int`
  - `addEmails`: `[CreateContactEmailInput!]`
    - `email`: `String!` (required)
    - `verificationStatus`: `VerificationStatus!` (required, one of `VERIFIED`, `UNVERIFIED`, `WRONG`)
    - `note`: `String`
    - `ranking`: `Int`
  - `addCustomFieldValues`: `[CreateContactCustomFieldInput!]`
    - `customFieldId`: `String!` (required)
    - `textValue`: `String`
    - `calendarDate`: `String`. Preferred DATE value as a strict calendar day (YYYY-MM-DD). Do not combine with dateValue.
    - `dateValue`: `DateTime`. Legacy DATE compatibility input. Prefer calendarDate for new clients; do not combine both forms.
    - `numberValue`: `Float`
    - `dropdownSelectedValues`: `[String!]`
  - `subContacts`: `[CreateSubContactInput!]`
    - `name`: `String!` (required)
    - `relation`: `String`
    - `note`: `String`
    - `phoneNumbers`: `[CreateContactPhoneNumberInput!]`
      - `phoneNumber`: `String!` (required)
      - `verificationStatus`: `VerificationStatus!` (required, one of `VERIFIED`, `UNVERIFIED`, `WRONG`)
      - `phoneType`: `PhoneType` (one of `MOBILE`, `RESIDENTIAL`, `LANDLINE`, `UNKNOWN`)
      - `note`: `String`
      - `ranking`: `Int`
    - `emails`: `[CreateContactEmailInput!]`
      - `email`: `String!` (required)
      - `verificationStatus`: `VerificationStatus!` (required, one of `VERIFIED`, `UNVERIFIED`, `WRONG`)
      - `note`: `String`
      - `ranking`: `Int`
  - `addUserGroupIds`: `[ID!]`

## Response (data, an example)

```json
{
  "contactMutation": {
    "createContact": {
      "id": "<ID>",
      "name": "…",
      "createdAt": "2026-01-01T00:00:00.000Z",
      "emails": [
        {
          "id": "<ID>",
          "email": "…",
          "verificationStatus": "VERIFIED"
        }
      ],
      "phoneNumbers": [
        {
          "id": "<ID>",
          "phoneNumber": "…",
          "phoneType": "MOBILE",
          "verificationStatus": "VERIFIED"
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "createContact",
    "variables": {
      "input": {
        "sellerFirstName": "<String>",
        "sellerLastName": "<String>"
      }
    }
  }'
```
