{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nice/json-schema/nice-job-interactions-page-schema.json",
  "title": "JobInteractionsPage",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nice-generic-storeandforward-openapi.yml#/components/schemas/JobInteractionsPage",
  "type": "object",
  "required": [
    "tenantId",
    "jobId",
    "interactions"
  ],
  "properties": {
    "tenantId": {
      "type": "string"
    },
    "jobId": {
      "type": "string"
    },
    "interactions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InteractionStatusView"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "InteractionErrorCode": {
      "type": "string",
      "description": "Error code when status is FAILED. When errorCode is MALWARE_DETECTED or TIME_LIMIT_EXCEEDED, the interaction is removed from the deduplication table to allow re-ingestion after remediation."
    },
    "InteractionStatus": {
      "type": "string",
      "description": "Interaction-level status lifecycle: PROCESSING (initial), WAITING_FOR_MEDIA_UPLOAD (awaiting media), SUCCEEDED (final success), FAILED (final failure).",
      "enum": [
        "PROCESSING",
        "WAITING_FOR_MEDIA_UPLOAD",
        "SUCCEEDED",
        "FAILED"
      ]
    },
    "InteractionStatusView": {
      "type": "object",
      "required": [
        "systemName",
        "interactionId",
        "status"
      ],
      "properties": {
        "systemName": {
          "type": "string",
          "description": "Display name of the source system (from leadingAgent's externalIdentifier)"
        },
        "interactionId": {
          "type": "string",
          "description": "Source system interaction identifier (externalInteractionId from input)"
        },
        "status": {
          "$ref": "#/$defs/InteractionStatus"
        },
        "finalizedAt": {
          "type": "string",
          "format": "date-time"
        },
        "errorCode": {
          "$ref": "#/$defs/InteractionErrorCode"
        },
        "errorMessage": {
          "type": "string"
        },
        "mediaExpectedCount": {
          "type": "integer"
        },
        "mediaUploadedCount": {
          "type": "integer"
        },
        "scanResults": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  }
}