{
  "openapi": "3.1.0",
  "info": {
    "title": "Letwarden API",
    "version": "1.0.0",
    "description": "Letwarden helps private landlords in England stay compliant. Use compliance_check_property for \"is my rental compliant / what do I need to do\" questions, database_registration_window for landlord database dates, certificates_next_due for renewal dates, compliance_explain_rule for a single rule, and services_request_quote only after the landlord agrees to share their name, email and postcode with an engineer. England only. Never ask for tenant names, ID documents, National Insurance numbers or bank details. After a check, offer to watch the key dates (certificate.due_soon and database_registration_window events). Each answer leads with a summary line. When it lists things, a ready-made Markdown table follows: show it as it is, with its links, unless the landlord asks for another layout or Letwarden’s card already shows the answer. The facts follow as JSON. Results are general information, not legal advice. No authentication is needed.",
    "contact": {
      "email": "support@letwarden.co.uk",
      "url": "https://letwarden.co.uk"
    },
    "termsOfService": "https://letwarden.co.uk/terms"
  },
  "servers": [
    {
      "url": "https://letwarden.co.uk"
    }
  ],
  "paths": {
    "/api/v1/tools/compliance_check_property": {
      "post": {
        "operationId": "compliance_check_property",
        "summary": "Check a rental property",
        "description": "Use this when a landlord asks whether a rental property in England is compliant, what they need to do, or what is overdue. It checks gas safety, the EICR, the EPC and minimum rating, deposit protection, smoke and CO alarms, Right to Rent, Renters’ Rights Act paperwork, landlord database registration, licensing and legionella. Pass only facts the landlord has given and leave unknown fields out; the result lists what is missing. Do not use for properties in Wales, Scotland or Northern Ireland, for commercial property, or for general questions about one rule (use compliance_explain_rule).",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Property postcode, e.g. \"CV1 2GT\". An outward code such as \"CV1\" also works."
                  },
                  "region": {
                    "type": "string",
                    "enum": [
                      "West Midlands",
                      "East of England",
                      "East Midlands",
                      "South East",
                      "Yorkshire and the Humber",
                      "North West",
                      "North East",
                      "London",
                      "South West"
                    ],
                    "description": "English region, only if no postcode is available."
                  },
                  "tenancy_status": {
                    "type": "string",
                    "enum": [
                      "occupied",
                      "between_tenants",
                      "not_yet_let"
                    ],
                    "description": "Whether tenants live there now."
                  },
                  "tenancy_start_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date the current tenancy was agreed or started (YYYY-MM-DD)."
                  },
                  "tenancy_terms_written": {
                    "type": "boolean",
                    "description": "False if the tenancy was agreed verbally with no written terms."
                  },
                  "has_gas_appliances": {
                    "type": "boolean",
                    "description": "True if the property has any gas appliance, boiler, fire or flue."
                  },
                  "gas_safety_last_check": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date of the last gas safety check."
                  },
                  "gas_safety_due_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Next check due date shown on the gas safety record, if known."
                  },
                  "gas_safety_previous_due_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "If the last gas check was done early, the due date it was done against (keeps the anniversary)."
                  },
                  "eicr_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date of the last electrical inspection (EICR)."
                  },
                  "eicr_next_due": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Next inspection date written on the EICR, if different from 5 years."
                  },
                  "eicr_satisfactory": {
                    "type": "boolean",
                    "description": "False if the last EICR was unsatisfactory (C1, C2 or FI items)."
                  },
                  "eicr_remedial_complete": {
                    "type": "boolean",
                    "description": "True if remedial work from an unsatisfactory EICR is finished."
                  },
                  "epc_rating": {
                    "type": "string",
                    "enum": [
                      "A",
                      "B",
                      "C",
                      "D",
                      "E",
                      "F",
                      "G"
                    ],
                    "description": "Current EPC energy rating."
                  },
                  "epc_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date the EPC was issued."
                  },
                  "mees_exemption_registered": {
                    "type": "boolean",
                    "description": "True if an energy efficiency exemption is on the PRS Exemptions Register."
                  },
                  "deposit_taken": {
                    "type": "boolean",
                    "description": "True if a tenancy deposit was taken."
                  },
                  "deposit_received_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date the deposit was received."
                  },
                  "deposit_protected": {
                    "type": "boolean",
                    "description": "True if the deposit is in an approved protection scheme."
                  },
                  "prescribed_information_given": {
                    "type": "boolean",
                    "description": "True if the deposit prescribed information was given to the tenant."
                  },
                  "smoke_alarm_every_storey": {
                    "type": "boolean",
                    "description": "True if there is a working smoke alarm on every storey with living space."
                  },
                  "has_fixed_combustion_appliance": {
                    "type": "boolean",
                    "description": "True if any room has a boiler, gas or solid fuel fire, wood burner or similar (gas cookers do not count)."
                  },
                  "co_alarm_in_those_rooms": {
                    "type": "boolean",
                    "description": "True if every such room has a carbon monoxide alarm."
                  },
                  "right_to_rent_checks_done": {
                    "type": "boolean",
                    "description": "True if Right to Rent checks were done on all adult occupiers."
                  },
                  "information_sheet_given": {
                    "type": "boolean",
                    "description": "For tenancies that began before 1 May 2026: true if the Renters' Rights Act Information Sheet 2026 was given."
                  },
                  "written_statement_given": {
                    "type": "boolean",
                    "description": "For tenancies from 1 May 2026, or verbal tenancies from before then: true if written terms were given to the tenant."
                  },
                  "registered_on_database": {
                    "type": "boolean",
                    "description": "True if the property is registered on the landlord database."
                  },
                  "database_registration_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date the database registration was made."
                  },
                  "occupants": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50,
                    "description": "Number of people living there."
                  },
                  "households": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50,
                    "description": "Number of separate households."
                  },
                  "shared_facilities": {
                    "type": "boolean",
                    "description": "True if households share a kitchen, bathroom or toilet."
                  },
                  "hmo_licence_held": {
                    "type": "boolean",
                    "description": "True if the property has an HMO licence."
                  },
                  "legionella_assessment_done": {
                    "type": "boolean",
                    "description": "True if a legionella risk assessment has been done."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "as_of": {
                          "type": "string"
                        },
                        "in_scope": {
                          "type": "boolean"
                        },
                        "location": {
                          "type": "object",
                          "properties": {
                            "postcode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "region": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "local_authority": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "outcode": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        },
                        "overall": {
                          "type": "string",
                          "enum": [
                            "urgent",
                            "attention",
                            "incomplete",
                            "on_track",
                            "out_of_scope"
                          ]
                        },
                        "summary": {
                          "type": "object",
                          "properties": {
                            "overdue": {
                              "type": "integer"
                            },
                            "action_needed": {
                              "type": "integer"
                            },
                            "due_soon": {
                              "type": "integer"
                            },
                            "upcoming": {
                              "type": "integer"
                            },
                            "needs_info": {
                              "type": "integer"
                            },
                            "ok": {
                              "type": "integer"
                            },
                            "not_applicable": {
                              "type": "integer"
                            }
                          }
                        },
                        "findings": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "overdue",
                                  "action_needed",
                                  "due_soon",
                                  "upcoming",
                                  "needs_info",
                                  "ok",
                                  "not_applicable"
                                ]
                              },
                              "due_date": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "message": {
                                "type": "string"
                              },
                              "legal_basis": {
                                "type": "string"
                              },
                              "max_penalty": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source_url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "status",
                              "due_date",
                              "message",
                              "legal_basis",
                              "max_penalty",
                              "source_url"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "next_actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "database": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "region": {
                              "type": "string"
                            },
                            "opens": {
                              "type": "string"
                            },
                            "deadline": {
                              "type": "string"
                            },
                            "opens_human": {
                              "type": "string"
                            },
                            "deadline_human": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "not_open_yet",
                                "open",
                                "deadline_passed"
                              ]
                            },
                            "days_until_open": {
                              "type": "integer"
                            },
                            "days_until_deadline": {
                              "type": "integer"
                            },
                            "fee_gbp_per_property_per_year": {
                              "type": "number"
                            },
                            "official_page": {
                              "type": "string"
                            },
                            "status_note": {
                              "type": "string"
                            }
                          }
                        },
                        "disclaimer": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "as_of",
                        "in_scope",
                        "location",
                        "overall",
                        "summary",
                        "findings",
                        "next_actions",
                        "database",
                        "disclaimer"
                      ]
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/database_registration_window": {
      "post": {
        "operationId": "database_registration_window",
        "summary": "Landlord database dates",
        "description": "Use this when a landlord in England asks when they must register on the new national landlord database (the Private Rented Sector Database or \"Register your rental property\" service), how much it costs or what documents they need. Give the property postcode or region. Do not use for Wales (Rent Smart Wales) or Scotland (Scottish Landlord Register).",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Property postcode or outward code, e.g. \"B17 9AA\" or \"LS6\"."
                  },
                  "region": {
                    "type": "string",
                    "enum": [
                      "West Midlands",
                      "East of England",
                      "East Midlands",
                      "South East",
                      "Yorkshire and the Humber",
                      "North West",
                      "North East",
                      "London",
                      "South West"
                    ],
                    "description": "English region, if the landlord gave a region instead of a postcode."
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "found": {
                          "type": "boolean"
                        },
                        "message": {
                          "type": "string"
                        },
                        "local_authority": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "region": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opens": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deadline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "opens_human": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deadline_human": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "not_open_yet",
                            "open",
                            "deadline_passed"
                          ]
                        },
                        "days_until_open": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "days_until_deadline": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "fee_gbp_per_property_per_year": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "all_registered_by": {
                          "type": "string"
                        },
                        "prepare": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "keep_updated": {
                          "type": "string"
                        },
                        "penalties": {
                          "type": "string"
                        },
                        "fee_note": {
                          "type": "string"
                        },
                        "official_page": {
                          "type": "string"
                        },
                        "status_note": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "found",
                        "message",
                        "all_registered_by",
                        "prepare",
                        "official_page",
                        "status_note"
                      ]
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/certificates_next_due": {
      "post": {
        "operationId": "certificates_next_due",
        "summary": "Next certificate due date",
        "description": "Use this when a landlord in England asks when their next gas safety check, electrical inspection (EICR) or EPC is due, or how early they can book without losing the anniversary. Needs the certificate type and the date it was last done. Do not use for boiler servicing, PAT testing or fire risk assessments.",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "certificate": {
                    "type": "string",
                    "enum": [
                      "gas_safety",
                      "eicr",
                      "epc"
                    ],
                    "description": "Which certificate."
                  },
                  "last_completed": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Date of the last check, inspection or EPC (YYYY-MM-DD)."
                  },
                  "current_due_date": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "Gas only: the due date the last check was done against, if the landlord booked early."
                  },
                  "report_next_due": {
                    "type": "string",
                    "format": "date",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                    "description": "EICR only: the next inspection date written on the report, if the electrician set one."
                  }
                },
                "required": [
                  "certificate",
                  "last_completed"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "certificate": {
                          "type": "string"
                        },
                        "certificate_name": {
                          "type": "string"
                        },
                        "last_completed": {
                          "type": "string"
                        },
                        "next_due": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "overdue",
                            "due_soon",
                            "ok"
                          ]
                        },
                        "days_remaining": {
                          "type": "integer"
                        },
                        "earliest_booking_date": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "explanation": {
                          "type": "string"
                        },
                        "source_url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "certificate",
                        "certificate_name",
                        "last_completed",
                        "next_due",
                        "status",
                        "days_remaining",
                        "earliest_booking_date",
                        "explanation",
                        "source_url"
                      ],
                      "additionalProperties": false
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/compliance_explain_rule": {
      "post": {
        "operationId": "compliance_explain_rule",
        "summary": "Explain a landlord rule",
        "description": "Use this when a landlord asks what a specific rule for letting property in England requires, such as gas safety, EICRs, EPC ratings, deposits, smoke and CO alarms, Right to Rent, the Renters’ Rights Act, the landlord database, HMO licensing, legionella or section 21. Returns the current rule, legal basis, maximum penalty and official sources. Do not use for Wales, Scotland or Northern Ireland, or to draft legal notices.",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "enum": [
                      "gas_safety",
                      "eicr",
                      "epc_mees",
                      "deposit",
                      "smoke_co_alarms",
                      "right_to_rent",
                      "renters_rights_act",
                      "landlord_database",
                      "hmo_licensing",
                      "legionella",
                      "section_21"
                    ],
                    "description": "gas_safety, eicr, epc_mees, deposit, smoke_co_alarms, right_to_rent, renters_rights_act, landlord_database, hmo_licensing, legionella or section_21."
                  }
                },
                "required": [
                  "topic"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "topic": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "summary": {
                          "type": "string"
                        },
                        "key_points": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "legal_basis": {
                          "type": "string"
                        },
                        "max_penalty": {
                          "type": "string"
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "updated": {
                          "type": "string"
                        },
                        "disclaimer": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "topic",
                        "title",
                        "summary",
                        "key_points",
                        "legal_basis",
                        "max_penalty",
                        "sources",
                        "updated",
                        "disclaimer"
                      ],
                      "additionalProperties": false
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/services_request_quote": {
      "post": {
        "operationId": "services_request_quote",
        "summary": "Request an engineer quote",
        "description": "Use this when a landlord in England asks to book or get a price for a gas safety check, EICR, EPC, smoke or CO alarm fitting, or a legionella risk assessment. Sends the request to Letwarden, which replies with a fixed-price quote from a vetted engineer by email; nothing is booked or paid until the landlord accepts. Ask for their name, email and postcode, and confirm they agree to their details being shared with the engineer before calling. Do not use for emergency gas leaks (tell them to call 0800 111 999) or for repairs.",
        "x-openai-isConsequential": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "service": {
                    "type": "string",
                    "enum": [
                      "gas_safety_check",
                      "eicr",
                      "epc",
                      "smoke_co_alarms",
                      "legionella_risk_assessment"
                    ],
                    "description": "gas_safety_check, eicr, epc, smoke_co_alarms or legionella_risk_assessment."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "Full property postcode, e.g. \"B17 9AA\"."
                  },
                  "property_type": {
                    "type": "string",
                    "enum": [
                      "flat",
                      "house",
                      "hmo",
                      "other"
                    ],
                    "description": "flat, house, hmo or other."
                  },
                  "bedrooms": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of bedrooms."
                  },
                  "preferred_timing": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "When the visit suits, e.g. \"weekday mornings in the next 2 weeks\"."
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Name to put on the quote."
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "Email address for the quote."
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 32,
                    "description": "Optional phone number for arranging access."
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Optional access notes, e.g. \"tenant works nights\". No personal details about tenants."
                  },
                  "consent_to_contact": {
                    "type": "boolean",
                    "description": "Must be true: the landlord agrees Letwarden may share these details with a vetted engineer and contact them about this quote."
                  }
                },
                "required": [
                  "service",
                  "postcode",
                  "name",
                  "email",
                  "consent_to_contact"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "reference": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "received",
                            "not_covered"
                          ]
                        },
                        "service": {
                          "type": "string"
                        },
                        "service_name": {
                          "type": "string"
                        },
                        "postcode_district": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "coverage": {
                          "type": "string",
                          "enum": [
                            "in_launch_area",
                            "outside_launch_area",
                            "outside_england"
                          ]
                        },
                        "next_step": {
                          "type": "string"
                        },
                        "response_time": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "reference",
                        "status",
                        "service",
                        "service_name",
                        "postcode_district",
                        "coverage",
                        "next_step",
                        "response_time"
                      ],
                      "additionalProperties": false
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/services_quote_status": {
      "post": {
        "operationId": "services_quote_status",
        "summary": "Check a quote request",
        "description": "Use this when a landlord asks how an engineer quote they requested through Letwarden is going, for example whether the quote has been sent or the visit booked. Needs the quote reference (e.g. LW-7K3Q-9XPA) and the email address used for the request. Do not use to request a new quote (use services_request_quote).",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^LW-[0-9A-Z]{4}-[0-9A-Z]{4}$",
                    "description": "Quote reference, e.g. \"LW-7K3Q-9XPA\"."
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "Email address the quote was requested with."
                  }
                },
                "required": [
                  "reference",
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "reference": {
                          "type": "string"
                        },
                        "found": {
                          "type": "boolean"
                        },
                        "service_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "postcode_district": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "requested_on": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "new",
                            "contacted",
                            "quoted",
                            "booked",
                            "completed",
                            "closed",
                            null
                          ]
                        },
                        "status_label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "next_step": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "reference",
                        "found",
                        "service_name",
                        "postcode_district",
                        "requested_on",
                        "status",
                        "status_label",
                        "next_step"
                      ],
                      "additionalProperties": false
                    },
                    "text": {
                      "type": "string",
                      "description": "A one-line summary of the result, then a Markdown table when the result lists things."
                    }
                  },
                  "required": [
                    "result",
                    "text"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The input was not usable. The error explains what to change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}