{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collager-ai/json-schema/collager-ai-create-mosaic-request-schema.json",
  "title": "CreateMosaicRequest",
  "description": "Pass the tiles as links (tile_image_urls, plus optional featured/secondary) or use collect_uploads.\ntiles_zip_url, tiles_source and multipart upload arrive in v0.1. Other storage (Dropbox, Google Drive, FTP,\nyour platform's API) - custom integration on request.\n",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collager-ai-openapi.yml#/components/schemas/CreateMosaicRequest",
  "type": "object",
  "properties": {
    "main_image_url": {
      "type": "string",
      "format": "uri",
      "description": "The picture to recreate. Required unless collect_uploads."
    },
    "tile_image_urls": {
      "type": "array",
      "maxItems": 10000,
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Photos for the tiles (public or pre-signed links). At least 30 tiles in total; a few hundred give a good result."
    },
    "tiles_zip_url": {
      "type": "string",
      "format": "uri",
      "x-status": "v0.1",
      "description": "One ZIP archive with all tile photos (v0.1)."
    },
    "tiles_source": {
      "type": "object",
      "x-status": "v0.1",
      "description": "Cloud folder we read the tiles from (v0.1).",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "s3",
            "gcs",
            "azure"
          ]
        },
        "bucket": {
          "type": "string"
        },
        "prefix": {
          "type": "string"
        },
        "region": {
          "type": "string"
        }
      }
    },
    "featured_tile_urls": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Photos that get the largest tiles and are placed first."
    },
    "secondary_tile_urls": {
      "type": "array",
      "maxItems": 300,
      "items": {
        "type": "string",
        "format": "uri"
      },
      "description": "Second featured level, slightly smaller."
    },
    "style": {
      "type": "object",
      "description": "Omit for the standard look (the engine picks the style for the main photo).",
      "properties": {
        "layout": {
          "type": "string",
          "enum": [
            "variable",
            "uniform"
          ],
          "default": "variable"
        },
        "large_tiles": {
          "type": "integer",
          "default": 300,
          "description": "How many of the largest tiles fit across the picture (variable 0 = auto or 50-5000; uniform 200-5000, default 2000)."
        },
        "size_levels": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4,
          "default": 4
        },
        "colorization": {
          "type": "string",
          "enum": [
            "low",
            "medium",
            "high"
          ],
          "default": "medium"
        },
        "blur_background": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "clean_subject": {
          "type": "boolean",
          "description": "Keep the main subject as a clean photo, mosaic only around it."
        }
      }
    },
    "layered_file": {
      "type": "boolean",
      "description": "Also build the layered PSB for print (takes longer)."
    },
    "collect_uploads": {
      "type": "boolean",
      "description": "No photos yet - the response carries upload_url, a page where your users add photos; status stays collecting until POST /mosaics/{id}/start."
    },
    "webhook_url": {
      "type": "string",
      "format": "uri",
      "description": "Called with a WebhookEvent when the preview is ready, the job fails, is unlocked or the PSB is ready."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Your own key-value pairs, returned unchanged."
    }
  }
}