{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nice/json-schema/nice-create-job-response-schema.json",
  "title": "CreateJobResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nice-generic-storeandforward-openapi.yml#/components/schemas/CreateJobResponse",
  "type": "object",
  "required": [
    "tenantId",
    "jobId",
    "status",
    "creationTime",
    "completionTime",
    "interactionCounters"
  ],
  "properties": {
    "tenantId": {
      "type": "string"
    },
    "traceId": {
      "type": "string"
    },
    "jobId": {
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/CreateJobStatus"
    },
    "creationTime": {
      "type": "string",
      "format": "date-time"
    },
    "completionTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "uploadUrlValidityMinutes": {
      "type": "integer",
      "minimum": 5,
      "maximum": 60,
      "default": 5
    },
    "mediaUploadUrls": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MediaUploadUrl"
      }
    },
    "interactionCounters": {
      "$ref": "#/$defs/InteractionCounters"
    }
  },
  "$defs": {
    "CreateJobStatus": {
      "type": "string",
      "description": "Job-level status for create-job response; RUNNING means at least one interaction is non-final, FAILED means all interactions failed.",
      "enum": [
        "RUNNING",
        "FAILED"
      ]
    },
    "InteractionCounters": {
      "type": "object",
      "required": [
        "total",
        "succeeded",
        "failed",
        "inProgress"
      ],
      "description": "Total number of interactions in job, number that have succeeded, failed, or are still in progress.",
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "succeeded": {
          "type": "integer",
          "minimum": 0
        },
        "failed": {
          "type": "integer",
          "minimum": 0
        },
        "inProgress": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "MediaUploadUrl": {
      "type": "object",
      "properties": {
        "systemName": {
          "type": "string"
        },
        "interactionId": {
          "type": "string",
          "description": "Source system interaction identifier"
        },
        "mediaId": {
          "type": "string"
        },
        "mediaType": {
          "type": "string",
          "enum": [
            "TEXT",
            "AUDIO",
            "SCREEN",
            "ATTACHMENT"
          ]
        },
        "uploadUrl": {
          "type": "string",
          "format": "uri"
        },
        "httpMethod": {
          "type": "string",
          "enum": [
            "PUT"
          ]
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "uploadUrlExpiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "maxSizeBytes": {
          "type": "integer",
          "minimum": 1
        }
      }
    }
  }
}