{
  "openapi": "3.1.0",
  "info": {
    "title": "ShoeCare API",
    "version": "1",
    "description": "A care advisor for shoes, built from photos: what is visible, what is only possible, what you confirmed and what a photograph can never establish, then a spot-test-first, reversible cleaning routine filtered by what the material and the care label forbid. It is not a guarantee, a valuation or an authenticity check. Authenticate with an API key (Authorization: Bearer <key> or X-API-Key). Only starting an analysis is billed, after it succeeds; the preview, corrections, pairs, before and after, comparison, share links and history are free (on the dashboard)."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/api/v1/meta": {
      "get": {
        "summary": "Vocabularies and guidance",
        "operationId": "getMeta",
        "tags": [
          "Reference"
        ],
        "description": "The closed lists a request may use, the photo-role guidance and the four limits. Free.",
        "responses": {
          "200": {
            "description": "Vocabularies",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetaView"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/preview": {
      "post": {
        "summary": "Check photo quality (free)",
        "operationId": "previewPhotos",
        "tags": [
          "Analysis"
        ],
        "description": "Measures each photo locally (sharpness, glare, exposure, resolution, measured palette) and returns specific tips. No AI is used and nothing is billed or stored. Send JSON with base64 photos, or multipart with `photos` files and `roles`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One to four JPEG or PNG files, repeat the field."
                  },
                  "roles": {
                    "type": "string",
                    "description": "Comma-separated roles, one per photo in order (overview, stain, label, sole); may be repeated. Default: overview, stain, label, sole by position."
                  },
                  "facts": {
                    "type": "string",
                    "description": "JSON object of customer facts (see Facts)."
                  },
                  "pair_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "photos"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-photo measurements",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewView"
                }
              }
            }
          },
          "413": {
            "description": "A photo is too large"
          },
          "415": {
            "description": "A photo is not a JPEG or PNG"
          },
          "422": {
            "description": "Invalid roles or photo count"
          },
          "429": {
            "description": "Hourly preview quota reached"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/analyses": {
      "post": {
        "summary": "Start an analysis (billed on success)",
        "operationId": "startAnalysis",
        "tags": [
          "Analysis"
        ],
        "description": "Queues one analysis of one to four photos of a single pair of shoes and returns 202 with a job to poll. It is billed only when the report is delivered, under one identifier minted here; an unusable photo (422), a refusal or a failure bills nothing. Send JSON with base64 `photos`, or multipart with `photos` files, `roles`, `facts` (JSON) and optional `pair_id`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "photos": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One to four JPEG or PNG files, repeat the field."
                  },
                  "roles": {
                    "type": "string",
                    "description": "Comma-separated roles, one per photo in order (overview, stain, label, sole); may be repeated. Default: overview, stain, label, sole by position."
                  },
                  "facts": {
                    "type": "string",
                    "description": "JSON object of customer facts (see Facts)."
                  },
                  "pair_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "photos"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Accepted"
                }
              }
            }
          },
          "402": {
            "description": "Empty wallet (body carries top_up_url)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "No active subscription (body carries subscribe_url)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "413": {
            "description": "A photo is too large"
          },
          "415": {
            "description": "A photo is not a JPEG or PNG"
          },
          "422": {
            "description": "Invalid input, including an unusable photo (the detail names the photo and why)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Hourly quota or too many analyses running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "get": {
        "summary": "List analyses",
        "operationId": "listAnalyses",
        "tags": [
          "Analysis"
        ],
        "description": "Newest first. Page with `before` set to the `created_at` of the last row you received.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "RFC 3339 time or Unix seconds."
          },
          {
            "name": "item",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sneaker_low",
                "sneaker_high",
                "running",
                "boot",
                "dress_shoe",
                "loafer",
                "sandal",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Summaries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnalysisSummary"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/analyses/{id}": {
      "get": {
        "summary": "Fetch an analysis",
        "operationId": "getAnalysis",
        "tags": [
          "Analysis"
        ],
        "description": "The delivered report (`report`) with its pair, feedback and share links.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The analysis",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisView"
                }
              }
            }
          },
          "404": {
            "description": "Not found or no longer retained",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "delete": {
        "summary": "Delete an analysis",
        "operationId": "deleteAnalysis",
        "tags": [
          "Analysis"
        ],
        "description": "Deletes the report, its history row, its link to a pair, its feedback and every share link.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "summary": "Poll a job",
        "operationId": "getJob",
        "tags": [
          "Analysis"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobView"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "timestamp": {
            "type": "integer"
          },
          "top_up_url": {
            "type": "string"
          },
          "subscribe_url": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "title",
          "code"
        ],
        "description": "RFC 7807 problem details."
      },
      "Fact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "display": {
            "type": "string"
          },
          "label": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "model",
              "measured",
              "parsed",
              "customer"
            ]
          },
          "uncertain": {
            "type": "boolean"
          },
          "editable": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "display",
          "label"
        ]
      },
      "Check": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          }
        }
      },
      "Option": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        }
      },
      "Accepted": {
        "type": "object",
        "properties": {
          "job_id": {
            "type": "string"
          },
          "analysis_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "poll": {
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "analysis_id",
          "status",
          "poll"
        ]
      },
      "JobView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "analysis_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "PreviewRequest": {
        "type": "object",
        "properties": {
          "photos": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/PhotoUpload"
            }
          }
        },
        "required": [
          "photos"
        ]
      },
      "Photo": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "role": {
            "type": "string",
            "enum": [
              "overview",
              "stain",
              "label",
              "sole"
            ]
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "quality": {
            "type": "integer"
          },
          "usable": {
            "type": "boolean"
          },
          "tips": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "glare_share": {
            "type": "number"
          },
          "sharpness": {
            "type": "number"
          },
          "palette": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Facts": {
        "type": "object",
        "properties": {
          "materials": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "canvas",
                "mesh_knit",
                "smooth_leather",
                "suede_nubuck",
                "patent",
                "synthetic",
                "other"
              ]
            },
            "description": "The upper material(s) you confirm. Only a confirmed material unlocks the material-specific steps."
          },
          "brand": {
            "type": "string",
            "maxLength": 60
          },
          "model": {
            "type": "string",
            "maxLength": 80
          },
          "size_eu": {
            "type": "number",
            "minimum": 15,
            "maximum": 60
          },
          "supplies": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "soft_brush",
                "microfibre_cloth",
                "mild_soap",
                "baking_soda",
                "white_vinegar",
                "suede_brush",
                "suede_eraser",
                "leather_cleaner",
                "leather_conditioner",
                "melamine_sponge",
                "toothbrush",
                "cornstarch",
                "mild_detergent",
                "shoe_trees",
                "protector_spray"
              ]
            },
            "description": "What you have at home; steps that need anything else go on the shopping list."
          },
          "label_text": {
            "type": "string",
            "maxLength": 400,
            "description": "The care label typed by hand; replaces the text read from the photo."
          },
          "note": {
            "type": "string",
            "maxLength": 400
          },
          "item_hint": {
            "type": "string",
            "enum": [
              "sneaker_low",
              "sneaker_high",
              "running",
              "boot",
              "dress_shoe",
              "loafer",
              "sandal",
              "other"
            ]
          },
          "for_resale": {
            "type": "boolean",
            "description": "Also build a listing-ready condition summary."
          }
        },
        "description": "What the customer states about the shoes. Everything here is confirmed (their word) and optional."
      },
      "PhotoUpload": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "overview",
              "stain",
              "label",
              "sole"
            ]
          },
          "filename": {
            "type": "string"
          },
          "data": {
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "description": "One photo as base64 (a data: URL is accepted). JPEG or PNG."
      },
      "StartRequest": {
        "type": "object",
        "properties": {
          "photos": {
            "type": "array",
            "minItems": 1,
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/PhotoUpload"
            }
          },
          "facts": {
            "$ref": "#/components/schemas/Facts"
          },
          "pair_id": {
            "type": "string"
          }
        },
        "required": [
          "photos"
        ]
      },
      "CareLabel": {
        "type": "object",
        "properties": {
          "present": {
            "type": "boolean"
          },
          "raw": {
            "type": "string"
          },
          "normalized": {
            "type": "string"
          },
          "materials": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "percent": {
                  "type": "integer"
                },
                "maps_to": {
                  "type": "string",
                  "enum": [
                    "canvas",
                    "mesh_knit",
                    "smooth_leather",
                    "suede_nubuck",
                    "patent",
                    "synthetic",
                    "other"
                  ]
                }
              }
            }
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "no_machine_wash",
                "hand_wash_only",
                "no_bleach",
                "wipe_clean_only",
                "no_soak",
                "no_tumble_dry",
                "no_heat",
                "no_iron",
                "professional_clean"
              ]
            }
          },
          "certainty": {
            "type": "string",
            "enum": [
              "certain",
              "uncertain",
              "unreadable",
              "absent"
            ]
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "label": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          },
          "corrected": {
            "type": "boolean"
          }
        },
        "description": "The care label as read. The words are observed; what they mean for this finish is never verified by a photograph."
      },
      "Candidate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "canvas",
              "mesh_knit",
              "smooth_leather",
              "suede_nubuck",
              "patent",
              "synthetic",
              "other"
            ]
          },
          "label": {
            "type": "string"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "reason": {
            "type": "string"
          },
          "evidence": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          }
        }
      },
      "Box": {
        "type": "object",
        "properties": {
          "x": {
            "type": "integer"
          },
          "y": {
            "type": "integer"
          },
          "w": {
            "type": "integer"
          },
          "h": {
            "type": "integer"
          }
        },
        "description": "A region of one photo in permille of its width and height."
      },
      "Stain": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "dry_dirt",
              "scuff",
              "oily_dark",
              "water_ring",
              "colour_transfer",
              "liquid_spot",
              "salt_line",
              "paint_like",
              "yellowing",
              "unclear"
            ]
          },
          "name": {
            "type": "string"
          },
          "zone": {
            "type": "string",
            "enum": [
              "toe_box",
              "vamp",
              "tongue",
              "quarter",
              "heel",
              "collar",
              "laces",
              "midsole",
              "outsole",
              "insole",
              "whole"
            ]
          },
          "photo": {
            "type": "integer"
          },
          "box": {
            "$ref": "#/components/schemas/Box"
          },
          "size": {
            "type": "string",
            "enum": [
              "small",
              "medium",
              "large"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "delta_e": {
            "type": "number"
          },
          "coverage": {
            "type": "number"
          },
          "measured": {
            "type": "boolean"
          },
          "severity": {
            "type": "string",
            "enum": [
              "faint",
              "visible",
              "strong"
            ]
          },
          "evidence": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "description": "A visible mark. The kind is how it looks, never what it is made of; the contrast is measured."
      },
      "WearCell": {
        "type": "object",
        "properties": {
          "zone": {
            "type": "string",
            "enum": [
              "outsole",
              "midsole",
              "upper",
              "toe_box",
              "heel",
              "seams",
              "laces",
              "insole"
            ]
          },
          "name": {
            "type": "string"
          },
          "level": {
            "type": "string",
            "enum": [
              "none",
              "light",
              "moderate",
              "heavy"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "seen": {
            "type": "boolean"
          },
          "evidence": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          }
        }
      },
      "Damage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "crack",
              "peeling",
              "sole_separation",
              "hole",
              "fraying",
              "loose_stitching",
              "deformed",
              "faded_colour"
            ]
          },
          "name": {
            "type": "string"
          },
          "zone": {
            "type": "string",
            "enum": [
              "toe_box",
              "vamp",
              "tongue",
              "quarter",
              "heel",
              "collar",
              "laces",
              "midsole",
              "outsole",
              "insole",
              "whole"
            ]
          },
          "photo": {
            "type": "integer"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "attention": {
            "type": "boolean"
          },
          "advice": {
            "type": "string"
          },
          "evidence": {
            "type": "string",
            "enum": [
              "observed",
              "possible",
              "confirmed",
              "not_verifiable"
            ]
          }
        }
      },
      "Condition": {
        "type": "object",
        "properties": {
          "grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D"
            ]
          },
          "score": {
            "type": "integer"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "basis": {
            "type": "string"
          }
        },
        "description": "The visible condition derived by rule from the wear map and damage list; not a valuation."
      },
      "Need": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "why": {
            "type": "string"
          }
        }
      },
      "Step": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "order": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "risk": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "why": {
            "type": "string"
          },
          "needs": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "soft_brush",
                "microfibre_cloth",
                "mild_soap",
                "baking_soda",
                "white_vinegar",
                "suede_brush",
                "suede_eraser",
                "leather_cleaner",
                "leather_conditioner",
                "melamine_sponge",
                "toothbrush",
                "cornstarch",
                "mild_detergent",
                "shoe_trees",
                "protector_spray"
              ]
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "soft_brush",
                "microfibre_cloth",
                "mild_soap",
                "baking_soda",
                "white_vinegar",
                "suede_brush",
                "suede_eraser",
                "leather_cleaner",
                "leather_conditioner",
                "melamine_sponge",
                "toothbrush",
                "cornstarch",
                "mild_detergent",
                "shoe_trees",
                "protector_spray"
              ]
            }
          },
          "reversible": {
            "type": "boolean"
          },
          "targets": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "basis": {
            "type": "string"
          }
        }
      },
      "Prohibition": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "why": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "material",
              "label",
              "stain",
              "colour",
              "damage",
              "unconfirmed"
            ]
          }
        }
      },
      "CarePlan": {
        "type": "object",
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "basis": {
            "type": "string"
          },
          "spot_test": {
            "$ref": "#/components/schemas/Step"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Step"
            }
          },
          "avoid": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Prohibition"
            }
          },
          "shopping": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "soft_brush",
                "microfibre_cloth",
                "mild_soap",
                "baking_soda",
                "white_vinegar",
                "suede_brush",
                "suede_eraser",
                "leather_cleaner",
                "leather_conditioner",
                "melamine_sponge",
                "toothbrush",
                "cornstarch",
                "mild_detergent",
                "shoe_trees",
                "protector_spray"
              ]
            }
          },
          "colour_warning": {
            "type": "string"
          },
          "drying": {
            "type": "string"
          },
          "escalate": {
            "type": "string"
          }
        },
        "description": "A spot-test-first routine. Without a confirmed material (ready false) only the universal steps are shown."
      },
      "Listing": {
        "type": "object",
        "properties": {
          "requested": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "disclose": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "item": {
            "type": "string",
            "enum": [
              "sneaker_low",
              "sneaker_high",
              "running",
              "boot",
              "dress_shoe",
              "loafer",
              "sandal",
              "other"
            ]
          },
          "photos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Photo"
            }
          },
          "facts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fact"
            }
          },
          "care_label": {
            "$ref": "#/components/schemas/CareLabel"
          },
          "material_candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Candidate"
            }
          },
          "stains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Stain"
            }
          },
          "wear_map": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WearCell"
            }
          },
          "damage": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Damage"
            }
          },
          "condition": {
            "$ref": "#/components/schemas/Condition"
          },
          "needs_confirmation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Need"
            }
          },
          "care_plan": {
            "$ref": "#/components/schemas/CarePlan"
          },
          "listing": {
            "$ref": "#/components/schemas/Listing"
          },
          "stated": {
            "$ref": "#/components/schemas/Facts"
          },
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Check"
            }
          },
          "checks_passed": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          },
          "summary_by_ai": {
            "type": "boolean"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_material": {
            "type": "null"
          },
          "guarantee": {
            "type": "null"
          },
          "recommended_next_step": {
            "type": "string"
          },
          "edits": {
            "type": "integer"
          },
          "prompt": {
            "type": "string"
          },
          "prompt_fingerprint": {
            "type": "string"
          },
          "thumbnail": {
            "type": "string"
          }
        },
        "description": "The stored report. verified_material and guarantee are always null: the report makes no such claim."
      },
      "PreviewView": {
        "type": "object",
        "properties": {
          "photos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Photo"
            }
          },
          "usable": {
            "type": "boolean"
          }
        }
      },
      "AnalysisSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "succeeded",
              "failed"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "type": "string"
          },
          "item": {
            "type": "string"
          },
          "item_label": {
            "type": "string"
          },
          "material": {
            "type": "string"
          },
          "material_label": {
            "type": "string"
          },
          "material_confirmed": {
            "type": "boolean"
          },
          "label_outcome": {
            "type": "string",
            "enum": [
              "certain",
              "uncertain",
              "unreadable",
              "absent"
            ]
          },
          "label_flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "stains": {
            "type": "integer"
          },
          "worst_stain": {
            "type": "string"
          },
          "worst_stain_label": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "wear_score": {
            "type": "integer"
          },
          "condition_grade": {
            "type": "string"
          },
          "damage": {
            "type": "integer"
          },
          "attention": {
            "type": "integer"
          },
          "plan_ready": {
            "type": "boolean"
          },
          "quality": {
            "type": "integer"
          },
          "checks_passed": {
            "type": "boolean"
          },
          "edits": {
            "type": "integer"
          },
          "photos": {
            "type": "integer"
          },
          "pair_id": {
            "type": "string"
          },
          "pair_name": {
            "type": "string"
          },
          "units": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "status",
          "created_at"
        ]
      },
      "AnalysisView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "pair_id": {
            "type": "string"
          },
          "pair_name": {
            "type": "string"
          },
          "report": {
            "$ref": "#/components/schemas/Report"
          },
          "has_thumbnail": {
            "type": "boolean"
          },
          "feedback": {
            "type": "object",
            "properties": {
              "report_id": {
                "type": "string"
              },
              "useful": {
                "type": "boolean"
              },
              "note": {
                "type": "string"
              }
            }
          },
          "shares": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "report_id": {
                  "type": "string"
                },
                "live": {
                  "type": "boolean"
                }
              }
            }
          },
          "units": {
            "type": "integer"
          },
          "cost_eur": {
            "type": "number"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "created_at",
          "report"
        ]
      },
      "MetaView": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "guidance": {
                  "type": "string"
                },
                "recommended": {
                  "type": "boolean"
                }
              }
            }
          },
          "materials": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "stain_kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "sizes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "wear_zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "wear_levels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "damage": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "supplies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "flags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "meaning": {
                  "type": "string"
                }
              }
            }
          },
          "grades": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "meaning": {
                  "type": "string"
                }
              }
            }
          },
          "risks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "label_outcomes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "event_kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "event_sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Option"
            }
          },
          "photos": {
            "type": "object",
            "properties": {
              "max_photos": {
                "type": "integer"
              },
              "max_mb": {
                "type": "integer"
              },
              "formats": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "client_max_side": {
                "type": "integer"
              },
              "label_min_side": {
                "type": "integer"
              },
              "general_min_side": {
                "type": "integer"
              }
            }
          },
          "facts": {
            "type": "object",
            "properties": {
              "brand_max_chars": {
                "type": "integer"
              },
              "model_max_chars": {
                "type": "integer"
              },
              "note_max_chars": {
                "type": "integer"
              },
              "label_text_max_chars": {
                "type": "integer"
              },
              "size_min_eu": {
                "type": "number"
              },
              "size_max_eu": {
                "type": "number"
              },
              "max_materials": {
                "type": "integer"
              },
              "max_stains": {
                "type": "integer"
              },
              "max_damage": {
                "type": "integer"
              }
            }
          },
          "share_days": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "retention_days": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "limits": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "description": "Closed vocabularies, what the evidence labels mean, photo-role guidance and the four things a report never says."
      }
    }
  }
}
