{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cosmicjs-com/json-schema/cosmicjs-com-media-response-schema.json",
  "title": "MediaResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cosmicjs-com-media-api-openapi.yml#/components/schemas/MediaResponse",
  "type": "object",
  "required": [
    "media"
  ],
  "properties": {
    "media": {
      "$ref": "#/$defs/Media"
    }
  },
  "$defs": {
    "Media": {
      "type": "object",
      "description": "An image, file, or document in the Bucket.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "Unique file name within the Bucket. This is the value you assign to a File or Image Metafield."
        },
        "original_name": {
          "type": "string",
          "description": "The file name as uploaded."
        },
        "size": {
          "type": [
            "integer",
            "string"
          ],
          "description": "File size in bytes."
        },
        "type": {
          "type": "string",
          "description": "MIME type."
        },
        "bucket": {
          "type": "string",
          "description": "Bucket id."
        },
        "folder": {
          "type": [
            "string",
            "null"
          ]
        },
        "alt_text": {
          "type": [
            "string",
            "null"
          ],
          "description": "Images only."
        },
        "width": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Pixel width. Images only."
        },
        "height": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Pixel height. Images only."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "CDN URL."
        },
        "imgix_url": {
          "type": "string",
          "format": "uri",
          "description": "imgix URL, which accepts image processing query parameters."
        },
        "metadata": {
          "type": [
            "object",
            "null"
          ],
          "description": "Arbitrary JSON metadata you attach to the media.",
          "additionalProperties": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "additionalProperties": true
    }
  }
}