{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/optimizely/main/json-schema/optimizely-task-video-schema.json",
  "title": "TaskVideo",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optimizely-tasks-api-openapi.yml#/components/schemas/TaskVideo",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the video"
    },
    "title": {
      "type": "string",
      "description": "Title of the video"
    },
    "mime_type": {
      "type": "string",
      "description": "MIME type of the video"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the video was created,  in ISO 8601 UTC format (2020-02-10T10:40:45Z)"
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time of the most recent modification of the video, in ISO 8601 UTC format (2020-02-10T10:40:45Z)"
    },
    "file_size": {
      "type": "integer",
      "description": "Size of the video in bytes"
    },
    "url": {
      "type": "string",
      "description": "Download URL of the video"
    },
    "labels": {
      "type": "array",
      "description": "Labels associated with the video",
      "items": {
        "$ref": "#/$defs/ResourceLabelResponse"
      }
    },
    "library_asset_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Unique identifier of the corresponding library asset — the library asset this task asset was forked from, or the one it was released to."
    },
    "links": {
      "type": "object",
      "additionalProperties": false,
      "description": "Meta links",
      "properties": {
        "self": {
          "type": "string",
          "description": "URL of the video"
        },
        "task": {
          "type": "string",
          "description": "URL of the task that the video is associated with"
        },
        "drafts": {
          "type": "string",
          "description": "URL to POST draft to the video"
        },
        "web_urls": {
          "type": "object",
          "additionalProperties": false,
          "description": "Web URLs",
          "properties": {
            "self": {
              "type": "string",
              "description": "Web URL of the video"
            },
            "task": {
              "type": "string",
              "description": "Web URL of the task that the video is associated with"
            },
            "drafts": {
              "type": "string",
              "description": "Web URL of the drafts of the video"
            }
          },
          "required": [
            "self",
            "task",
            "drafts"
          ]
        }
      },
      "required": [
        "self",
        "task",
        "drafts",
        "web_urls"
      ]
    }
  },
  "required": [
    "id",
    "title",
    "mime_type",
    "created_at",
    "modified_at",
    "file_size",
    "url",
    "labels",
    "links"
  ],
  "$defs": {
    "ResourceLabelResponse": {
      "description": "Label associated to a fetched resource",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "group": {
          "description": "Label group",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string",
              "description": "Identifier of the label group"
            },
            "name": {
              "type": "string",
              "description": "Name of the label group"
            }
          },
          "required": [
            "id",
            "name"
          ]
        },
        "values": {
          "type": "array",
          "description": "List of values of the label",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "description": "Identifier of the label value"
              },
              "name": {
                "type": "string",
                "description": "Name of the label value"
              }
            },
            "required": [
              "id",
              "name"
            ]
          }
        }
      },
      "required": [
        "group",
        "values"
      ]
    }
  }
}