{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antwork-io/json-schema/antwork-io-media-create-schema.json",
  "title": "MediaCreate",
  "description": "Exactly one of `url` and `upload`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antwork-io-media-api-openapi.yml#/components/schemas/MediaCreate",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "description": "A public link to the image, video or PDF itself; the server fetches it."
    },
    "upload": {
      "type": "object",
      "required": [
        "filename",
        "mimeType",
        "size"
      ],
      "description": "A file you hold: the answer is a one-time `uploadUrl` to PUT its bytes to.",
      "properties": {
        "filename": {
          "type": "string"
        },
        "mimeType": {
          "type": "string",
          "enum": [
            "image/png",
            "image/jpeg",
            "image/gif",
            "image/webp",
            "image/avif",
            "video/mp4",
            "video/quicktime",
            "video/webm",
            "application/pdf"
          ]
        },
        "size": {
          "type": "integer",
          "description": "Bytes. Images up to 10 MB, video and PDF up to 1 GB."
        }
      }
    },
    "workspaceId": {
      "type": "string",
      "description": "Required when the account has more than one workspace."
    },
    "attachToPostIds": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "string"
      },
      "description": "Posts to append the file to."
    }
  }
}