{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-contact-post-schema.json",
  "title": "contactPost",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-contacts-api-openapi.yml#/components/schemas/contactPost",
  "type": "object",
  "properties": {
    "contactTypeIds": {
      "type": "array",
      "items": {
        "format": "uuid",
        "description": "Contact type unique identifier"
      },
      "minItems": 1
    },
    "firstName": {
      "type": "string",
      "description": "First name of the contact."
    },
    "lastName": {
      "type": "string",
      "description": "Last name of the contact."
    },
    "crossReference": {
      "type": "string",
      "description": "CrossReference of the contact."
    },
    "companyName": {
      "type": "string",
      "description": "Company name of the contact."
    },
    "companyJobTitle": {
      "type": "string",
      "description": "Job title of the contact."
    },
    "note": {
      "type": "string",
      "description": "A note for the contact."
    },
    "phoneNumbers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/contactPhoneNumber"
      }
    },
    "emailAddresses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/contactEmailAddress"
      }
    },
    "mailingAddress": {
      "$ref": "#/$defs/contactAddress"
    },
    "billingAddress": {
      "$ref": "#/$defs/contactAddress"
    },
    "billingAddressSameAsMailingAddress": {
      "type": "boolean",
      "description": "Indicates if the billing address is the same as mailing address"
    }
  },
  "$defs": {
    "contactAddress": {
      "type": "object",
      "properties": {
        "street1": {
          "type": "string"
        },
        "street2": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "zipCode": {
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/contactState"
        },
        "country": {
          "$ref": "#/$defs/contactCountry"
        }
      }
    },
    "contactCountry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The id for the Country."
        }
      }
    },
    "contactEmailAddress": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "format": "email",
          "description": "Contact email address"
        },
        "primary": {
          "type": "boolean",
          "description": "Indicates if it is the primary email address"
        },
        "type": {
          "type": "string",
          "enum": [
            "Personal",
            "Work",
            "Other"
          ],
          "description": "The type of email"
        }
      }
    },
    "contactPhoneNumber": {
      "type": "object",
      "required": [
        "number",
        "type"
      ],
      "properties": {
        "number": {
          "type": "string",
          "description": "10 digit phone number.",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^\\d{10}$"
        },
        "ext": {
          "type": "string",
          "description": "Phone extension. Used for routing calls to a specific department or individual within the organization."
        },
        "primary": {
          "type": "boolean",
          "description": "Indicates if it's the primary phone number"
        },
        "hasTextingAvailable": {
          "type": "boolean",
          "description": "Indicates whether SMS/text messaging is enabled for this phone number. When true, the contact can receive text messages at this number."
        },
        "type": {
          "$ref": "#/$defs/phoneNumberTypesEnum",
          "description": "The type or classification of the phone number. Determines the primary use case for this contact method."
        }
      }
    },
    "contactState": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The id for the state."
        }
      }
    },
    "phoneNumberTypesEnum": {
      "type": "string",
      "enum": [
        "Home",
        "Mobile",
        "Work"
      ],
      "default": "Home"
    }
  }
}