{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/collager-ai/json-schema/collager-ai-mosaic-schema.json",
  "title": "Mosaic",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/collager-ai-openapi.yml#/components/schemas/Mosaic",
  "type": "object",
  "required": [
    "id",
    "object",
    "status",
    "created_at",
    "expires_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string",
      "const": "mosaic"
    },
    "status": {
      "type": "string",
      "enum": [
        "collecting",
        "fetching",
        "queued",
        "processing",
        "preview_ready",
        "unlocked",
        "failed"
      ],
      "description": "fetching - we are downloading your links; queued/processing - in the build farm."
    },
    "upload_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "With collect_uploads - the page where your users add photos."
    },
    "photos_received": {
      "type": [
        "integer",
        "null"
      ],
      "description": "With collect_uploads - photos uploaded so far."
    },
    "preview_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Watermarked preview, set from preview_ready on. Link valid 24 h."
    },
    "hd_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Clean full-resolution file, set after unlock. Link valid 24 h."
    },
    "psb_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "building",
        "ready",
        "failed",
        null
      ]
    },
    "psb_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Layered PSB for print, when built. Link valid 24 h."
    },
    "layout_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "GET it with your key - every tile with photo, position, size, colour. JSON by default, XML with ?format=xml. Set from preview_ready on."
    },
    "tiles_archive_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "x-status": "v0.1",
      "description": "ZIP of the tile images as placed in the mosaic (v0.1). Large sets - read access to a storage folder by agreement."
    },
    "viewer_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "x-status": "v0.1",
      "description": "Interactive zoom viewer page (v0.1)."
    },
    "width": {
      "type": [
        "integer",
        "null"
      ]
    },
    "height": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tiles_used": {
      "type": [
        "integer",
        "null"
      ]
    },
    "tiles_failed": {
      "type": "integer",
      "description": "Links we could not download (they are skipped)."
    },
    "style": {
      "type": [
        "object",
        "null"
      ]
    },
    "credits_left": {
      "type": "integer",
      "description": "Returned by unlock."
    },
    "credits_charged": {
      "type": "integer",
      "description": "Returned by unlock - 1 the first time, 0 on repeats."
    },
    "error": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/JobError"
        }
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "When photos and results are deleted automatically (30 days after creation)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "JobError": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}