{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postzen-dev/json-schema/postzen-dev-contact-update-request-schema.json",
  "title": "ContactUpdateRequest",
  "description": "Partial update. profileId cannot be changed; channel fields and unknown keys are rejected with 400 validation. Tags replace the array and customFields replaces the whole object.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postzen-dev-openapi.json#/components/schemas/ContactUpdateRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Trimmed contact name, 1–200 characters.",
      "minLength": 1,
      "maxLength": 200
    },
    "email": {
      "type": [
        "string",
        "null"
      ],
      "description": "Trimmed lowercase email; unique within its profile. Send null to clear.",
      "maxLength": 254,
      "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
    },
    "company": {
      "type": [
        "string",
        "null"
      ],
      "description": "Company name, at most 200 characters. Send null to clear.",
      "maxLength": 200
    },
    "avatarUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public HTTPS avatar URL, canonicalized on PATCH; inbox avatars are stored as supplied by the platform. Send null to clear.",
      "format": "uri",
      "maxLength": 2048
    },
    "tags": {
      "type": "array",
      "description": "At most 50 tags, trimmed and deduplicated case-insensitively, preserving original case. Send [] to clear.",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 50
      },
      "maxItems": 50
    },
    "isSubscribed": {
      "type": "boolean",
      "description": "Contact subscription state. False prevents comment automation sends.",
      "default": true
    },
    "isBlocked": {
      "type": "boolean",
      "description": "Blocked contacts cannot receive comment automation sends.",
      "default": false
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-form notes, at most 5000 characters. Send null to clear.",
      "maxLength": 5000
    },
    "customFields": {
      "type": [
        "object",
        "null"
      ],
      "description": "At most 50 keys of 1–64 characters. Keys follow Convex record rules: printable ASCII, not starting with $ or _. Values are strings (at most 1000 characters), finite numbers, booleans, or null. PATCH replaces the entire object. Send null to clear.",
      "maxProperties": 50,
      "propertyNames": {
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^(?![$_])[\\x20-\\x7e]+$"
      },
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "maxLength": 1000
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          }
        ]
      }
    }
  },
  "required": [],
  "additionalProperties": false
}