{
  "openapi": "3.0.1",
  "info": {
    "title": "Zyfy API",
    "description": "UK Postcode and Vehicle Intelligence API. All requests require an `X-Api-Key` header. Get your key at https://zyfy.uk.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "http://zyfy.uk/"
    }
  ],
  "paths": {
    "/v1/vehicle/{registration}": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Returns DVLA details, MOT history, and computed intelligence for a UK registration",
        "operationId": "GetVehicle",
        "parameters": [
          {
            "name": "registration",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleLookupResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/vehicle/bulk": {
      "post": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Bulk vehicle intelligence lookup — up to tier limit per call",
        "operationId": "BulkLookupVehicle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleBulkSyncResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/vehicle/bulk/async": {
      "post": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Submit an async bulk vehicle job. Poll the returned pollUrl for results.",
        "operationId": "AsyncBulkLookupVehicle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleBulkAsyncCreated"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/vehicle/bulk/jobs/{jobId}": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Poll the status of an async bulk vehicle job.",
        "operationId": "GetBulkVehicleJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleBulkJobStatus"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Delete an async bulk vehicle job and its results.",
        "operationId": "DeleteBulkVehicleJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/{postcode}": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Returns enriched intelligence for a UK postcode",
        "operationId": "GetPostcode",
        "parameters": [
          {
            "name": "postcode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeLookupResult"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/nearest": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Returns the nearest enriched postcode to the supplied coordinates",
        "operationId": "NearestPostcode",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeLookupResult"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/within": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Return all enriched postcodes within a radius. Each postcode returned costs one quota unit.",
        "operationId": "PostcodesWithin",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeWithinResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/bulk": {
      "post": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Bulk postcode intelligence lookup — up to tier limit per call",
        "operationId": "BulkLookupPostcode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostcodeBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeBulkSyncResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/bulk/async": {
      "post": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Submit an async bulk postcode job. Poll the returned pollUrl for results.",
        "operationId": "AsyncBulkLookupPostcode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostcodeBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeBulkAsyncCreated"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    },
    "/v1/postcode/bulk/jobs/{jobId}": {
      "get": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Poll the status of an async bulk postcode job.",
        "operationId": "GetBulkPostcodeJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostcodeBulkJobStatus"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Zyfy.Api"
        ],
        "summary": "Delete an async bulk postcode job and its results.",
        "operationId": "DeleteBulkPostcodeJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CouncilTaxBandEstimate": {
        "type": "object",
        "properties": {
          "lower": {
            "type": "string"
          },
          "upper": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "nullable": true
      },
      "DrivetrainStressProfile": {
        "type": "object",
        "properties": {
          "likelyDrivingPattern": {
            "enum": [
              "short_urban",
              "mixed",
              "long_distance"
            ],
            "type": "string",
            "nullable": true
          },
          "dpfRisk": {
            "enum": [
              "low",
              "elevated",
              "high"
            ],
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "FleetAdvisoryItem": {
        "required": [
          "category"
        ],
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "rate": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "FleetAdvisoryProfile": {
        "required": [
          "mileageBand"
        ],
        "type": "object",
        "properties": {
          "mileageBand": {
            "type": "string"
          },
          "sampleSize": {
            "type": "integer",
            "format": "int32"
          },
          "topAdvisories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FleetAdvisoryItem"
            }
          }
        },
        "nullable": true
      },
      "FleetFailureItem": {
        "required": [
          "category"
        ],
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "rate": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "FleetFailureProfile": {
        "required": [
          "mileageBand"
        ],
        "type": "object",
        "properties": {
          "mileageBand": {
            "type": "string"
          },
          "sampleSize": {
            "type": "integer",
            "format": "int32"
          },
          "topFailures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FleetFailureItem"
            }
          }
        },
        "nullable": true
      },
      "GeographyCodesResult": {
        "type": "object",
        "properties": {
          "adminDistrict": {
            "type": "string",
            "nullable": true
          },
          "adminCounty": {
            "type": "string",
            "nullable": true
          },
          "adminWard": {
            "type": "string",
            "nullable": true
          },
          "parliamentaryConstituency": {
            "type": "string",
            "nullable": true
          },
          "lsoa": {
            "type": "string",
            "nullable": true
          },
          "msoa": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "NcapSafetyRating": {
        "type": "object",
        "properties": {
          "overallStars": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "adultOccupant": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "childOccupant": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "vulnerableRoadUsers": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "safetyAssist": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "testedYear": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeBroadbandSignals": {
        "type": "object",
        "properties": {
          "superfast": {
            "type": "boolean",
            "nullable": true
          },
          "ultrafast": {
            "type": "boolean",
            "nullable": true
          },
          "gigabit": {
            "type": "boolean",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeBulkAsyncCreated": {
        "required": [
          "jobId",
          "status",
          "total",
          "pollUrl"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "pollUrl": {
            "type": "string"
          }
        }
      },
      "PostcodeBulkJobStatus": {
        "required": [
          "jobId",
          "status",
          "total",
          "done",
          "createdAt",
          "completedAt",
          "expiresAt",
          "results"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "done": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostcodeLookupResult"
            },
            "nullable": true
          }
        }
      },
      "PostcodeBulkRequest": {
        "required": [
          "postcodes"
        ],
        "type": "object",
        "properties": {
          "postcodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PostcodeBulkSyncResponse": {
        "required": [
          "total",
          "results"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostcodeLookupResult"
            }
          }
        }
      },
      "PostcodeCrimeCategories": {
        "type": "object",
        "properties": {
          "violence": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          },
          "property": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          },
          "vehicle": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          },
          "antisocial": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          },
          "drugs": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          },
          "damage": {
            "$ref": "#/components/schemas/PostcodeCrimeCategory"
          }
        },
        "nullable": true
      },
      "PostcodeCrimeCategory": {
        "type": "object",
        "properties": {
          "band": {
            "type": "string",
            "nullable": true
          },
          "trend": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeCrimeGranularity": {
        "type": "object",
        "properties": {
          "band": {
            "type": "string",
            "nullable": true
          },
          "categories": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeCrimeSignals": {
        "type": "object",
        "properties": {
          "rateBand": {
            "type": "string",
            "nullable": true
          },
          "dataGranularity": {
            "$ref": "#/components/schemas/PostcodeCrimeGranularity"
          },
          "categories": {
            "$ref": "#/components/schemas/PostcodeCrimeCategories"
          }
        },
        "nullable": true
      },
      "PostcodeDemographicsSignals": {
        "type": "object",
        "properties": {
          "percOwnerOccupied": {
            "type": "integer",
            "format": "int16",
            "nullable": true
          },
          "percPrivateRented": {
            "type": "integer",
            "format": "int16",
            "nullable": true
          },
          "percNoCarVan": {
            "type": "integer",
            "format": "int16",
            "nullable": true
          },
          "medianAge": {
            "type": "integer",
            "format": "int16",
            "nullable": true
          },
          "percEconomicallyActive": {
            "type": "integer",
            "format": "int16",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeDeprivationSignals": {
        "type": "object",
        "properties": {
          "imdDecile": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "imdTrend": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeEnvironmentSignals": {
        "type": "object",
        "properties": {
          "airQualityBand": {
            "type": "string",
            "nullable": true
          },
          "airQualityTrend": {
            "type": "string",
            "nullable": true
          },
          "no2UgM3": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "pm25UgM3": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "radonPotential": {
            "type": "string",
            "nullable": true
          },
          "greenSpaceProximityMetres": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "isNationalPark": {
            "type": "boolean",
            "nullable": true
          },
          "isAonb": {
            "type": "boolean",
            "nullable": true
          },
          "isGreenBelt": {
            "type": "boolean",
            "nullable": true
          },
          "greenSpaceNote": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeFloodSignals": {
        "type": "object",
        "properties": {
          "riversSea": {
            "type": "string",
            "nullable": true
          },
          "groundwater": {
            "type": "string",
            "nullable": true
          },
          "riversSeaTrend": {
            "type": "string",
            "nullable": true
          },
          "groundwaterTrend": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeHousingSignals": {
        "type": "object",
        "properties": {
          "epcAverageRating": {
            "type": "string",
            "nullable": true
          },
          "councilTaxBand": {
            "$ref": "#/components/schemas/CouncilTaxBandEstimate"
          },
          "dominantPropertyType": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeLookupResult": {
        "required": [
          "postcode",
          "outwardCode"
        ],
        "type": "object",
        "properties": {
          "postcode": {
            "type": "string"
          },
          "outwardCode": {
            "type": "string"
          },
          "inwardCode": {
            "type": "string",
            "nullable": true
          },
          "latitude": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "eastings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "northings": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "region": {
            "type": "string",
            "nullable": true
          },
          "adminDistrict": {
            "type": "string",
            "nullable": true
          },
          "adminCounty": {
            "type": "string",
            "nullable": true
          },
          "adminWard": {
            "type": "string",
            "nullable": true
          },
          "parish": {
            "type": "string",
            "nullable": true
          },
          "parliamentaryConstituency": {
            "type": "string",
            "nullable": true
          },
          "nhsTrust": {
            "type": "string",
            "nullable": true
          },
          "lsoa": {
            "type": "string",
            "nullable": true
          },
          "msoa": {
            "type": "string",
            "nullable": true
          },
          "ruralUrbanClassification": {
            "type": "string",
            "nullable": true
          },
          "summary": {
            "$ref": "#/components/schemas/PostcodeSummary"
          },
          "signals": {
            "$ref": "#/components/schemas/PostcodeSignals"
          },
          "scores": {
            "$ref": "#/components/schemas/PostcodeScores"
          },
          "percentiles": {
            "$ref": "#/components/schemas/PostcodePercentiles"
          },
          "geographyCodes": {
            "$ref": "#/components/schemas/GeographyCodesResult"
          },
          "queryPointDistanceMetres": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "sources": {
            "$ref": "#/components/schemas/PostcodeSources"
          },
          "schemaVersion": {
            "type": "string",
            "nullable": true
          },
          "dataAsOf": {
            "type": "string",
            "format": "date-time"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PostcodePercentiles": {
        "type": "object",
        "properties": {
          "floodRivers": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "floodGroundwater": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "crimeRate": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "imd": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "propertyPrice": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "propertyPriceRegional": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "radon": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "airQuality": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "greenSpaceProximity": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "epc": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodePoliticalSignals": {
        "type": "object",
        "properties": {
          "mpName": {
            "type": "string",
            "nullable": true
          },
          "mpParty": {
            "type": "string",
            "nullable": true
          },
          "mpPartyColour": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodePropertySignals": {
        "type": "object",
        "properties": {
          "averagePrice": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "priceLow": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "priceHigh": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "priceTrend": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "priceTrendPeriodMonths": {
            "type": "integer",
            "format": "int32"
          },
          "transactionVolume": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "granularity": {
            "type": "string",
            "nullable": true
          },
          "trendConfidence": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeScores": {
        "type": "object",
        "properties": {
          "propertyRiskScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "liveabilityScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "investmentScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "affordabilityIndex": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "scoreConvention": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeSignals": {
        "type": "object",
        "properties": {
          "broadband": {
            "$ref": "#/components/schemas/PostcodeBroadbandSignals"
          },
          "flood": {
            "$ref": "#/components/schemas/PostcodeFloodSignals"
          },
          "property": {
            "$ref": "#/components/schemas/PostcodePropertySignals"
          },
          "crime": {
            "$ref": "#/components/schemas/PostcodeCrimeSignals"
          },
          "environment": {
            "$ref": "#/components/schemas/PostcodeEnvironmentSignals"
          },
          "housing": {
            "$ref": "#/components/schemas/PostcodeHousingSignals"
          },
          "political": {
            "$ref": "#/components/schemas/PostcodePoliticalSignals"
          },
          "deprivation": {
            "$ref": "#/components/schemas/PostcodeDeprivationSignals"
          },
          "demographics": {
            "$ref": "#/components/schemas/PostcodeDemographicsSignals"
          }
        },
        "nullable": true
      },
      "PostcodeSources": {
        "type": "object",
        "properties": {
          "geography": {
            "type": "string"
          },
          "flood": {
            "type": "string"
          },
          "crime": {
            "type": "string"
          },
          "property": {
            "type": "string"
          },
          "deprivation": {
            "type": "string"
          },
          "broadband": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "epc": {
            "type": "string"
          },
          "greenSpace": {
            "type": "string"
          },
          "demographics": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PostcodeSummary": {
        "type": "object",
        "properties": {
          "propertyRiskLevel": {
            "type": "string",
            "nullable": true
          },
          "liveabilityLevel": {
            "type": "string",
            "nullable": true
          },
          "insuranceRiskLevel": {
            "type": "string",
            "nullable": true
          },
          "investmentOutlook": {
            "type": "string",
            "nullable": true
          },
          "growthSignal": {
            "type": "string",
            "nullable": true
          },
          "dataConfidence": {
            "type": "string",
            "nullable": true
          },
          "areaTrajectory": {
            "type": "string",
            "nullable": true
          },
          "familySuitability": {
            "type": "string",
            "nullable": true
          },
          "retirementSuitability": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "PostcodeWithinResponse": {
        "required": [
          "total",
          "results"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PostcodeLookupResult"
            }
          }
        }
      },
      "VehicleBulkAsyncCreated": {
        "required": [
          "jobId",
          "status",
          "total",
          "pollUrl"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "pollUrl": {
            "type": "string"
          }
        }
      },
      "VehicleBulkJobStatus": {
        "required": [
          "jobId",
          "status",
          "total",
          "done",
          "createdAt",
          "completedAt",
          "expiresAt",
          "results"
        ],
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "done": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VehicleLookupResult"
            },
            "nullable": true
          }
        }
      },
      "VehicleBulkRequest": {
        "required": [
          "registrations"
        ],
        "type": "object",
        "properties": {
          "registrations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VehicleBulkSyncResponse": {
        "required": [
          "total",
          "results"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VehicleLookupResult"
            }
          }
        }
      },
      "VehicleLookupResult": {
        "required": [
          "registration"
        ],
        "type": "object",
        "properties": {
          "registration": {
            "type": "string"
          },
          "make": {
            "type": "string",
            "nullable": true
          },
          "model": {
            "type": "string",
            "nullable": true
          },
          "vehicleType": {
            "type": "string",
            "nullable": true
          },
          "colour": {
            "type": "string",
            "nullable": true
          },
          "fuelType": {
            "type": "string",
            "nullable": true
          },
          "engineCapacityCc": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "yearOfManufacture": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "monthOfFirstRegistration": {
            "type": "string",
            "nullable": true
          },
          "vehicleAgeYears": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "summary": {
            "$ref": "#/components/schemas/VehicleSummary"
          },
          "signals": {
            "$ref": "#/components/schemas/VehicleSignals"
          },
          "scores": {
            "$ref": "#/components/schemas/VehicleScores"
          },
          "fleetFailureProfile": {
            "$ref": "#/components/schemas/FleetFailureProfile"
          },
          "fleetAdvisoryProfile": {
            "$ref": "#/components/schemas/FleetAdvisoryProfile"
          },
          "sources": {
            "$ref": "#/components/schemas/VehicleSources"
          },
          "schemaVersion": {
            "type": "string",
            "nullable": true
          },
          "enrichmentPending": {
            "type": "boolean"
          },
          "dataAsOf": {
            "type": "string",
            "format": "date-time"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VehicleScores": {
        "type": "object",
        "properties": {
          "motRiskScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "conditionScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "conditionPercentile": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "maintenanceScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "maintenancePercentile": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "failureRateRatio": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "advisoryRateRatio": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "benchmarkSampleSize": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "avgAdvisoriesPerTestForMMY": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "avgFailuresPerTestForMMY": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "offRoadLikelihoodScore": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "scoreConvention": {
            "type": "string",
            "nullable": true
          }
        },
        "nullable": true
      },
      "VehicleSignals": {
        "type": "object",
        "properties": {
          "co2EmissionsGPerKm": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "euroEmissionStandard": {
            "type": "string",
            "nullable": true
          },
          "ulezCompliant": {
            "type": "boolean",
            "nullable": true
          },
          "markedForExport": {
            "type": "boolean"
          },
          "hasOutstandingRecall": {
            "type": "boolean",
            "nullable": true
          },
          "v5cLastIssued": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "taxStatus": {
            "enum": [
              "taxed",
              "untaxed",
              "sorn"
            ],
            "type": "string",
            "nullable": true
          },
          "taxDueDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "taxDaysRemaining": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "vedBand": {
            "type": "string",
            "nullable": true
          },
          "vedAnnualCostGbp": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "motStatus": {
            "enum": [
              "valid",
              "expired",
              "no_mot",
              "no_details"
            ],
            "type": "string",
            "nullable": true
          },
          "motExpiryDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "motDaysRemaining": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "imminentMot": {
            "type": "boolean"
          },
          "odometerTrend": {
            "enum": [
              "consistent",
              "high_mileage",
              "low_mileage",
              "possible_clocking",
              "insufficient_data"
            ],
            "type": "string",
            "nullable": true
          },
          "latestOdometerMiles": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "typicalAnnualMileageMiles": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "odometerVsFleetAverage": {
            "enum": [
              "below_average",
              "average",
              "above_average"
            ],
            "type": "string",
            "nullable": true
          },
          "motPassRate": {
            "type": "number",
            "format": "float",
            "nullable": true
          },
          "totalMotTests": {
            "type": "integer",
            "format": "int32"
          },
          "totalMotFailures": {
            "type": "integer",
            "format": "int32"
          },
          "totalAdvisoryCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalFailureItemCount": {
            "type": "integer",
            "format": "int32"
          },
          "latestAdvisoryCount": {
            "type": "integer",
            "format": "int32"
          },
          "latestFailureItemCount": {
            "type": "integer",
            "format": "int32"
          },
          "dangerousDefectEver": {
            "type": "boolean"
          },
          "highFailureHistory": {
            "type": "boolean"
          },
          "advisoryTrend": {
            "enum": [
              "increasing",
              "stable",
              "decreasing",
              "insufficient_data"
            ],
            "type": "string",
            "nullable": true
          },
          "advisoryMomentum": {
            "enum": [
              "improving",
              "stable",
              "worsening",
              "insufficient_data"
            ],
            "type": "string",
            "nullable": true
          },
          "daysSinceLastFailure": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "failuresLast24Months": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "advisoriesLast3Tests": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "trendWindowTests": {
            "type": "integer",
            "format": "int32"
          },
          "firstMotDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "lastMotDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "lastMotResult": {
            "type": "string",
            "nullable": true
          },
          "firstMotDue": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "failureClusters": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "repeatFailureCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "advisoryClusters": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "ncapSafetyRating": {
            "$ref": "#/components/schemas/NcapSafetyRating"
          },
          "drivetrainStressProfile": {
            "$ref": "#/components/schemas/DrivetrainStressProfile"
          }
        },
        "nullable": true
      },
      "VehicleSources": {
        "type": "object",
        "properties": {
          "motHistory": {
            "type": "string"
          },
          "mutableData": {
            "type": "string"
          },
          "safetyRating": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "VehicleSummary": {
        "type": "object",
        "properties": {
          "buyRecommendation": {
            "enum": [
              "good",
              "consider",
              "caution",
              "avoid"
            ],
            "type": "string",
            "nullable": true
          },
          "vehicleRiskLevel": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "nullable": true
          },
          "motRiskLevel": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string",
            "nullable": true
          },
          "conditionBand": {
            "enum": [
              "good",
              "fair",
              "poor",
              "bad"
            ],
            "type": "string",
            "nullable": true
          },
          "maintenanceBand": {
            "enum": [
              "good",
              "fair",
              "poor",
              "bad"
            ],
            "type": "string",
            "nullable": true
          },
          "mileageAnomalyRisk": {
            "enum": [
              "none",
              "low",
              "high"
            ],
            "type": "string",
            "nullable": true
          },
          "colourChangeIndicated": {
            "type": "boolean",
            "nullable": true
          },
          "aboveAverageAdvisories": {
            "type": "boolean",
            "nullable": true
          },
          "motFailureDetailAvailable": {
            "type": "boolean"
          }
        },
        "nullable": true
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Your Zyfy API key. Obtain from your dashboard at zyfy.uk. Required on every request.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "Zyfy.Api"
    }
  ]
}