{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/samva-dev/json-schema/samva-dev-contact-event-page-schema.json",
  "title": "ContactEventPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/samva-dev-contact-events-api-openapi.yml#/components/schemas/ContactEventPage",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContactEvent"
      }
    },
    "nextCursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "items",
    "nextCursor"
  ],
  "additionalProperties": false,
  "$defs": {
    "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
    },
    "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"
          }
        }
      ]
    }
  }
}