{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/deploy-social/json-schema/deploy-social-media-schema.json",
  "title": "Media",
  "description": "A video in your workspace.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/deploy-social-openapi.yml#/components/schemas/Media",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The video's id. Starts with `media_`."
    },
    "kind": {
      "type": "string",
      "enum": [
        "video",
        "image"
      ],
      "description": "`video` or `image`. New kinds may be added."
    },
    "status": {
      "type": "string",
      "description": "`uploading` until the file arrives, `processing` while we prepare it, then `ready` or `failed`. `expired` means its files were removed after a period of inactivity; upload it again to use it. New values may be added."
    },
    "filename": {
      "type": [
        "string",
        "null"
      ]
    },
    "content_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "size_bytes": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "duration_sec": {
      "type": [
        "number",
        "null"
      ]
    },
    "width": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "height": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "orientation": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "landscape",
            "portrait",
            "square"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "The shape, once the size is known (`null` before). A `landscape` video needs `vertical_fit` on a post to Facebook Reels, YouTube Shorts or TikTok."
    },
    "progress": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "phase": {
              "type": [
                "string",
                "null"
              ]
            },
            "percent": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "phase",
            "percent"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "How far processing has got, while it's running."
    },
    "error": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string"
            },
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the video failed, when it did."
    },
    "created_at": {
      "type": "string",
      "description": "When the video was added.",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "description": "When the video last changed.",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "kind",
    "status",
    "filename",
    "content_type",
    "size_bytes",
    "duration_sec",
    "width",
    "height",
    "orientation",
    "progress",
    "error",
    "created_at",
    "updated_at"
  ],
  "additionalProperties": false
}