{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peoplescourt-ai/json-schema/peoplescourt-ai-evidence-export-notification-schema.json",
  "title": "EvidenceExportNotification",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peoplescourt-ai-openapi.json#/components/schemas/EvidenceExportNotification",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "eventId",
    "eventType",
    "occurredAt",
    "exporterId",
    "specVersion",
    "exportId",
    "exportVersion",
    "bundleHash",
    "contentType",
    "byteLength",
    "downloadUrl",
    "downloadExpiresAt",
    "match"
  ],
  "properties": {
    "schemaVersion": {
      "type": "string",
      "const": "evidence-export-notification-v1"
    },
    "eventId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{1,160}$"
    },
    "eventType": {
      "type": "string",
      "const": "evidence.bundle.available"
    },
    "occurredAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
    },
    "exporterId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{1,200}$"
    },
    "specVersion": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{1,200}$"
    },
    "exportId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{1,200}$"
    },
    "exportVersion": {
      "type": "integer",
      "minimum": 1
    },
    "supersedes": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "exportId",
        "exportVersion",
        "sha256"
      ],
      "properties": {
        "exportId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "exportVersion": {
          "type": "integer",
          "minimum": 1
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "bundleHash": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "algorithm",
        "value"
      ],
      "properties": {
        "algorithm": {
          "type": "string",
          "const": "sha256"
        },
        "value": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      }
    },
    "contentType": {
      "type": "string",
      "const": "application/json"
    },
    "byteLength": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10485760
    },
    "downloadUrl": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "pattern": "^https://(?![^/?#]*@)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)*[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?::(?:0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))?(?:[/?][^#\\s]*)?$",
      "description": "HTTPS URL with a conventional DNS hostname whose final label begins with an ASCII letter, an optional canonical decimal port from 0 through 65535, and no user information or fragment. IP literals and other WHATWG normalization forms are intentionally outside this conservative published schema; runtime URL parsing remains authoritative."
    },
    "downloadExpiresAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
    },
    "match": {
      "type": "object",
      "additionalProperties": false,
      "minProperties": 1,
      "properties": {
        "externalCaseId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "transactionId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "merchantId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "network": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "transactionHash": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        }
      }
    },
    "retention": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "profileId": {
          "type": "string",
          "pattern": "^[A-Za-z0-9._:-]{1,200}$"
        },
        "sourceRetentionUntil": {
          "type": "string",
          "format": "date-time",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
        },
        "sourceLegalHoldActive": {
          "type": "boolean"
        }
      }
    }
  }
}