{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/regtail-com/json-schema/regtail-com-vehicle-report-schema.json",
  "title": "VehicleReport",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/regtail-com-openapi.yml#/components/schemas/VehicleReport",
  "properties": {
    "charged": {
      "type": "boolean",
      "title": "Charged",
      "description": "Whether this call spent a credit (never on the API plan)"
    },
    "credits_remaining": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credits Remaining",
      "description": "After this call; null with a sample key"
    },
    "sample": {
      "type": "boolean",
      "title": "Sample",
      "description": "True with an rt_test_ key: a sandbox answer, nothing spent",
      "default": false
    },
    "scenario": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Scenario",
      "description": "With an rt_test_ key: the sandbox scenario that answered (GET /api/v1/sandbox/scenarios)"
    },
    "plan": {
      "anyOf": [
        {
          "$ref": "#/$defs/Plan"
        },
        {
          "type": "null"
        }
      ],
      "description": "With the API plan: this period's cars, instead of credits"
    },
    "query": {
      "additionalProperties": true,
      "type": "object",
      "title": "Query",
      "description": "vrm, vin"
    },
    "generated_at": {
      "type": "string",
      "title": "Generated At"
    },
    "headline": {
      "additionalProperties": true,
      "type": "object",
      "title": "Headline",
      "description": "The car in one line: title, year, fuel, engine, colour"
    },
    "verdict": {
      "additionalProperties": true,
      "type": "object",
      "title": "Verdict",
      "description": "level (clear, caution, risk, incomplete), top risks and warnings, what was not checked, the viewing checklist"
    },
    "sections": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Sections",
      "description": "One per topic (identity, mot, mileage, theft, finance, ...): id, title, status, summary, data, findings with evidence"
    },
    "sources": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Sources",
      "description": "The data sources that answered for this car, e.g. MOT history (DVSA)"
    },
    "facts": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Facts",
      "description": "Every fact found, with its source"
    },
    "access": {
      "type": "string",
      "title": "Access",
      "default": "full"
    },
    "photo_read": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Photo Read",
      "description": "Photo checks only: the plate read, the make, model and colour seen on the car, and whether they match the plate's record (check: matches, unverified or contradicts)"
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "charged",
    "credits_remaining",
    "query",
    "generated_at",
    "headline",
    "verdict",
    "sections",
    "sources",
    "facts"
  ],
  "$defs": {
    "Plan": {
      "properties": {
        "cars_used": {
          "type": "integer",
          "title": "Cars Used",
          "description": "Distinct cars looked up this billing period, this one included"
        },
        "cars_included": {
          "type": "integer",
          "title": "Cars Included",
          "description": "Cars the monthly plan includes"
        },
        "extra_cars": {
          "type": "integer",
          "title": "Extra Cars",
          "description": "Cars past the included ones this period, billed at the end of the month"
        },
        "price_per_extra_car_pence": {
          "type": "integer",
          "title": "Price Per Extra Car Pence"
        },
        "period_end": {
          "type": "string",
          "title": "Period End",
          "description": "When this billing period ends and the count starts again (UTC)"
        },
        "new_car": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "New Car",
          "description": "Whether this call counted a car not yet looked up this period"
        }
      },
      "type": "object",
      "required": [
        "cars_used",
        "cars_included",
        "extra_cars",
        "price_per_extra_car_pence",
        "period_end"
      ],
      "title": "Plan"
    }
  }
}