{
  "openapi": "3.1.0",
  "info": {
    "title": "VerifyAI inspection contract v2 (additive)",
    "version": "2.0.0",
    "description": "Hosted photo capture and authenticated condition review. Existing legacy inspection contracts remain supported. Submission callbacks omit machine outcome. Automatic clear and collection remain disabled. Inspections created with `lending` instead receive an automatic lending decision under the customer's pinned policy, returned by GET .../decision, on the inspection record and in the signed `inspection.decision` webhook."
  },
  "servers": [
    {
      "url": "https://verify.switchlabs.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "TenantKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "Invitation": {
        "type": "object",
        "required": [
          "delivered",
          "channel"
        ],
        "description": "Provider acceptance is separate from delivery. An absent accepted field with send_outcome_unknown requires provider reconciliation before retrying. send:false returns channel:none.",
        "properties": {
          "delivered": {
            "type": "boolean"
          },
          "accepted": {
            "type": "boolean"
          },
          "channel": {
            "enum": [
              "email",
              "sms",
              "whatsapp",
              "none"
            ]
          },
          "error": {
            "type": "string"
          },
          "provider_message_id": {
            "type": "string"
          },
          "provider_status": {
            "type": "string"
          }
        }
      },
      "Resend": {
        "type": "object",
        "required": [
          "id",
          "url",
          "token",
          "expires_at",
          "resend_count",
          "invitation"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "token": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "resend_count": {
            "type": "integer"
          },
          "invitation": {
            "$ref": "#/components/schemas/Invitation"
          }
        }
      },
      "Create": {
        "type": "object",
        "properties": {
          "template": {
            "type": "string",
            "enum": [
              "vehicle_condition_sedan",
              "vehicle_condition_suv",
              "vehicle_condition_truck",
              "vehicle_door_demo",
              "vehicle_condition_custom"
            ]
          },
          "profile": {
            "default": "door15",
            "type": "string",
            "enum": [
              "baseline13",
              "door15",
              "door_demo",
              "custom"
            ]
          },
          "vehicle_class": {
            "default": "sedan",
            "type": "string",
            "enum": [
              "sedan",
              "suv",
              "truck",
              "from_vin"
            ]
          },
          "steering_side": {
            "default": "unknown",
            "type": "string",
            "enum": [
              "left",
              "right",
              "unknown"
            ]
          },
          "cab": {
            "default": "standard",
            "type": "string",
            "enum": [
              "standard",
              "single"
            ]
          },
          "required_shots": {
            "minItems": 1,
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9_-]{0,47}$"
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "view": {
                  "type": "string",
                  "enum": [
                    "front",
                    "front_left",
                    "left_side",
                    "rear_left",
                    "rear",
                    "rear_right",
                    "right_side",
                    "front_right",
                    "dashboard",
                    "front_seats",
                    "rear_seats",
                    "cargo_area",
                    "odometer",
                    "vin_plate",
                    "left_front_door",
                    "right_front_door",
                    "damage_closeup",
                    "tire_front_left",
                    "tire_front_right",
                    "tire_rear_left",
                    "tire_rear_right",
                    "windscreen",
                    "engine_bay"
                  ]
                },
                "required": {
                  "default": true,
                  "type": "boolean"
                },
                "repeatable": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 29
                }
              },
              "required": [
                "slot",
                "label",
                "view",
                "required"
              ],
              "additionalProperties": false
            }
          },
          "accepted_retention_days": {
            "default": 90,
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "rejected_retention_days": {
            "default": 7,
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "capacity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          },
          "allow_flagged_submission": {
            "default": false,
            "type": "boolean"
          },
          "allowed_embed_origins": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "session_ttl_seconds": {
            "default": 604800,
            "type": "integer",
            "minimum": 3600,
            "maximum": 2592000
          },
          "ttl_seconds": {
            "default": 86400,
            "type": "integer",
            "minimum": 60,
            "maximum": 86400
          },
          "reference_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "delivery",
                  "pickup"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "policy": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "vehicle": {
            "default": {},
            "type": "object",
            "properties": {
              "vin": {
                "type": "string",
                "maxLength": 30
              },
              "plate": {
                "type": "string",
                "maxLength": 30
              },
              "year": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  }
                ]
              },
              "make": {
                "type": "string",
                "maxLength": 80
              },
              "model": {
                "type": "string",
                "maxLength": 80
              },
              "description": {
                "type": "string",
                "maxLength": 120
              }
            },
            "additionalProperties": false
          },
          "context": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "recipient": {
            "default": {},
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "format": "email",
                "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              "phone": {
                "type": "string",
                "maxLength": 40
              },
              "name": {
                "type": "string",
                "maxLength": 100
              },
              "locale": {
                "type": "string",
                "maxLength": 10
              }
            },
            "additionalProperties": false
          },
          "channel": {
            "default": "web",
            "type": "string",
            "enum": [
              "web",
              "sms",
              "whatsapp"
            ]
          },
          "capture_mode": {
            "type": "string",
            "enum": [
              "guided",
              "freeform",
              "video"
            ]
          },
          "video": {
            "type": "object",
            "properties": {
              "interior": {
                "default": "required",
                "type": "string",
                "enum": [
                  "required",
                  "optional"
                ]
              },
              "still_fallback": {
                "default": true,
                "type": "boolean"
              }
            },
            "required": [
              "interior",
              "still_fallback"
            ],
            "additionalProperties": false
          },
          "processing_workflow": {
            "type": "string",
            "enum": [
              "coverage_then_detail_v1",
              "collective_coverage_then_detail_v2"
            ]
          },
          "coverage_mode": {
            "type": "string",
            "const": "cumulative_panels_v1"
          },
          "require_signature": {
            "default": false,
            "type": "boolean"
          },
          "capture_sources": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "camera",
                "library"
              ]
            }
          },
          "exterior_quality": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "exterior-quality-v1"
              },
              "landscape": {
                "default": true,
                "type": "boolean"
              },
              "min_vehicle_width": {
                "default": 0.7,
                "type": "number",
                "minimum": 0.4,
                "maximum": 0.9
              },
              "margin": {
                "default": 0.02,
                "type": "number",
                "minimum": 0,
                "maximum": 0.1
              }
            },
            "required": [
              "version",
              "landscape",
              "min_vehicle_width",
              "margin"
            ],
            "additionalProperties": false
          },
          "capture_guides": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9_-]{1,64}$"
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "assets": {
                "minItems": 1,
                "maxItems": 128,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "vehicle_class": {
                      "type": "string",
                      "enum": [
                        "sedan",
                        "suv",
                        "truck"
                      ]
                    },
                    "cab": {
                      "type": "string",
                      "enum": [
                        "standard",
                        "single"
                      ]
                    },
                    "view": {
                      "type": "string",
                      "enum": [
                        "front",
                        "rear",
                        "left_side",
                        "right_side",
                        "front_left",
                        "front_right",
                        "rear_left",
                        "rear_right",
                        "dashboard",
                        "front_seats",
                        "rear_seats",
                        "cargo_area",
                        "odometer",
                        "vin_plate",
                        "left_front_door",
                        "right_front_door",
                        "damage_closeup",
                        "tire_front_left",
                        "tire_front_right",
                        "tire_rear_left",
                        "tire_rear_right",
                        "windscreen",
                        "engine_bay"
                      ]
                    },
                    "svg": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 16384
                    }
                  },
                  "required": [
                    "vehicle_class",
                    "cab",
                    "view",
                    "svg"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "id",
              "version",
              "assets"
            ],
            "additionalProperties": false
          },
          "background_analysis": {
            "type": "boolean"
          },
          "lending": {
            "type": "object",
            "properties": {
              "policy_id": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
              },
              "reference": {
                "type": "object",
                "properties": {
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000000
                  },
                  "currency": {
                    "type": "string",
                    "pattern": "^[A-Z]{3}$"
                  },
                  "reference_kind": {
                    "type": "string",
                    "enum": [
                      "customer_book_value",
                      "nominal_test"
                    ],
                    "description": "nominal_test marks fictional test value; decisions are test-only and excluded from production funding and inspection billing."
                  },
                  "powertrain": {
                    "type": "string",
                    "enum": [
                      "petrol",
                      "diesel",
                      "electric",
                      "hybrid",
                      "other"
                    ],
                    "description": "Customer-supplied powertrain for selecting a component valuation group. Never inferred from an unknown vehicle."
                  },
                  "source": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "as_of": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                  },
                  "external_reference": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "amount_cents",
                  "currency",
                  "source",
                  "as_of"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "send_immediately": {
            "default": false,
            "type": "boolean",
            "const": false
          },
          "return_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "template",
          "profile",
          "vehicle_class",
          "steering_side",
          "cab",
          "accepted_retention_days",
          "rejected_retention_days",
          "allow_flagged_submission",
          "allowed_embed_origins",
          "session_ttl_seconds",
          "ttl_seconds",
          "vehicle",
          "context",
          "recipient",
          "channel",
          "require_signature",
          "send_immediately"
        ],
        "additionalProperties": false
      },
      "Observation": {
        "type": "object",
        "properties": {
          "detected_component": {
            "type": "string",
            "enum": [
              "vehicle",
              "door",
              "wheel",
              "dashboard",
              "seats",
              "cargo_area",
              "odometer",
              "vin_plate",
              "damage",
              "unknown"
            ]
          },
          "detected_view": {
            "type": "string",
            "enum": [
              "front",
              "front_left",
              "left_side",
              "rear_left",
              "rear",
              "rear_right",
              "right_side",
              "front_right",
              "dashboard",
              "front_seats",
              "rear_seats",
              "cargo_area",
              "odometer",
              "vin_plate",
              "left_front_door",
              "right_front_door",
              "damage_closeup",
              "unknown"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "usable",
              "unusable",
              "uncertain"
            ]
          },
          "identity": {
            "type": "string",
            "enum": [
              "consistent",
              "inconsistent",
              "unknown"
            ]
          },
          "orientation_cues": {
            "type": "string",
            "enum": [
              "sufficient",
              "insufficient"
            ]
          },
          "zones": {
            "maxItems": 40,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "zone": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "observed",
                    "partial",
                    "absent",
                    "unknown"
                  ]
                },
                "reason": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "zone",
                "state",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "damage_findings": {
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finding_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "panel": {
                  "type": "string",
                  "enum": [
                    "car_hood",
                    "car_roof",
                    "car_trunk",
                    "car_front_bumper",
                    "car_rear_bumper",
                    "car_door_fl",
                    "car_door_fr",
                    "car_door_rl",
                    "car_door_rr",
                    "car_fender_fl",
                    "car_fender_fr",
                    "car_quarter_rl",
                    "car_quarter_rr",
                    "car_rocker",
                    "car_mirror",
                    "car_wheel_fl",
                    "car_wheel_fr",
                    "car_wheel_rl",
                    "car_wheel_rr",
                    "car_windscreen",
                    "car_rear_glass",
                    "car_headlight_l",
                    "car_headlight_r",
                    "car_taillight_l",
                    "car_taillight_r",
                    "car_grille",
                    "dashboard",
                    "front_seats",
                    "rear_seats",
                    "cargo_area"
                  ]
                },
                "damage_type": {
                  "type": "string",
                  "enum": [
                    "scratch",
                    "dent",
                    "paint_chip",
                    "crack",
                    "broken",
                    "missing",
                    "rust",
                    "tear",
                    "stain",
                    "glass_damage",
                    "structural_concern",
                    "other"
                  ]
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "none",
                    "light",
                    "medium",
                    "severe"
                  ]
                },
                "bbox": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  ]
                },
                "uncertainty": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "finding_id",
                "panel",
                "damage_type",
                "severity",
                "bbox",
                "uncertainty"
              ],
              "additionalProperties": false
            }
          },
          "readings": {
            "type": "object",
            "properties": {
              "vin": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 30
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "odometer": {
                "anyOf": [
                  {
                    "type": "number",
                    "minimum": 0
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "odometer_unit": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "mi",
                      "km"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "vin",
              "odometer",
              "odometer_unit"
            ],
            "additionalProperties": false
          },
          "feedback": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "detected_component",
          "detected_view",
          "quality",
          "identity",
          "orientation_cues",
          "zones",
          "damage_findings",
          "readings",
          "feedback"
        ],
        "additionalProperties": false
      },
      "Review": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approved",
              "damage_confirmed",
              "request_recapture"
            ]
          },
          "expected_revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 120
          },
          "rationale": {
            "type": "string",
            "minLength": 10,
            "maxLength": 2000
          },
          "label_provenance": {
            "type": "object",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "human",
                  "ai_assisted"
                ]
              },
              "personally_confirmed": {
                "type": "boolean"
              },
              "version": {
                "type": "string",
                "const": "inspection-label-v1"
              }
            },
            "required": [
              "source",
              "personally_confirmed",
              "version"
            ],
            "additionalProperties": false
          },
          "component_grade_edits": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "component": {
                  "type": "string",
                  "enum": [
                    "car_hood",
                    "car_roof",
                    "car_trunk",
                    "car_front_bumper",
                    "car_rear_bumper",
                    "car_door_fl",
                    "car_door_fr",
                    "car_door_rl",
                    "car_door_rr",
                    "car_fender_fl",
                    "car_fender_fr",
                    "car_quarter_rl",
                    "car_quarter_rr",
                    "car_rocker",
                    "car_mirror",
                    "car_wheel_fl",
                    "car_wheel_fr",
                    "car_wheel_rl",
                    "car_wheel_rr",
                    "car_windscreen",
                    "car_rear_glass",
                    "car_headlight_l",
                    "car_headlight_r",
                    "car_taillight_l",
                    "car_taillight_r",
                    "car_grille",
                    "dashboard",
                    "front_seats",
                    "rear_seats",
                    "cargo_area",
                    "engine_bay",
                    "tire_front_left",
                    "tire_front_right",
                    "tire_rear_left",
                    "tire_rear_right"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "damaged",
                    "clear",
                    "uncertain",
                    "not_visible",
                    "not_applicable"
                  ],
                  "description": "Visible component condition; clear is separate from the lowest damage grade."
                },
                "grade": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 5
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "1 is lowest damage and 5 highest. A grade is required only for damaged; all other states require null."
                },
                "evidence_ids": {
                  "minItems": 1,
                  "maxItems": 30,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "rationale": {
                  "type": "string",
                  "minLength": 10,
                  "maxLength": 1000
                }
              },
              "required": [
                "component",
                "status",
                "grade",
                "evidence_ids",
                "rationale"
              ],
              "additionalProperties": false,
              "description": "One physical component correction. Numeric grade 1-5 only for damaged; all other states require null. Evidence must be selected and accepted in this inspection; tyre evidence must match the configured tyre view."
            },
            "description": "At most one correction per component per review."
          },
          "lending_outcome": {
            "type": "object",
            "properties": {
              "decision_sequence": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "approved_deduction_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000000
              },
              "actual_repair_cost_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000000
              },
              "final_adjusted_value_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000000
              },
              "vehicle_group": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "observed_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
              },
              "rationale": {
                "type": "string",
                "minLength": 10,
                "maxLength": 1000
              }
            },
            "required": [
              "decision_sequence",
              "currency",
              "observed_at",
              "rationale"
            ],
            "additionalProperties": false,
            "description": "Observed labels only, not a policy change, payment or new lending amount. Values are integer minor units in the referenced saved decision currency. The latest recorded outcome replaces earlier calibration outcomes for this inspection."
          },
          "finding_edits": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finding_id": {
                  "type": "string",
                  "maxLength": 160
                },
                "disposition": {
                  "type": "string",
                  "enum": [
                    "confirmed",
                    "dismissed",
                    "corrected"
                  ]
                },
                "damage": {
                  "type": "object",
                  "properties": {
                    "finding_id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "panel": {
                      "type": "string",
                      "enum": [
                        "car_hood",
                        "car_roof",
                        "car_trunk",
                        "car_front_bumper",
                        "car_rear_bumper",
                        "car_door_fl",
                        "car_door_fr",
                        "car_door_rl",
                        "car_door_rr",
                        "car_fender_fl",
                        "car_fender_fr",
                        "car_quarter_rl",
                        "car_quarter_rr",
                        "car_rocker",
                        "car_mirror",
                        "car_wheel_fl",
                        "car_wheel_fr",
                        "car_wheel_rl",
                        "car_wheel_rr",
                        "car_windscreen",
                        "car_rear_glass",
                        "car_headlight_l",
                        "car_headlight_r",
                        "car_taillight_l",
                        "car_taillight_r",
                        "car_grille",
                        "dashboard",
                        "front_seats",
                        "rear_seats",
                        "cargo_area"
                      ]
                    },
                    "damage_type": {
                      "type": "string",
                      "enum": [
                        "scratch",
                        "dent",
                        "paint_chip",
                        "crack",
                        "broken",
                        "missing",
                        "rust",
                        "tear",
                        "stain",
                        "glass_damage",
                        "structural_concern",
                        "other"
                      ]
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "none",
                        "light",
                        "medium",
                        "severe"
                      ]
                    },
                    "bbox": {
                      "type": "array",
                      "prefixItems": [
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        },
                        {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 1
                        }
                      ]
                    },
                    "uncertainty": {
                      "type": "string",
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "finding_id",
                    "panel",
                    "damage_type",
                    "severity",
                    "bbox",
                    "uncertainty"
                  ],
                  "additionalProperties": false
                },
                "rationale": {
                  "type": "string",
                  "minLength": 5,
                  "maxLength": 500
                }
              },
              "required": [
                "finding_id",
                "disposition",
                "rationale"
              ],
              "additionalProperties": false
            }
          },
          "merge_findings": {
            "default": [],
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "finding_ids": {
                  "minItems": 2,
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  }
                },
                "canonical_finding_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                },
                "rationale": {
                  "type": "string",
                  "minLength": 10,
                  "maxLength": 1000
                }
              },
              "required": [
                "finding_ids",
                "canonical_finding_id",
                "rationale"
              ],
              "additionalProperties": false
            }
          },
          "recapture_slots": {
            "default": [],
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 48
            }
          },
          "added_findings": {
            "default": [],
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 48
                },
                "panel": {
                  "type": "string",
                  "enum": [
                    "car_hood",
                    "car_roof",
                    "car_trunk",
                    "car_front_bumper",
                    "car_rear_bumper",
                    "car_door_fl",
                    "car_door_fr",
                    "car_door_rl",
                    "car_door_rr",
                    "car_fender_fl",
                    "car_fender_fr",
                    "car_quarter_rl",
                    "car_quarter_rr",
                    "car_rocker",
                    "car_mirror",
                    "car_wheel_fl",
                    "car_wheel_fr",
                    "car_wheel_rl",
                    "car_wheel_rr",
                    "car_windscreen",
                    "car_rear_glass",
                    "car_headlight_l",
                    "car_headlight_r",
                    "car_taillight_l",
                    "car_taillight_r",
                    "car_grille",
                    "dashboard",
                    "front_seats",
                    "rear_seats",
                    "cargo_area"
                  ]
                },
                "damage_type": {
                  "type": "string",
                  "enum": [
                    "scratch",
                    "dent",
                    "paint_chip",
                    "crack",
                    "broken",
                    "missing",
                    "rust",
                    "tear",
                    "stain",
                    "glass_damage",
                    "structural_concern",
                    "other"
                  ]
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "light",
                    "medium",
                    "severe"
                  ]
                },
                "bbox": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  ]
                },
                "rationale": {
                  "type": "string",
                  "minLength": 5,
                  "maxLength": 500
                }
              },
              "required": [
                "slot",
                "panel",
                "damage_type",
                "severity",
                "rationale"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "decision",
          "expected_revision",
          "idempotency_key",
          "rationale",
          "finding_edits",
          "merge_findings",
          "recapture_slots",
          "added_findings"
        ],
        "additionalProperties": false
      },
      "Finalize": {
        "type": "object",
        "properties": {
          "signature_data_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1500000
              },
              {
                "type": "null"
              }
            ]
          },
          "signer_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "submission_mode": {
            "default": "normal",
            "type": "string",
            "enum": [
              "normal",
              "review"
            ]
          },
          "escalation_reasons": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "string",
              "minLength": 10,
              "maxLength": 500
            }
          }
        },
        "required": [
          "submission_mode",
          "escalation_reasons"
        ],
        "additionalProperties": false
      },
      "ValuationRequest": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "object",
            "properties": {
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "reference_kind": {
                "type": "string",
                "enum": [
                  "customer_book_value",
                  "nominal_test"
                ],
                "description": "nominal_test marks fictional test value; decisions are test-only and excluded from production funding and inspection billing."
              },
              "powertrain": {
                "type": "string",
                "enum": [
                  "petrol",
                  "diesel",
                  "electric",
                  "hybrid",
                  "other"
                ],
                "description": "Customer-supplied powertrain for selecting a component valuation group. Never inferred from an unknown vehicle."
              },
              "source": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              },
              "as_of": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "external_reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            },
            "required": [
              "amount_cents",
              "currency",
              "source",
              "as_of"
            ],
            "additionalProperties": false
          },
          "methodology": {
            "type": "object",
            "properties": {
              "methodology_id": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "findings_basis": {
                "default": "staff_reviewed",
                "type": "string",
                "enum": [
                  "staff_reviewed",
                  "machine_provisional"
                ]
              },
              "repair_matrix": {
                "default": [],
                "maxItems": 500,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "panel": {
                      "type": "string",
                      "enum": [
                        "car_hood",
                        "car_roof",
                        "car_trunk",
                        "car_front_bumper",
                        "car_rear_bumper",
                        "car_door_fl",
                        "car_door_fr",
                        "car_door_rl",
                        "car_door_rr",
                        "car_fender_fl",
                        "car_fender_fr",
                        "car_quarter_rl",
                        "car_quarter_rr",
                        "car_rocker",
                        "car_mirror",
                        "car_wheel_fl",
                        "car_wheel_fr",
                        "car_wheel_rl",
                        "car_wheel_rr",
                        "car_windscreen",
                        "car_rear_glass",
                        "car_headlight_l",
                        "car_headlight_r",
                        "car_taillight_l",
                        "car_taillight_r",
                        "car_grille",
                        "dashboard",
                        "front_seats",
                        "rear_seats",
                        "cargo_area",
                        "*"
                      ]
                    },
                    "damage_type": {
                      "type": "string",
                      "enum": [
                        "scratch",
                        "dent",
                        "paint_chip",
                        "crack",
                        "broken",
                        "missing",
                        "rust",
                        "tear",
                        "stain",
                        "glass_damage",
                        "structural_concern",
                        "other",
                        "*"
                      ]
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "light",
                        "medium",
                        "severe",
                        "*"
                      ]
                    },
                    "size_class": {
                      "default": "*",
                      "type": "string",
                      "enum": [
                        "unknown",
                        "small",
                        "medium",
                        "large",
                        "*"
                      ]
                    },
                    "amount_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 10000000000
                    },
                    "reference_percent_bps": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 10000
                    },
                    "repair_method": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "charge_basis": {
                      "type": "string",
                      "enum": [
                        "per_panel",
                        "per_finding"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "panel",
                    "damage_type",
                    "severity",
                    "size_class",
                    "amount_cents",
                    "repair_method",
                    "charge_basis"
                  ],
                  "additionalProperties": false
                }
              },
              "tire_replacement": {
                "type": "object",
                "properties": {
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000000
                  },
                  "conditions": {
                    "minItems": 1,
                    "maxItems": 2,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "appears_worn",
                        "appears_bald"
                      ]
                    }
                  }
                },
                "required": [
                  "amount_cents",
                  "conditions"
                ],
                "additionalProperties": false
              },
              "diminution": {
                "default": {
                  "mode": "none"
                },
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "none"
                      }
                    },
                    "required": [
                      "mode"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "percent_of_repair"
                      },
                      "percent": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      }
                    },
                    "required": [
                      "mode",
                      "percent"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "const": "fixed_per_severity"
                      },
                      "light": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      },
                      "medium": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      },
                      "severe": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      }
                    },
                    "required": [
                      "mode",
                      "light",
                      "medium",
                      "severe"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "collateral_discount_percent": {
                "default": 0,
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "deduct": {
                "default": {
                  "repair_cost": true,
                  "diminution": true,
                  "collateral_discount": true
                },
                "type": "object",
                "properties": {
                  "repair_cost": {
                    "type": "boolean"
                  },
                  "diminution": {
                    "type": "boolean"
                  },
                  "collateral_discount": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "repair_cost",
                  "diminution",
                  "collateral_discount"
                ],
                "additionalProperties": false
              },
              "floor_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              }
            },
            "required": [
              "methodology_id",
              "version",
              "label",
              "currency",
              "findings_basis",
              "repair_matrix",
              "diminution",
              "collateral_discount_percent",
              "deduct"
            ],
            "additionalProperties": false
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 120
          }
        },
        "required": [
          "reference",
          "methodology",
          "idempotency_key"
        ],
        "additionalProperties": false
      },
      "DecisionRequest": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "object",
            "properties": {
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000000000
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$"
              },
              "reference_kind": {
                "type": "string",
                "enum": [
                  "customer_book_value",
                  "nominal_test"
                ],
                "description": "nominal_test marks fictional test value; decisions are test-only and excluded from production funding and inspection billing."
              },
              "powertrain": {
                "type": "string",
                "enum": [
                  "petrol",
                  "diesel",
                  "electric",
                  "hybrid",
                  "other"
                ],
                "description": "Customer-supplied powertrain for selecting a component valuation group. Never inferred from an unknown vehicle."
              },
              "source": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              },
              "as_of": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "external_reference": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              }
            },
            "required": [
              "amount_cents",
              "currency",
              "source",
              "as_of"
            ],
            "additionalProperties": false
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 8,
            "maxLength": 120
          }
        },
        "required": [
          "reference",
          "idempotency_key"
        ],
        "additionalProperties": false
      },
      "LendingDecision": {
        "type": "object",
        "properties": {
          "decision_version": {
            "type": "string"
          },
          "inspection_id": {
            "type": "string"
          },
          "result_revision": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "decision_id": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "current": {
            "type": "boolean"
          },
          "policy": {
            "type": "object",
            "properties": {
              "policy_id": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "draft",
                  "confirmed"
                ]
              },
              "hash": {
                "type": "string"
              }
            },
            "required": [
              "policy_id",
              "version",
              "label",
              "status",
              "hash"
            ],
            "additionalProperties": false
          },
          "lending_eligibility_decision": {
            "type": "string",
            "enum": [
              "accepted",
              "discounted",
              "declined",
              "needs_recapture",
              "unable_to_assess"
            ]
          },
          "reason_codes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "component_critical_rule",
                "component_valuation_incomplete",
                "severe_damage",
                "damage_type_threshold",
                "multiple_damaged_panels",
                "engine_concern",
                "deductions_exceed_threshold",
                "vin_mismatch",
                "required_view_missing",
                "submitted_incomplete",
                "condition_uncertain",
                "analysis_incomplete",
                "coverage_incomplete",
                "identity_conflict",
                "reference_value_missing",
                "condition_deductions",
                "no_visible_damage",
                "unpriced_findings",
                "single_assessment_light_damage"
              ]
            }
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reason_catalog_version": {
            "type": "string"
          },
          "reason_facts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "component_critical_rule",
                    "component_valuation_incomplete",
                    "severe_damage",
                    "damage_type_threshold",
                    "multiple_damaged_panels",
                    "engine_concern",
                    "deductions_exceed_threshold",
                    "vin_mismatch",
                    "required_view_missing",
                    "submitted_incomplete",
                    "condition_uncertain",
                    "analysis_incomplete",
                    "coverage_incomplete",
                    "identity_conflict",
                    "reference_value_missing",
                    "condition_deductions",
                    "no_visible_damage",
                    "unpriced_findings",
                    "single_assessment_light_damage"
                  ]
                },
                "category": {
                  "type": "string",
                  "enum": [
                    "decline",
                    "identity",
                    "recapture",
                    "incomplete",
                    "advisory"
                  ]
                },
                "rule": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "policy_version": {
                  "type": "string"
                },
                "policy_hash": {
                  "type": "string"
                },
                "threshold": {},
                "defect_ids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "evidence_ids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "missing_views": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "actual_deductions_cents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "reference_cents": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "code",
                "category",
                "rule",
                "description",
                "policy_version",
                "policy_hash",
                "defect_ids",
                "evidence_ids",
                "missing_views"
              ],
              "additionalProperties": false
            }
          },
          "condition_assessment": {
            "type": "object",
            "properties": {
              "component_grades": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "component-severity-v1"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "assessed",
                      "partial"
                    ]
                  },
                  "percentage_loss_status": {
                    "type": "string",
                    "enum": [
                      "awaiting_matrix",
                      "computed",
                      "incomplete"
                    ]
                  },
                  "components": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "damaged",
                            "clear",
                            "uncertain",
                            "not_visible",
                            "not_applicable"
                          ],
                          "description": "Visible component condition; clear is separate from the lowest damage grade."
                        },
                        "grade": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 5
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "1 is lowest damage and 5 highest. A grade is required only for damaged; all other states require null."
                        },
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "slots": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "position_verified": {
                          "type": "boolean",
                          "const": false,
                          "description": "Tyre position comes from the configured capture view and has not been established from pixels."
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "machine",
                            "staff"
                          ]
                        },
                        "review_revision": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "component",
                        "status",
                        "grade",
                        "reasons",
                        "evidence_ids",
                        "slots"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "version",
                  "status",
                  "percentage_loss_status",
                  "components"
                ],
                "additionalProperties": false
              },
              "grade": {
                "type": "string",
                "enum": [
                  "clean",
                  "minor",
                  "moderate",
                  "severe"
                ]
              },
              "defect_count": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "damaged_panels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "defects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "defect_id": {
                      "type": "string"
                    },
                    "panel": {
                      "type": "string"
                    },
                    "damage_type": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "light",
                        "medium",
                        "severe"
                      ]
                    },
                    "finding_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "evidence_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "slots": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "single_assessment": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "defect_id",
                    "panel",
                    "damage_type",
                    "severity",
                    "finding_ids",
                    "evidence_ids",
                    "slots"
                  ],
                  "additionalProperties": false
                }
              },
              "engine_concerns": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "concern": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "light",
                        "medium",
                        "severe"
                      ]
                    },
                    "evidence_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "concern",
                    "severity",
                    "evidence_id"
                  ],
                  "additionalProperties": false
                }
              },
              "tires": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "slot": {
                      "type": "string"
                    },
                    "evidence_id": {
                      "type": "string"
                    },
                    "visual_tread_condition": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "slot",
                    "evidence_id",
                    "visual_tread_condition"
                  ],
                  "additionalProperties": false
                }
              },
              "excluded_findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "finding_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "finding_id",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              },
              "missing_required_views": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "capture_state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "coverage_state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "analysis_state": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "grade",
              "defect_count",
              "damaged_panels",
              "defects",
              "engine_concerns",
              "tires",
              "excluded_findings",
              "missing_required_views",
              "capture_state",
              "coverage_state",
              "analysis_state"
            ],
            "additionalProperties": false
          },
          "identity": {
            "type": "object",
            "properties": {
              "expected_vin": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "detected_vin": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "detected_vin_checksum_valid": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "vin_status": {
                "type": "string",
                "enum": [
                  "match",
                  "mismatch",
                  "not_supplied",
                  "not_read",
                  "invalid_format"
                ]
              },
              "vehicle_class": {
                "type": "string"
              },
              "steering_side": {
                "type": "string"
              },
              "cab": {
                "type": "string"
              },
              "identity_at_creation": {
                "anyOf": [
                  {},
                  {
                    "type": "null"
                  }
                ]
              },
              "decoded_from_photo": {
                "anyOf": [
                  {},
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "expected_vin",
              "detected_vin",
              "detected_vin_checksum_valid",
              "vin_status",
              "vehicle_class",
              "steering_side",
              "cab",
              "identity_at_creation",
              "decoded_from_photo"
            ],
            "additionalProperties": false
          },
          "valuation": {
            "type": "object",
            "properties": {
              "component_valuation": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "component-loss-v1"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "computed",
                      "incomplete",
                      "reference_missing",
                      "vehicle_group_unmatched",
                      "currency_mismatch"
                    ]
                  },
                  "matrix_label": {
                    "type": "string"
                  },
                  "group_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "group_label": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "test_only": {
                    "type": "boolean"
                  },
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "grade": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 5
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "loss_percent": {
                          "type": "number",
                          "minimum": 0,
                          "maximum": 100
                        },
                        "amount_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10000000000
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "machine",
                            "staff"
                          ]
                        }
                      },
                      "required": [
                        "component",
                        "grade",
                        "loss_percent",
                        "amount_cents",
                        "evidence_ids"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "unpriced": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "component",
                        "reason"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "raw_deductions_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 800000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "total_deductions_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "adjusted_value_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cap_applied": {
                    "type": "boolean"
                  },
                  "triggered_rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "label"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "version",
                  "status",
                  "matrix_label",
                  "group_id",
                  "group_label",
                  "test_only",
                  "lines",
                  "unpriced",
                  "raw_deductions_cents",
                  "total_deductions_cents",
                  "adjusted_value_cents",
                  "cap_applied",
                  "triggered_rules"
                ],
                "additionalProperties": false
              },
              "currency": {
                "type": "string"
              },
              "pricing_state": {
                "type": "string",
                "enum": [
                  "computed",
                  "reference_missing",
                  "incomplete"
                ]
              },
              "reference": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "amount_cents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 10000000000
                      },
                      "currency": {
                        "type": "string",
                        "pattern": "^[A-Z]{3}$"
                      },
                      "reference_kind": {
                        "type": "string",
                        "enum": [
                          "customer_book_value",
                          "nominal_test"
                        ],
                        "description": "nominal_test marks fictional test value; decisions are test-only and excluded from production funding and inspection billing."
                      },
                      "powertrain": {
                        "type": "string",
                        "enum": [
                          "petrol",
                          "diesel",
                          "electric",
                          "hybrid",
                          "other"
                        ],
                        "description": "Customer-supplied powertrain for selecting a component valuation group. Never inferred from an unknown vehicle."
                      },
                      "source": {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 120
                      },
                      "as_of": {
                        "type": "string",
                        "format": "date",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                      },
                      "external_reference": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 120
                      }
                    },
                    "required": [
                      "amount_cents",
                      "currency",
                      "source",
                      "as_of"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "methodology": {
                "type": "object",
                "properties": {
                  "methodology_id": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "hash": {
                    "type": "string"
                  }
                },
                "required": [
                  "methodology_id",
                  "version",
                  "label",
                  "hash"
                ],
                "additionalProperties": false
              },
              "line_items": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "rule_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "kind": {
                          "type": "string",
                          "const": "damage"
                        },
                        "panel": {
                          "type": "string"
                        },
                        "damage_types": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "severity": {
                          "type": "string",
                          "enum": [
                            "light",
                            "medium",
                            "severe"
                          ]
                        },
                        "defects": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "defect_id": {
                                "type": "string"
                              },
                              "damage_type": {
                                "type": "string"
                              },
                              "severity": {
                                "type": "string",
                                "enum": [
                                  "light",
                                  "medium",
                                  "severe"
                                ]
                              }
                            },
                            "required": [
                              "defect_id",
                              "damage_type",
                              "severity"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "calculations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rule_id": {
                                "type": "string"
                              },
                              "fixed_cents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "reference_percent_bps": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000
                              },
                              "reference_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "percentage_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "resolved_cents": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "computed",
                                  "reference_missing"
                                ]
                              }
                            },
                            "required": [
                              "rule_id",
                              "fixed_cents",
                              "reference_percent_bps",
                              "reference_cents",
                              "percentage_cents",
                              "resolved_cents",
                              "status"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "pricing_state": {
                          "type": "string",
                          "enum": [
                            "computed",
                            "reference_missing"
                          ]
                        },
                        "repair_method": {
                          "type": "string"
                        },
                        "defect_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "evidence_ids",
                        "rule_ids",
                        "amount_cents",
                        "kind",
                        "panel",
                        "repair_method",
                        "defect_ids"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "rule_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "kind": {
                          "type": "string",
                          "const": "tire"
                        },
                        "slot": {
                          "type": "string"
                        },
                        "damage_type": {
                          "type": "string",
                          "const": "tire_condition"
                        },
                        "severity": {
                          "type": "null"
                        },
                        "visual_tread_condition": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "evidence_ids",
                        "rule_ids",
                        "amount_cents",
                        "kind",
                        "slot"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "component": {
                          "type": "string"
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "rule_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "kind": {
                          "type": "string",
                          "const": "engine"
                        },
                        "concern": {
                          "type": "string"
                        },
                        "damage_type": {
                          "type": "string"
                        },
                        "severity": {
                          "type": "string",
                          "enum": [
                            "light",
                            "medium",
                            "severe"
                          ]
                        }
                      },
                      "required": [
                        "evidence_ids",
                        "rule_ids",
                        "amount_cents",
                        "kind",
                        "concern",
                        "severity"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "unpriced": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "defect_id": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "defect_id",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "repair_cost_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Not a repair estimate when a component percentage grid applies."
                  },
                  "collateral_discount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "total_deductions_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null when a component grid cannot be fully priced; never interpret missing grades as zero loss."
                  },
                  "adjusted_collateral_value_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "repair_cost_cents",
                  "collateral_discount_cents",
                  "total_deductions_cents",
                  "adjusted_collateral_value_cents"
                ],
                "additionalProperties": false
              },
              "advance_percent": {
                "type": "number"
              },
              "lending_value_cents": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "value_state": {
                "type": "string",
                "enum": [
                  "declined_zero",
                  "computed",
                  "reference_missing",
                  "not_applicable"
                ]
              }
            },
            "required": [
              "currency",
              "reference",
              "methodology",
              "line_items",
              "unpriced",
              "totals",
              "advance_percent",
              "lending_value_cents",
              "value_state"
            ],
            "additionalProperties": false
          },
          "qualification": {
            "type": "object",
            "properties": {
              "test_only": {
                "type": "boolean",
                "const": true,
                "description": "Nominal test result; must not trigger production lending or ordinary inspection billing."
              },
              "automatic": {
                "type": "boolean"
              },
              "staff_review_required": {
                "type": "boolean"
              },
              "policy_status": {
                "type": "string",
                "enum": [
                  "draft",
                  "confirmed"
                ]
              },
              "limitations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "automatic",
              "staff_review_required",
              "policy_status",
              "limitations"
            ],
            "additionalProperties": false
          },
          "input_hash": {
            "type": "string"
          }
        },
        "required": [
          "decision_version",
          "inspection_id",
          "result_revision",
          "policy",
          "lending_eligibility_decision",
          "reason_codes",
          "reasons",
          "condition_assessment",
          "identity",
          "valuation",
          "qualification",
          "input_hash"
        ],
        "additionalProperties": false
      },
      "LendingDecisionResponse": {
        "type": "object",
        "properties": {
          "inspection_id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "decision": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "decision_version": {
                    "type": "string"
                  },
                  "inspection_id": {
                    "type": "string"
                  },
                  "result_revision": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "decision_id": {
                    "type": "string"
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "current": {
                    "type": "boolean"
                  },
                  "policy": {
                    "type": "object",
                    "properties": {
                      "policy_id": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "draft",
                          "confirmed"
                        ]
                      },
                      "hash": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "policy_id",
                      "version",
                      "label",
                      "status",
                      "hash"
                    ],
                    "additionalProperties": false
                  },
                  "lending_eligibility_decision": {
                    "type": "string",
                    "enum": [
                      "accepted",
                      "discounted",
                      "declined",
                      "needs_recapture",
                      "unable_to_assess"
                    ]
                  },
                  "reason_codes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "component_critical_rule",
                        "component_valuation_incomplete",
                        "severe_damage",
                        "damage_type_threshold",
                        "multiple_damaged_panels",
                        "engine_concern",
                        "deductions_exceed_threshold",
                        "vin_mismatch",
                        "required_view_missing",
                        "submitted_incomplete",
                        "condition_uncertain",
                        "analysis_incomplete",
                        "coverage_incomplete",
                        "identity_conflict",
                        "reference_value_missing",
                        "condition_deductions",
                        "no_visible_damage",
                        "unpriced_findings",
                        "single_assessment_light_damage"
                      ]
                    }
                  },
                  "reasons": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "reason_catalog_version": {
                    "type": "string"
                  },
                  "reason_facts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "component_critical_rule",
                            "component_valuation_incomplete",
                            "severe_damage",
                            "damage_type_threshold",
                            "multiple_damaged_panels",
                            "engine_concern",
                            "deductions_exceed_threshold",
                            "vin_mismatch",
                            "required_view_missing",
                            "submitted_incomplete",
                            "condition_uncertain",
                            "analysis_incomplete",
                            "coverage_incomplete",
                            "identity_conflict",
                            "reference_value_missing",
                            "condition_deductions",
                            "no_visible_damage",
                            "unpriced_findings",
                            "single_assessment_light_damage"
                          ]
                        },
                        "category": {
                          "type": "string",
                          "enum": [
                            "decline",
                            "identity",
                            "recapture",
                            "incomplete",
                            "advisory"
                          ]
                        },
                        "rule": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "policy_version": {
                          "type": "string"
                        },
                        "policy_hash": {
                          "type": "string"
                        },
                        "threshold": {},
                        "defect_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "evidence_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "missing_views": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "actual_deductions_cents": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "reference_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "code",
                        "category",
                        "rule",
                        "description",
                        "policy_version",
                        "policy_hash",
                        "defect_ids",
                        "evidence_ids",
                        "missing_views"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "condition_assessment": {
                    "type": "object",
                    "properties": {
                      "component_grades": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string",
                            "const": "component-severity-v1"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "assessed",
                              "partial"
                            ]
                          },
                          "percentage_loss_status": {
                            "type": "string",
                            "enum": [
                              "awaiting_matrix",
                              "computed",
                              "incomplete"
                            ]
                          },
                          "components": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "damaged",
                                    "clear",
                                    "uncertain",
                                    "not_visible",
                                    "not_applicable"
                                  ],
                                  "description": "Visible component condition; clear is separate from the lowest damage grade."
                                },
                                "grade": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 5
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ],
                                  "description": "1 is lowest damage and 5 highest. A grade is required only for damaged; all other states require null."
                                },
                                "reasons": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "evidence_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "slots": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "position_verified": {
                                  "type": "boolean",
                                  "const": false,
                                  "description": "Tyre position comes from the configured capture view and has not been established from pixels."
                                },
                                "source": {
                                  "type": "string",
                                  "enum": [
                                    "machine",
                                    "staff"
                                  ]
                                },
                                "review_revision": {
                                  "type": "integer",
                                  "exclusiveMinimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "component",
                                "status",
                                "grade",
                                "reasons",
                                "evidence_ids",
                                "slots"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "version",
                          "status",
                          "percentage_loss_status",
                          "components"
                        ],
                        "additionalProperties": false
                      },
                      "grade": {
                        "type": "string",
                        "enum": [
                          "clean",
                          "minor",
                          "moderate",
                          "severe"
                        ]
                      },
                      "defect_count": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "damaged_panels": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "defects": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "defect_id": {
                              "type": "string"
                            },
                            "panel": {
                              "type": "string"
                            },
                            "damage_type": {
                              "type": "string"
                            },
                            "severity": {
                              "type": "string",
                              "enum": [
                                "light",
                                "medium",
                                "severe"
                              ]
                            },
                            "finding_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "evidence_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "slots": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "single_assessment": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "defect_id",
                            "panel",
                            "damage_type",
                            "severity",
                            "finding_ids",
                            "evidence_ids",
                            "slots"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "engine_concerns": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "concern": {
                              "type": "string"
                            },
                            "severity": {
                              "type": "string",
                              "enum": [
                                "light",
                                "medium",
                                "severe"
                              ]
                            },
                            "evidence_id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "concern",
                            "severity",
                            "evidence_id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "tires": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "slot": {
                              "type": "string"
                            },
                            "evidence_id": {
                              "type": "string"
                            },
                            "visual_tread_condition": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "slot",
                            "evidence_id",
                            "visual_tread_condition"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "excluded_findings": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "finding_id": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "finding_id",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "missing_required_views": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "capture_state": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "coverage_state": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "analysis_state": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "grade",
                      "defect_count",
                      "damaged_panels",
                      "defects",
                      "engine_concerns",
                      "tires",
                      "excluded_findings",
                      "missing_required_views",
                      "capture_state",
                      "coverage_state",
                      "analysis_state"
                    ],
                    "additionalProperties": false
                  },
                  "identity": {
                    "type": "object",
                    "properties": {
                      "expected_vin": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "detected_vin": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "detected_vin_checksum_valid": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "vin_status": {
                        "type": "string",
                        "enum": [
                          "match",
                          "mismatch",
                          "not_supplied",
                          "not_read",
                          "invalid_format"
                        ]
                      },
                      "vehicle_class": {
                        "type": "string"
                      },
                      "steering_side": {
                        "type": "string"
                      },
                      "cab": {
                        "type": "string"
                      },
                      "identity_at_creation": {
                        "anyOf": [
                          {},
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "decoded_from_photo": {
                        "anyOf": [
                          {},
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "expected_vin",
                      "detected_vin",
                      "detected_vin_checksum_valid",
                      "vin_status",
                      "vehicle_class",
                      "steering_side",
                      "cab",
                      "identity_at_creation",
                      "decoded_from_photo"
                    ],
                    "additionalProperties": false
                  },
                  "valuation": {
                    "type": "object",
                    "properties": {
                      "component_valuation": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string",
                            "const": "component-loss-v1"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "computed",
                              "incomplete",
                              "reference_missing",
                              "vehicle_group_unmatched",
                              "currency_mismatch"
                            ]
                          },
                          "matrix_label": {
                            "type": "string"
                          },
                          "group_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "group_label": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "test_only": {
                            "type": "boolean"
                          },
                          "lines": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "grade": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 5
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "loss_percent": {
                                  "type": "number",
                                  "minimum": 0,
                                  "maximum": 100
                                },
                                "amount_cents": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 10000000000
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "source": {
                                  "type": "string",
                                  "enum": [
                                    "machine",
                                    "staff"
                                  ]
                                }
                              },
                              "required": [
                                "component",
                                "grade",
                                "loss_percent",
                                "amount_cents",
                                "evidence_ids"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "unpriced": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "reason": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "component",
                                "reason"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "raw_deductions_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 800000000000
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "total_deductions_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000000000
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "adjusted_value_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000000000
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cap_applied": {
                            "type": "boolean"
                          },
                          "triggered_rules": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "label": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "label"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "version",
                          "status",
                          "matrix_label",
                          "group_id",
                          "group_label",
                          "test_only",
                          "lines",
                          "unpriced",
                          "raw_deductions_cents",
                          "total_deductions_cents",
                          "adjusted_value_cents",
                          "cap_applied",
                          "triggered_rules"
                        ],
                        "additionalProperties": false
                      },
                      "currency": {
                        "type": "string"
                      },
                      "pricing_state": {
                        "type": "string",
                        "enum": [
                          "computed",
                          "reference_missing",
                          "incomplete"
                        ]
                      },
                      "reference": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "amount_cents": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000000000
                              },
                              "currency": {
                                "type": "string",
                                "pattern": "^[A-Z]{3}$"
                              },
                              "reference_kind": {
                                "type": "string",
                                "enum": [
                                  "customer_book_value",
                                  "nominal_test"
                                ],
                                "description": "nominal_test marks fictional test value; decisions are test-only and excluded from production funding and inspection billing."
                              },
                              "powertrain": {
                                "type": "string",
                                "enum": [
                                  "petrol",
                                  "diesel",
                                  "electric",
                                  "hybrid",
                                  "other"
                                ],
                                "description": "Customer-supplied powertrain for selecting a component valuation group. Never inferred from an unknown vehicle."
                              },
                              "source": {
                                "type": "string",
                                "minLength": 2,
                                "maxLength": 120
                              },
                              "as_of": {
                                "type": "string",
                                "format": "date",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                              },
                              "external_reference": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              }
                            },
                            "required": [
                              "amount_cents",
                              "currency",
                              "source",
                              "as_of"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "methodology": {
                        "type": "object",
                        "properties": {
                          "methodology_id": {
                            "type": "string"
                          },
                          "version": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "hash": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "methodology_id",
                          "version",
                          "label",
                          "hash"
                        ],
                        "additionalProperties": false
                      },
                      "line_items": {
                        "type": "array",
                        "items": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "evidence_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rule_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "amount_cents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "damage"
                                },
                                "panel": {
                                  "type": "string"
                                },
                                "damage_types": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "light",
                                    "medium",
                                    "severe"
                                  ]
                                },
                                "defects": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "defect_id": {
                                        "type": "string"
                                      },
                                      "damage_type": {
                                        "type": "string"
                                      },
                                      "severity": {
                                        "type": "string",
                                        "enum": [
                                          "light",
                                          "medium",
                                          "severe"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "defect_id",
                                      "damage_type",
                                      "severity"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "calculations": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "rule_id": {
                                        "type": "string"
                                      },
                                      "fixed_cents": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      },
                                      "reference_percent_bps": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 10000
                                      },
                                      "reference_cents": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "percentage_cents": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "resolved_cents": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "computed",
                                          "reference_missing"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "rule_id",
                                      "fixed_cents",
                                      "reference_percent_bps",
                                      "reference_cents",
                                      "percentage_cents",
                                      "resolved_cents",
                                      "status"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "pricing_state": {
                                  "type": "string",
                                  "enum": [
                                    "computed",
                                    "reference_missing"
                                  ]
                                },
                                "repair_method": {
                                  "type": "string"
                                },
                                "defect_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "evidence_ids",
                                "rule_ids",
                                "amount_cents",
                                "kind",
                                "panel",
                                "repair_method",
                                "defect_ids"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "evidence_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rule_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "amount_cents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "tire"
                                },
                                "slot": {
                                  "type": "string"
                                },
                                "damage_type": {
                                  "type": "string",
                                  "const": "tire_condition"
                                },
                                "severity": {
                                  "type": "null"
                                },
                                "visual_tread_condition": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "evidence_ids",
                                "rule_ids",
                                "amount_cents",
                                "kind",
                                "slot"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "component": {
                                  "type": "string"
                                },
                                "evidence_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "rule_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "amount_cents": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                "kind": {
                                  "type": "string",
                                  "const": "engine"
                                },
                                "concern": {
                                  "type": "string"
                                },
                                "damage_type": {
                                  "type": "string"
                                },
                                "severity": {
                                  "type": "string",
                                  "enum": [
                                    "light",
                                    "medium",
                                    "severe"
                                  ]
                                }
                              },
                              "required": [
                                "evidence_ids",
                                "rule_ids",
                                "amount_cents",
                                "kind",
                                "concern",
                                "severity"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "unpriced": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "defect_id": {
                              "type": "string"
                            },
                            "reason": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "defect_id",
                            "reason"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "totals": {
                        "type": "object",
                        "properties": {
                          "repair_cost_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Not a repair estimate when a component percentage grid applies."
                          },
                          "collateral_discount_cents": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "total_deductions_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Null when a component grid cannot be fully priced; never interpret missing grades as zero loss."
                          },
                          "adjusted_collateral_value_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "repair_cost_cents",
                          "collateral_discount_cents",
                          "total_deductions_cents",
                          "adjusted_collateral_value_cents"
                        ],
                        "additionalProperties": false
                      },
                      "advance_percent": {
                        "type": "number"
                      },
                      "lending_value_cents": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "value_state": {
                        "type": "string",
                        "enum": [
                          "declined_zero",
                          "computed",
                          "reference_missing",
                          "not_applicable"
                        ]
                      }
                    },
                    "required": [
                      "currency",
                      "reference",
                      "methodology",
                      "line_items",
                      "unpriced",
                      "totals",
                      "advance_percent",
                      "lending_value_cents",
                      "value_state"
                    ],
                    "additionalProperties": false
                  },
                  "qualification": {
                    "type": "object",
                    "properties": {
                      "test_only": {
                        "type": "boolean",
                        "const": true,
                        "description": "Nominal test result; must not trigger production lending or ordinary inspection billing."
                      },
                      "automatic": {
                        "type": "boolean"
                      },
                      "staff_review_required": {
                        "type": "boolean"
                      },
                      "policy_status": {
                        "type": "string",
                        "enum": [
                          "draft",
                          "confirmed"
                        ]
                      },
                      "limitations": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "automatic",
                      "staff_review_required",
                      "policy_status",
                      "limitations"
                    ],
                    "additionalProperties": false
                  },
                  "input_hash": {
                    "type": "string"
                  }
                },
                "required": [
                  "decision_version",
                  "inspection_id",
                  "result_revision",
                  "policy",
                  "lending_eligibility_decision",
                  "reason_codes",
                  "reasons",
                  "condition_assessment",
                  "identity",
                  "valuation",
                  "qualification",
                  "input_hash"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "inspection_id",
          "decision"
        ],
        "additionalProperties": false
      },
      "LendingDeductionLine": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "component": {
                "type": "string"
              },
              "evidence_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rule_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kind": {
                "type": "string",
                "const": "damage"
              },
              "panel": {
                "type": "string"
              },
              "damage_types": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "severity": {
                "type": "string",
                "enum": [
                  "light",
                  "medium",
                  "severe"
                ]
              },
              "defects": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "defect_id": {
                      "type": "string"
                    },
                    "damage_type": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "light",
                        "medium",
                        "severe"
                      ]
                    }
                  },
                  "required": [
                    "defect_id",
                    "damage_type",
                    "severity"
                  ],
                  "additionalProperties": false
                }
              },
              "calculations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "rule_id": {
                      "type": "string"
                    },
                    "fixed_cents": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "reference_percent_bps": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 10000
                    },
                    "reference_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "percentage_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resolved_cents": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "computed",
                        "reference_missing"
                      ]
                    }
                  },
                  "required": [
                    "rule_id",
                    "fixed_cents",
                    "reference_percent_bps",
                    "reference_cents",
                    "percentage_cents",
                    "resolved_cents",
                    "status"
                  ],
                  "additionalProperties": false
                }
              },
              "pricing_state": {
                "type": "string",
                "enum": [
                  "computed",
                  "reference_missing"
                ]
              },
              "repair_method": {
                "type": "string"
              },
              "defect_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "evidence_ids",
              "rule_ids",
              "amount_cents",
              "kind",
              "panel",
              "repair_method",
              "defect_ids"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "component": {
                "type": "string"
              },
              "evidence_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rule_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kind": {
                "type": "string",
                "const": "tire"
              },
              "slot": {
                "type": "string"
              },
              "damage_type": {
                "type": "string",
                "const": "tire_condition"
              },
              "severity": {
                "type": "null"
              },
              "visual_tread_condition": {
                "type": "string"
              }
            },
            "required": [
              "evidence_ids",
              "rule_ids",
              "amount_cents",
              "kind",
              "slot"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "component": {
                "type": "string"
              },
              "evidence_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rule_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "amount_cents": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kind": {
                "type": "string",
                "const": "engine"
              },
              "concern": {
                "type": "string"
              },
              "damage_type": {
                "type": "string"
              },
              "severity": {
                "type": "string",
                "enum": [
                  "light",
                  "medium",
                  "severe"
                ]
              }
            },
            "required": [
              "evidence_ids",
              "rule_ids",
              "amount_cents",
              "kind",
              "concern",
              "severity"
            ],
            "additionalProperties": false
          }
        ]
      },
      "LendingReason": {
        "type": "string",
        "enum": [
          "component_critical_rule",
          "component_valuation_incomplete",
          "severe_damage",
          "damage_type_threshold",
          "multiple_damaged_panels",
          "engine_concern",
          "deductions_exceed_threshold",
          "vin_mismatch",
          "required_view_missing",
          "submitted_incomplete",
          "condition_uncertain",
          "analysis_incomplete",
          "coverage_incomplete",
          "identity_conflict",
          "reference_value_missing",
          "condition_deductions",
          "no_visible_damage",
          "unpriced_findings",
          "single_assessment_light_damage"
        ]
      },
      "ReserveClip": {
        "type": "object",
        "properties": {
          "clip": {
            "type": "string",
            "enum": [
              "exterior",
              "interior"
            ]
          },
          "client_request_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_-]{8,120}$"
          },
          "bytes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 209715200
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "mime": {
            "type": "string",
            "enum": [
              "video/mp4",
              "video/quicktime",
              "video/webm"
            ]
          },
          "source_mode": {
            "default": "unknown",
            "type": "string",
            "enum": [
              "camera",
              "library",
              "unknown"
            ]
          }
        },
        "required": [
          "clip",
          "client_request_id",
          "bytes",
          "sha256",
          "mime",
          "source_mode"
        ],
        "additionalProperties": false
      },
      "Clip": {
        "type": "object",
        "required": [
          "clip_id",
          "clip",
          "state"
        ],
        "properties": {
          "clip_id": {
            "type": "string",
            "format": "uuid"
          },
          "clip": {
            "enum": [
              "exterior",
              "interior"
            ]
          },
          "recording": {
            "type": "integer"
          },
          "state": {
            "enum": [
              "uploading",
              "queued",
              "processing",
              "processed",
              "failed",
              "rejected",
              "abandoned"
            ]
          },
          "selected": {
            "type": "boolean"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "frames_selected": {
            "type": [
              "integer",
              "null"
            ]
          },
          "frames_assigned": {
            "type": [
              "integer",
              "null"
            ]
          },
          "chunk_count": {
            "type": "integer"
          },
          "chunk_bytes": {
            "type": "integer"
          },
          "upload_deadline": {
            "type": "string",
            "format": "date-time"
          },
          "uploads": {
            "type": "array",
            "description": "One-object signed upload URLs for chunks not yet stored. PUT the exact chunk bytes with Content-Type application/octet-stream; never send a Verify key there.",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "bytes": {
                  "type": "integer"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "Image": {
        "type": "object",
        "required": [
          "image_id",
          "slot",
          "state",
          "stage"
        ],
        "description": "One submitted photograph of a coverage-first collection. Every image is kept and analyzed on its own; coverage never removes one.",
        "properties": {
          "image_id": {
            "type": "string",
            "format": "uuid"
          },
          "attempt_id": {
            "type": "string",
            "format": "uuid",
            "description": "Alias of image_id for attempt-style recovery"
          },
          "slot": {
            "type": "string",
            "description": "image_1 .. image_60 (30 for legacy v1)"
          },
          "number": {
            "type": "integer"
          },
          "client_request_id": {
            "type": "string"
          },
          "state": {
            "enum": [
              "reserved",
              "processing",
              "accepted",
              "review_required",
              "processing_failed",
              "abandoned",
              "late_after_submit"
            ]
          },
          "stage": {
            "enum": [
              "uploading",
              "received",
              "queued",
              "analyzing",
              "analyzed",
              "uncertain",
              "failed",
              "abandoned"
            ]
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "analyzed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "detail": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "decision": {
                "enum": [
                  "accepted",
                  "review_required"
                ]
              },
              "reason_codes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "feedback": {
                "type": "string"
              },
              "findings": {
                "type": "integer"
              },
              "detected_view": {
                "type": "string"
              },
              "detected_component": {
                "type": "string"
              }
            }
          },
          "confirms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Required views this image's detailed observation proves"
          },
          "supports": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Views receiving panel evidence from this image; it does not prove those views alone"
          },
          "provisional_views": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reused_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "retry_allowed": {
            "type": "boolean"
          }
        }
      },
      "Collection": {
        "type": "object",
        "required": [
          "workflow",
          "manifest_hash",
          "image_count",
          "coverage",
          "views",
          "images",
          "progress",
          "blocking",
          "can_submit"
        ],
        "description": "State of a coverage-first collection: one coverage run per exact set of images, per-view provisional and confirmed coverage, per-image progress and what still blocks submission.",
        "properties": {
          "workflow": {
            "enum": [
              "coverage_then_detail_v1",
              "collective_coverage_then_detail_v2"
            ]
          },
          "coverage_mode": {
            "const": "cumulative_panels_v1",
            "description": "Optional exterior panel rollup, pinned when the session is created"
          },
          "manifest_hash": {
            "type": "string"
          },
          "image_count": {
            "type": "integer"
          },
          "image_cap": {
            "type": "integer"
          },
          "coverage": {
            "type": "object",
            "properties": {
              "state": {
                "enum": [
                  "unchecked",
                  "checking",
                  "complete",
                  "incomplete",
                  "stale",
                  "failed"
                ]
              },
              "run_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "passed": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "same_vehicle": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "consistent",
                  "inconsistent",
                  "unknown",
                  null
                ]
              },
              "checked_image_count": {
                "type": "integer"
              },
              "exterior": {
                "type": "object",
                "description": "Versioned per-image physical-portion proof, profile and contract hashes, localized observations, source IDs and explicit exclusions."
              },
              "challenges": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              },
              "retry_available": {
                "type": "boolean",
                "description": "Joint coverage only: the provider response for this exact collection failed its contract and the borrower may retry it (at most three attempts per collection). The state is then `failed`."
              }
            }
          },
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string"
                },
                "view": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "provisional": {
                  "enum": [
                    "present",
                    "uncertain",
                    "missing",
                    "unchecked"
                  ]
                },
                "provisional_image_ids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "confirmed_by": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "confirmation_method": {
                  "enum": [
                    "single_image",
                    "cumulative_panels",
                    null
                  ]
                },
                "panel_coverage": {
                  "type": "object",
                  "properties": {
                    "complete": {
                      "type": "boolean"
                    },
                    "evidence_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "panels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "zone": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "state": {
                            "enum": [
                              "observed",
                              "partial",
                              "unknown"
                            ]
                          },
                          "evidence_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "anchor_evidence_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "state": {
                  "enum": [
                    "confirmed",
                    "present",
                    "uncertain",
                    "missing",
                    "unchecked"
                  ]
                }
              }
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Image"
            }
          },
          "progress": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "blocking": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "can_submit": {
            "type": "boolean"
          },
          "work_pending": {
            "type": "boolean"
          },
          "coverage_due": {
            "type": "boolean"
          },
          "cross_frame": {
            "type": "object",
            "description": "Sessions created with cross-frame confirmation only: progress of the check that compares each walkaround damage finding with other photos of the same panel. Submission waits while state is `checking`; a failed check never blocks submission and remains suspected damage requiring staff review. The damage-evidence-v2.0 candidate distinguishes supported, normal/reflection, uncertain and not-assessed findings; unresolved evidence withholds valuation totals. Per-finding results are on the staff inspection record.",
            "properties": {
              "state": {
                "enum": [
                  "idle",
                  "checking",
                  "complete",
                  "unavailable"
                ]
              },
              "findings": {
                "type": "integer"
              },
              "done": {
                "type": "integer"
              },
              "checking": {
                "type": "integer"
              },
              "due": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "inspection_id": {
            "type": "string"
          },
          "session_id": {
            "type": "string",
            "description": "Verified capture-session identifier on revoked/already_submitted configuration reads; remove that device queue. Expired/rotated credentials retain recoverable local photos."
          },
          "blocking": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "CaptureShotDefinition": {
        "type": "object",
        "required": [
          "slot",
          "label",
          "required"
        ],
        "properties": {
          "slot": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "instructions": {
            "type": "string"
          },
          "repeatable": {
            "type": "integer",
            "minimum": 1,
            "description": "Expand slot to slot_1 through slot_N; the base name is not an upload slot."
          },
          "guide": {
            "type": "string"
          },
          "overlay": {
            "type": "string"
          },
          "custom_overlay": {
            "type": "string",
            "description": "Pinned, sanitized SVG data URL."
          },
          "landscape_required": {
            "type": "boolean"
          },
          "kind": {
            "enum": [
              "tire",
              "component"
            ]
          },
          "clip": {
            "enum": [
              "exterior",
              "interior"
            ]
          }
        }
      },
      "CaptureShotState": {
        "type": "object",
        "required": [
          "slot",
          "accepted",
          "needs_review",
          "attempts"
        ],
        "properties": {
          "slot": {
            "type": "string"
          },
          "accepted": {
            "type": "boolean"
          },
          "needs_review": {
            "type": "boolean"
          },
          "override": {
            "type": "boolean"
          },
          "attempts": {
            "type": "integer"
          },
          "can_override": {
            "type": "boolean"
          },
          "decision": {
            "type": "string"
          },
          "retry_allowed": {
            "type": "boolean"
          },
          "content_rejections": {
            "type": "integer"
          },
          "attempt_id": {
            "type": "string"
          },
          "category_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "feedback": {
            "type": [
              "string",
              "null"
            ]
          },
          "readings": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "null"
              ]
            }
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "captured_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CaptureConfiguration": {
        "type": "object",
        "required": [
          "session",
          "branding",
          "locale",
          "strings",
          "shots",
          "max_attempts"
        ],
        "description": "Borrower configuration from GET /{token}. No tenant key is sent. Read fresh state after resume; never infer a lending decision from capture state.",
        "properties": {
          "inspection_contract_version": {
            "const": 2
          },
          "session": {
            "type": "object",
            "required": [
              "id",
              "status",
              "shots",
              "require_signature",
              "has_return_url"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "status": {
                "type": "string"
              },
              "stage": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reference_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "vehicle": {
                "type": "object"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "require_signature": {
                "type": "boolean"
              },
              "has_return_url": {
                "type": "boolean"
              },
              "shots": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CaptureShotDefinition"
                }
              }
            }
          },
          "branding": {
            "type": "object",
            "properties": {
              "displayName": {
                "type": "string"
              },
              "logoUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "primaryColor": {
                "type": "string"
              },
              "contactEmail": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "locale": {
            "type": "string"
          },
          "strings": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "shots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CaptureShotState"
            }
          },
          "max_attempts": {
            "type": "integer"
          },
          "capture_sources": {
            "type": "array",
            "items": {
              "enum": [
                "camera",
                "library"
              ]
            }
          },
          "capture_mode": {
            "enum": [
              "freeform",
              "video"
            ],
            "description": "Absent means guided."
          },
          "processing_workflow": {
            "enum": [
              "coverage_then_detail_v1",
              "collective_coverage_then_detail_v2"
            ]
          },
          "background_analysis": {
            "const": true
          },
          "automatic_decision": {
            "const": true
          },
          "active_attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "attempt_id",
                "slot",
                "state"
              ],
              "properties": {
                "attempt_id": {
                  "type": "string"
                },
                "slot": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                }
              }
            }
          },
          "allowed_embed_origins": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capture_state": {
            "type": "string"
          },
          "coverage_state": {
            "type": "string"
          },
          "result_revision": {
            "type": "integer"
          },
          "allow_flagged_submission": {
            "type": "boolean"
          },
          "collection": {
            "$ref": "#/components/schemas/Collection"
          },
          "video": {
            "type": "object"
          }
        }
      },
      "Session": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "inspection_contract_version": {
            "const": 2
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "opened",
              "submitted",
              "expired",
              "revoked"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "token": {
            "type": "string"
          },
          "credential_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "session_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "object": {
            "const": "inspection"
          },
          "template_version": {
            "type": "string"
          },
          "template": {
            "type": [
              "string",
              "null"
            ]
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "reference_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "vehicle": {
            "type": "object"
          },
          "context": {
            "type": "object"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "opened_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "submitted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "signature": {
            "type": "boolean"
          },
          "decision": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LendingDecision"
              },
              {
                "type": "null"
              }
            ]
          },
          "capture_mode": {
            "enum": [
              "guided",
              "freeform",
              "video"
            ]
          },
          "processing_workflow": {
            "enum": [
              "coverage_then_detail_v1",
              "collective_coverage_then_detail_v2"
            ]
          },
          "collection": {
            "type": "object",
            "description": "Tenant collection summary with workflow, coverage, views, images and progress; capture-only submission gates are omitted."
          },
          "views": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "image_url": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "uri"
                },
                "view": {
                  "type": "string",
                  "description": "Configured capture view, independent of the custom slot name; use this for tyre-position evidence selection."
                },
                "evidence_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Selected accepted evidence ID for an explicit component grade correction."
                }
              }
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "views_required": {
            "type": "integer"
          },
          "views_captured": {
            "type": "integer"
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "outcome_reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "capture_state": {
            "enum": [
              "in_progress",
              "complete",
              "review_required"
            ]
          },
          "coverage_state": {
            "enum": [
              "complete",
              "incomplete",
              "uncertain"
            ]
          },
          "analysis_state": {
            "enum": [
              "pending",
              "processing",
              "complete",
              "partial",
              "failed"
            ]
          },
          "result_revision": {
            "type": "integer"
          },
          "artifact": {
            "type": "object"
          },
          "review_history": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "Attempt": {
        "type": "object",
        "required": [
          "attempt_id",
          "slot",
          "state",
          "retry_allowed"
        ],
        "properties": {
          "attempt_id": {
            "type": "string",
            "format": "uuid"
          },
          "slot": {
            "type": "string"
          },
          "state": {
            "enum": [
              "reserved",
              "processing",
              "accepted",
              "retake_required",
              "review_required",
              "processing_failed",
              "abandoned",
              "late_after_submit"
            ]
          },
          "decision": {
            "enum": [
              "accepted",
              "retake_required",
              "review_required"
            ]
          },
          "calibrated_score": {
            "type": "null"
          },
          "reason_codes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "missing_zones": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "retry_allowed": {
            "type": "boolean"
          },
          "unassigned": {
            "type": "boolean",
            "description": "Free order: the photo matched no remaining view; feedback says why."
          },
          "assigned": {
            "type": "boolean",
            "description": "Free order: the server assigned this photo to `slot`."
          },
          "remaining_content_attempts": {
            "type": "integer"
          },
          "technical_recovery_state": {
            "type": [
              "string",
              "null"
            ]
          },
          "timing": {
            "type": "object",
            "description": "Persisted server intervals, stable across receipt replays. Excludes browser preparation, upload, initial authorization and response delivery. Provider path includes claims and usage persistence.",
            "properties": {
              "reserved_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "completed_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "reservation_to_commit_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              },
              "provider_path_ms": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0
              }
            }
          },
          "shot": {
            "type": "object"
          }
        }
      },
      "Receipt": {
        "type": "object",
        "required": [
          "status",
          "inspection_id",
          "inspection_contract_version",
          "result_revision"
        ],
        "properties": {
          "status": {
            "const": "submitted"
          },
          "inspection_id": {
            "type": "string",
            "format": "uuid"
          },
          "inspection_contract_version": {
            "const": 2
          },
          "result_revision": {
            "type": "integer",
            "minimum": 1
          },
          "capture_state": {
            "type": "string"
          },
          "coverage_state": {
            "type": "string"
          },
          "analysis_state": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/inspection-sessions": {
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "summary": "Create a versioned session; unchanged idempotent replay never re-sends invitations",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 120
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Create"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created or unchanged credential replay. Terminal replay contains ID/state without credentials.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "summary": "List your inspections, newest first. Summary fields only; fetch GET /{id} for results, evidence and decisions.",
        "parameters": [
          {
            "name": "reference_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your loan, rental or vehicle reference."
          },
          {
            "name": "stage",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Page backwards: only inspections created before this time (pass the last item's created_at)."
          }
        ],
        "responses": {
          "200": {
            "description": "One page of inspections",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "object",
                    "data"
                  ],
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "object",
                          "status",
                          "created_at"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "object": {
                            "const": "inspection"
                          },
                          "status": {
                            "type": "string"
                          },
                          "stage": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reference_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "vehicle": {
                            "type": [
                              "object",
                              "null"
                            ]
                          },
                          "outcome": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "comparison_status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "review_status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "submitted_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "expires_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}": {
      "get": {
        "security": [
          {
            "TenantKey": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Session UUID with X-API-Key returns Session. Signed capture token without a tenant key returns CaptureConfiguration. Both use this same URL shape."
          }
        ],
        "summary": "Read tenant results by UUID, or borrower capture configuration by signed token",
        "responses": {
          "200": {
            "description": "UUID + key: tenant-owned current result. Signed token: borrower configuration while open (410 for expired, revoked or already_submitted; a rotated credential returns 404 not_found). A revoked/already_submitted read includes session_id for device queue cleanup; preserve queues on expired/not_found for a replacement link. Responses are private, no-store; do not cache evidence or capture state.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Session"
                    },
                    {
                      "$ref": "#/components/schemas/CaptureConfiguration"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/result": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-verify-inspection-workflow",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "collective_coverage_then_detail_v2"
              ]
            },
            "description": "Required to negotiate the collective workflow on this native result endpoint. Older clients receive 409 unsupported_contract with a hosted_url."
          }
        ],
        "summary": "Native capture state and saved result, including after submission; current capture credential required",
        "responses": {
          "200": {
            "description": "Flow configuration and capture-facing result. Host context, staff identities, internal notes and sibling sessions are excluded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "flow",
                    "result"
                  ],
                  "properties": {
                    "flow": {
                      "$ref": "#/components/schemas/CaptureConfiguration"
                    },
                    "result": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/submit": {
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Capture credential only; normalized JPEG/PNG/WebP multipart, 3.5 MiB image and 4 MB total request",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image",
                  "slot",
                  "client_request_id"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "slot": {
                    "type": "string",
                    "description": "A view slot, or `auto` in free-order and video sessions: the photo is classified, then checked under the matched view's own contract. A photo matching no remaining view returns `unassigned: true` and is never evidence. Free order never replaces accepted evidence; a named slot can."
                  },
                  "client_request_id": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 120,
                    "pattern": "^[a-zA-Z0-9_-]{8,120}$"
                  },
                  "source_mode": {
                    "enum": [
                      "camera",
                      "library",
                      "unknown"
                    ],
                    "description": "Send camera for live-camera capture and library for imported files. Omission is unknown. Any value outside configured capture_sources returns 422 camera_required, including camera for a library-only session. Read capture_sources in the error. Client assertion is not camera attestation."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Terminal logical receipt, including rejected/review/technical outcomes. Inspect state, never assume acceptance from HTTP 200.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attempt"
                }
              }
            }
          },
          "202": {
            "description": "Still processing; poll exact attempt/client request ID without uploading again",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attempt"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/attempts/{attempt_id}": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attempt_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Recover a same-session attempt receipt",
        "responses": {
          "200": {
            "description": "Current attempt state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attempt"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/attempts": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_request_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Recover a lost acknowledgment by the original client request ID",
        "responses": {
          "200": {
            "description": "Current same-session attempt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attempt"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/remove": {
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Capture credential only: remove an optional photo (for example a damage close-up taken by mistake). Required views can only be retaken.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slot"
                ],
                "properties": {
                  "slot": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated capture state"
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/pdf": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Result revision; defaults to the current one."
          }
        ],
        "summary": "Capture credential only: the borrower's copy of the submitted report (photos, views, findings; no lender decision, staff notes or host context). The result endpoint's pdf_url points here.",
        "responses": {
          "302": {
            "description": "Redirect to a one-minute signed download. Never cached (Cache-Control: private, no-store)."
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/finalize": {
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Finalize"
              }
            }
          }
        },
        "summary": "Freeze complete verified evidence, or an explicitly enabled/reasoned flagged submission",
        "responses": {
          "200": {
            "description": "Idempotent submitted receipt. This is not staff approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/review": {
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Review"
              }
            }
          }
        },
        "summary": "Revision-bound append-only staff decision/finding edits; added_findings records damage the analysis missed (each becomes finding staff:<revision>:<index>, counted in the lending decision and editable by later reviews); recapture creates an idempotent linked follow-up",
        "responses": {
          "200": {
            "description": "Saved review, artifact may be pending refresh; events are durable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/resend": {
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "send": {
                    "type": "boolean",
                    "default": true
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "summary": "Rotate nonce/generation within session lifetime. send:false recovers without an invitation.",
        "responses": {
          "200": {
            "description": "Credential rotated successfully; invitation reports provider acceptance, delivery or failure independently. Use the returned link after a delivery failure instead of automatically rotating again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Resend"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/revoke": {
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Cancel an unfinished inspection and invalidate all capture credentials. Repeat requests return the same cancellation receipt.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 1000,
                    "default": "Cancelled by the host application"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved cancellation; photos and audit history are retained",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "replay",
                    "revoked_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "const": "revoked"
                    },
                    "replay": {
                      "type": "boolean"
                    },
                    "revoked_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/valuation": {
      "get": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Latest damage-adjusted valuation; `stale` once the result revision moves",
        "responses": {
          "200": {
            "description": "{ inspection_id, valuation | null }"
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Apply your reference value and methodology to the current findings. Verify supplies no values or depreciation rules. Repair cost, diminution and collateral discount stay separate; structural concerns are never auto-priced. Append-only and idempotent by idempotency_key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValuationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Valuation record with line items, unpriced findings, limitations and input hash"
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/decision": {
      "get": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Lending inspections only: the latest automatic lending decision, or null until the completion pipeline records it. Fields: lending_eligibility_decision (accepted | discounted | declined | needs_recapture | unable_to_assess), reason_codes, reasons, condition_assessment (grade, one defect per panel and damage type with its photos), identity (expected and photographed VIN, vin_status), valuation (reference, line_items, totals, adjusted_collateral_value_cents, lending_value_cents, value_state), policy, qualification, input_hash, decision_id, sequence, current. current is true only for the latest recorded decision on the inspection's current result revision; an older decision, including one delivered later as an inspection.decision event, carries false. Keep the highest sequence. A declined vehicle returns lending_value_cents 0 under the lender's rule; that is not a market value of zero.",
        "responses": {
          "200": {
            "description": "Current decision, null until completion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendingDecisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Supply the reference (book) value after the inspection completed, when none was pinned at creation. Records a new decision over the same evidence, refreshes the report and sends a new inspection.decision webhook. Idempotent by idempotency_key; 409 reference_pinned when the value was supplied at creation; 409 processing before completion.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decision with supplied reference",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LendingDecisionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/images": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_request_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Capture credential; coverage-first collections only. The whole collection state, or one image by client_request_id for lost-acknowledgment recovery.",
        "responses": {
          "200": {
            "description": "Collection or Image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Store one photograph durably (multipart image, client_request_id, optional source_mode) and acknowledge it with a stable image id. No model work runs here; the same request id replays the same image, and a different submission with the same bytes is a separate image. workflow_incompatible (400) on sessions without processing_workflow.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "image",
                  "client_request_id"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "client_request_id": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 120
                  },
                  "source_mode": {
                    "enum": [
                      "camera",
                      "library",
                      "unknown"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Image"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/images/{image_id}": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Current state of one image",
        "responses": {
          "200": {
            "description": "Image",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Image"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/coverage": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Collection state: per-view coverage, per-image progress and what blocks submission",
        "responses": {
          "200": {
            "description": "Collection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Check coverage of the exact current collection with one light provider call (idempotent per collection) and release detail analysis for the images that run has seen. Detail analysis continues after the response; poll GET coverage. A collection that changed since gets its own run; an old run never certifies it.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "retry": {
                    "type": "boolean",
                    "description": "Re-run a joint coverage check whose provider response failed its contract (`coverage.retry_available`). Automatic and repeated checks never retry it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collection with the completed coverage run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "202": {
            "description": "Another caller is checking this exact collection",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Collection"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/clips": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Capture credential; walk-around recordings for a video inspection",
        "responses": {
          "200": {
            "description": "{ clips: Clip[] }"
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Reserve one recording of a clip and receive chunk upload URLs. At most three recordings per clip; a new reservation supersedes an unfinished upload.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReserveClip"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reserved recording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/clips/{clip_id}": {
      "get": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Processing state of one recording",
        "responses": {
          "200": {
            "description": "Recording",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/clips/{clip_id}/uploads": {
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Re-sign only the chunks not yet stored (resumable upload)",
        "responses": {
          "200": {
            "description": "Recording with uploads",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{token}/clips/{clip_id}/complete": {
      "post": {
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clip_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "summary": "Verify every chunk and queue processing: audio removed, an audio-free copy retained (seven days by default), at most 15 frames selected and checked like free-order photos. Poll the recording; a processed upload alone never completes an inspection.",
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Clip"
                }
              }
            }
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inspection-sessions/{id}/recover": {
      "post": {
        "security": [
          {
            "TenantKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slot",
                  "idempotency_key",
                  "expected_shot_version",
                  "reason",
                  "incident_resolved"
                ],
                "properties": {
                  "slot": {
                    "type": "string"
                  },
                  "idempotency_key": {
                    "type": "string"
                  },
                  "expected_shot_version": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 10
                  },
                  "incident_resolved": {
                    "const": true
                  },
                  "content_attempts": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2
                  },
                  "technical_attempts": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "compute_invocations": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6
                  }
                }
              }
            }
          }
        },
        "summary": "Audited bounded recovery grant; never auto-accepts evidence or resurrects an expired session",
        "responses": {
          "200": {
            "description": "Grant receipt (at most two grants per session)"
          },
          "400": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Stable versioned error; retry only according to code and Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
