{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-phone-number-schema.json",
  "title": "phoneNumber",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-contacts-api-openapi.yml#/components/schemas/phoneNumber",
  "allOf": [
    {
      "$ref": "#/$defs/phoneNumberLink"
    },
    {
      "type": "object",
      "properties": {
        "number": {
          "type": "string",
          "description": "10 digit phone number.",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^\\d{10}$"
        },
        "ext": {
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/phoneNumberTypesEnum",
          "description": "The type or classification of the phone number. Determines the primary use case for this contact method."
        },
        "primary": {
          "type": "boolean",
          "description": "Is this phone number the primary phone number for the related entity?",
          "readOnly": true
        },
        "smsOptOut": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "This value specifies if SMS messaging is active for this contact number."
        }
      }
    }
  ],
  "$defs": {
    "phoneNumberLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The GUID of the Phone Number.",
          "format": "uuid",
          "readOnly": true
        },
        "_link": {
          "type": "string",
          "description": "The URI of the Phone Number.",
          "readOnly": true
        }
      }
    },
    "phoneNumberTypesEnum": {
      "type": "string",
      "enum": [
        "Home",
        "Mobile",
        "Work"
      ],
      "default": "Home"
    }
  }
}