{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/socialync-io/json-schema/socialync-io-media-upload-schema.json",
  "title": "MediaUpload",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/socialync-io-openapi.json#/components/schemas/MediaUpload",
  "type": "object",
  "required": [
    "id",
    "mediaType",
    "files"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The upload id. Pass it to POST /v1/media/{id}/finalize after the PUTs."
    },
    "mediaType": {
      "type": "string",
      "enum": [
        "image",
        "video"
      ]
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "The upload URLs stop working at this time (one hour)."
    },
    "files": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "index",
          "method",
          "uploadUrl",
          "contentType"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string",
            "description": "Send this exact value as the Content-Type header of the PUT."
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "uploadUrl": {
            "type": "string",
            "format": "uri",
            "description": "PUT the raw bytes here. No Authorization header."
          }
        }
      }
    }
  }
}