{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/kontaktio/main/json-schema/kontaktio-external-device-import-response-schema.json",
  "title": "ExternalDeviceImportResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/kontaktio-external-device-api-openapi.yml#/components/schemas/ExternalDeviceImportResponse",
  "type": "object",
  "properties": {
    "jobKey": {
      "type": "string",
      "description": "Id of the job."
    },
    "status": {
      "$ref": "#/$defs/JobStatus"
    },
    "result": {
      "$ref": "#/$defs/ExternalDeviceImportResult"
    }
  },
  "required": [
    "jobKey",
    "status"
  ],
  "$defs": {
    "ExternalDeviceImportResult": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/$defs/ExternalDeviceImportStatus"
        },
        "fileUrl": {
          "type": "string",
          "description": "URL pointing to the CSV file with the import result"
        },
        "errors": {
          "type": "object",
          "description": "List of errors related to the import process",
          "additionalProperties": {
            "type": "string",
            "description": "Error description"
          }
        }
      },
      "description": "Detailed result details of finished external devices import."
    },
    "ExternalDeviceImportStatus": {
      "type": "string",
      "description": "Status of the external device import process",
      "enum": [
        "SUCCESS",
        "FAILURE",
        "PARTIAL"
      ]
    },
    "JobStatus": {
      "type": "string",
      "description": "Job status.",
      "enum": [
        "IN_PROGRESS",
        "COMPLETED",
        "NOT_FOUND",
        "FAILED"
      ]
    }
  }
}