{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-contact-event-schema.json",
  "title": "ContactEvent",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-events-api-openapi.yml#/components/schemas/ContactEvent",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "contactId": {
      "$ref": "#/$defs/ContactId"
    },
    "name": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "api",
        "samva"
      ]
    },
    "properties": {
      "$ref": "#/$defs/JsonObject"
    },
    "occurredAt": {
      "type": "string"
    },
    "recordedAt": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "contactId",
    "name",
    "source",
    "properties",
    "occurredAt",
    "recordedAt"
  ],
  "additionalProperties": false,
  "$defs": {
    "ContactId": {
      "type": "string",
      "pattern": "^contact_[0-9a-hjkmnp-tv-z]{16,24}$",
      "x-samva-brand": "ContactId"
    },
    "JsonObject": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/JsonValue"
      }
    },
    "JsonValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/JsonValue"
          }
        },
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
          }
        }
      ]
    }
  }
}