{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nice/json-schema/nice-media-download-response-schema.json",
  "title": "MediaDownloadResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nice-mediaplayback-mediadownload-openapi.yml#/components/schemas/MediaDownloadResponse",
  "type": "object",
  "properties": {
    "requestId": {
      "type": "string",
      "format": "uuid",
      "description": "The unique identifier of the download request"
    },
    "status": {
      "type": "string",
      "description": "Overall status of the download request",
      "enum": [
        "PENDING",
        "IN_PROGRESS",
        "COMPLETED",
        "FAILED"
      ]
    },
    "entities": {
      "type": "array",
      "description": "Per-entity processing results",
      "items": {
        "$ref": "#/$defs/EntityResult"
      }
    },
    "downloadLocation": {
      "type": [
        "string",
        "null"
      ],
      "description": "S3 URL to the downloaded media archive. Populated only when status is COMPLETED."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp when the request was created (ISO 8601)"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of the last status update (ISO 8601)"
    }
  },
  "$defs": {
    "EntityResult": {
      "type": "object",
      "properties": {
        "entityId": {
          "type": "string",
          "description": "The contact or segment ID"
        },
        "status": {
          "type": "string",
          "description": "Processing status for this specific entity",
          "enum": [
            "PENDING",
            "IN_PROGRESS",
            "COMPLETED",
            "FAILED"
          ]
        },
        "failureReason": {
          "type": [
            "string",
            "null"
          ],
          "description": "Human-readable failure description. Present only when status is FAILED."
        }
      }
    }
  }
}