{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usepostify-com/json-schema/usepostify-com-media-asset-schema.json",
  "title": "MediaAsset",
  "description": "A media library asset.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usepostify-com-openapi.yml#/components/schemas/MediaAsset",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable asset identifier."
    },
    "filename": {
      "type": "string",
      "description": "Original filename."
    },
    "content_type": {
      "type": "string",
      "description": "MIME type."
    },
    "kind": {
      "type": "string",
      "enum": [
        "image",
        "video",
        "audio",
        "raw"
      ],
      "description": "Asset kind."
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "ready",
        "failed"
      ],
      "description": "`pending` until the upload is completed and, for a video or audio file, until its processing finishes; only `ready` assets should be attached to posts. `failed` carries a `failure_reason`."
    },
    "url": {
      "description": "Durable URL for the asset — use this as `media[].url` when creating posts. Null until the upload completes.",
      "type": [
        "string",
        "null"
      ]
    },
    "failure_reason": {
      "description": "Why the asset is `failed`, written for the person who uploaded it (a file over your plan's limit, no video track, or a processing job a restart cut short); null otherwise.",
      "type": [
        "string",
        "null"
      ]
    },
    "size_bytes": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Size in bytes."
    },
    "width": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Pixel width, when known."
    },
    "height": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ],
      "description": "Pixel height, when known."
    },
    "duration_sec": {
      "description": "Duration in seconds for audio/video, when known.",
      "type": [
        "number",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
      "description": "When the asset was created (ISO-8601 UTC)."
    }
  },
  "required": [
    "id",
    "filename",
    "content_type",
    "kind",
    "status",
    "url",
    "failure_reason",
    "size_bytes",
    "width",
    "height",
    "duration_sec",
    "created_at"
  ],
  "additionalProperties": false
}