{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usebondery-com/json-schema/usebondery-com-contact-schema.json",
  "title": "Contact",
  "description": "Contact read model",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usebondery-com-openapi.yaml#/components/schemas/Contact",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier"
    },
    "userId": {
      "type": "string",
      "description": "Owner account identifier"
    },
    "addresses": {
      "description": "Postal addresses for this contact",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "addressCity": {
            "description": "City name",
            "type": [
              "string",
              "null"
            ]
          },
          "addressCountry": {
            "description": "Country name",
            "type": [
              "string",
              "null"
            ]
          },
          "addressCountryCode": {
            "description": "ISO 3166-1 alpha-2 country code",
            "type": [
              "string",
              "null"
            ]
          },
          "addressFormatted": {
            "description": "Full address on one line",
            "type": [
              "string",
              "null"
            ]
          },
          "addressGeocodeSource": {
            "description": "How the coordinates were resolved",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "mapy.com",
              "manual"
            ]
          },
          "addressGranularity": {
            "type": "string",
            "enum": [
              "address",
              "city",
              "state",
              "country"
            ],
            "description": "Most specific part of the address that is known"
          },
          "addressLine1": {
            "description": "Street and house number",
            "type": [
              "string",
              "null"
            ]
          },
          "addressLine2": {
            "description": "Second address line, such as a unit",
            "type": [
              "string",
              "null"
            ]
          },
          "addressPostalCode": {
            "description": "Postal or ZIP code",
            "type": [
              "string",
              "null"
            ]
          },
          "addressState": {
            "description": "State or region name",
            "type": [
              "string",
              "null"
            ]
          },
          "addressStateCode": {
            "description": "State or region code",
            "type": [
              "string",
              "null"
            ]
          },
          "geocodeConfidence": {
            "description": "Whether the geocoder verified this address",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "verified",
              "unverifiable"
            ]
          },
          "label": {
            "description": "Custom label for the address",
            "type": [
              "string",
              "null"
            ]
          },
          "latitude": {
            "description": "Latitude in decimal degrees",
            "type": [
              "number",
              "null"
            ]
          },
          "longitude": {
            "description": "Longitude in decimal degrees",
            "type": [
              "number",
              "null"
            ]
          },
          "timezone": {
            "description": "IANA timezone name for this address",
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "home",
              "work",
              "other"
            ],
            "description": "Address category"
          },
          "value": {
            "type": "string",
            "description": "Display value of the address"
          }
        },
        "required": [
          "addressCity",
          "addressCountry",
          "addressCountryCode",
          "addressFormatted",
          "addressGeocodeSource",
          "addressGranularity",
          "addressLine1",
          "addressLine2",
          "addressPostalCode",
          "addressState",
          "addressStateCode",
          "geocodeConfidence",
          "label",
          "latitude",
          "longitude",
          "timezone",
          "type",
          "value"
        ],
        "additionalProperties": false
      }
    },
    "avatar": {
      "description": "Avatar image URL, or null when unset",
      "type": [
        "string",
        "null"
      ]
    },
    "emails": {
      "description": "Email addresses for this contact",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "preferred": {
            "type": "boolean",
            "description": "True when this is the contact's primary email address"
          },
          "type": {
            "type": "string",
            "enum": [
              "home",
              "work"
            ],
            "description": "Email category, such as home or work"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Email address"
          }
        },
        "required": [
          "preferred",
          "type",
          "value"
        ],
        "additionalProperties": false
      }
    },
    "facebook": {
      "description": "Facebook profile URL or handle",
      "type": [
        "string",
        "null"
      ]
    },
    "firstName": {
      "type": "string",
      "description": "Given name"
    },
    "gisPoint": {
      "nullable": true,
      "description": "PostGIS point for map placement"
    },
    "headline": {
      "description": "Short role or description line",
      "type": [
        "string",
        "null"
      ]
    },
    "importantDates": {
      "description": "Birthdays and other recurring dates",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier"
          },
          "userId": {
            "type": "string",
            "description": "Owner account identifier"
          },
          "personId": {
            "type": "string",
            "description": "Contact this date belongs to"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Date in `YYYY-MM-DD` form. The year is ignored for yearly repeats."
          },
          "type": {
            "type": "string",
            "enum": [
              "birthday",
              "anniversary",
              "nameday",
              "graduation",
              "other"
            ],
            "description": "Kind of important date, such as birthday or anniversary"
          },
          "note": {
            "description": "Free-text note for this date",
            "type": [
              "string",
              "null"
            ]
          },
          "notifyDaysBefore": {
            "description": "Days before the date to send a reminder. Null disables reminders.",
            "type": [
              "integer",
              "null"
            ],
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "notifyOn": {
            "description": "Computed date on which the reminder fires",
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$",
            "description": "Creation time as ISO 8601 with timezone offset"
          },
          "updatedAt": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$",
            "description": "Last update time as ISO 8601 with timezone offset"
          }
        },
        "required": [
          "id",
          "userId",
          "personId",
          "date",
          "type",
          "note",
          "notifyDaysBefore",
          "notifyOn",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "instagram": {
      "description": "Instagram profile URL or handle",
      "type": [
        "string",
        "null"
      ]
    },
    "keepFrequencyDays": {
      "description": "Days between keep-in-touch reminders. Null disables reminders.",
      "type": [
        "number",
        "null"
      ]
    },
    "language": {
      "description": "Preferred language tag",
      "type": [
        "string",
        "null"
      ]
    },
    "lastInteraction": {
      "description": "Timestamp of the most recent interaction",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$"
    },
    "lastInteractionActivityId": {
      "description": "Identifier of the most recent interaction",
      "type": [
        "string",
        "null"
      ]
    },
    "lastName": {
      "description": "Family name",
      "type": [
        "string",
        "null"
      ]
    },
    "latitude": {
      "description": "Latitude in decimal degrees",
      "type": [
        "number",
        "null"
      ]
    },
    "linkedin": {
      "description": "LinkedIn profile URL",
      "type": [
        "string",
        "null"
      ]
    },
    "location": {
      "description": "Free-text location",
      "type": [
        "string",
        "null"
      ]
    },
    "longitude": {
      "description": "Longitude in decimal degrees",
      "type": [
        "number",
        "null"
      ]
    },
    "middleName": {
      "description": "Middle name",
      "type": [
        "string",
        "null"
      ]
    },
    "myself": {
      "description": "True when this contact is the account owner",
      "type": [
        "boolean",
        "null"
      ]
    },
    "notes": {
      "description": "Free-text notes",
      "type": [
        "string",
        "null"
      ]
    },
    "notesUpdatedAt": {
      "description": "Timestamp of the last notes edit",
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$"
    },
    "phones": {
      "description": "Phone numbers for this contact",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "object",
        "properties": {
          "preferred": {
            "type": "boolean",
            "description": "True when this is the contact's primary phone number"
          },
          "prefix": {
            "type": "string",
            "minLength": 1,
            "description": "Country calling code, digits only"
          },
          "type": {
            "type": "string",
            "enum": [
              "home",
              "work"
            ],
            "description": "Phone category, such as home or work"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "description": "Phone number in local or international form"
          }
        },
        "required": [
          "preferred",
          "prefix",
          "type",
          "value"
        ],
        "additionalProperties": false
      }
    },
    "position": {
      "description": "Custom position payload",
      "nullable": true
    },
    "signal": {
      "description": "Signal username",
      "type": [
        "string",
        "null"
      ]
    },
    "timezone": {
      "description": "IANA timezone name",
      "type": [
        "string",
        "null"
      ]
    },
    "website": {
      "description": "Personal or company website URL",
      "type": [
        "string",
        "null"
      ]
    },
    "whatsapp": {
      "description": "WhatsApp number",
      "type": [
        "string",
        "null"
      ]
    },
    "createdAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$",
      "description": "Creation time as ISO 8601 with timezone offset"
    },
    "updatedAt": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,9})?(?:Z|[+-]\\d{2}:\\d{2})$",
      "description": "Last update time as ISO 8601 with timezone offset"
    }
  },
  "required": [
    "id",
    "userId",
    "avatar",
    "emails",
    "facebook",
    "firstName",
    "gisPoint",
    "headline",
    "instagram",
    "keepFrequencyDays",
    "language",
    "lastInteraction",
    "lastInteractionActivityId",
    "lastName",
    "latitude",
    "linkedin",
    "location",
    "longitude",
    "middleName",
    "myself",
    "notes",
    "phones",
    "signal",
    "timezone",
    "website",
    "whatsapp",
    "createdAt",
    "updatedAt"
  ],
  "additionalProperties": false
}