{
  "openapi": "3.1.0",
  "info": {
    "title": "HOUSING-iQ API",
    "version": "2026-11-22",
    "description": "Read and write your HOUSING-iQ data: homes, tenants, tenancies, repairs, complaints, appointments, rent and more. Every request acts as an organisation admin, so the same rules apply as in the app.",
    "contact": {
      "name": "HOUSING-iQ",
      "url": "https://www.housing-iq.com/contact/"
    }
  },
  "servers": [
    {
      "url": "https://api.housing-iq.com/v1",
      "description": "Live and sandbox (the key decides which)"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Organisation"
    },
    {
      "name": "Properties",
      "description": "The homes your organisation manages."
    },
    {
      "name": "Tenants",
      "description": "The people who live in your homes. Creating a tenant creates their HOUSING-iQ account and returns a one-time temporary password for you to hand over; they choose their own password when they first sign in."
    },
    {
      "name": "Tenancies",
      "description": "Who lives where, on what kind of tenancy."
    },
    {
      "name": "Repairs",
      "description": "Repairs reported by tenants or staff. HOUSING-iQ works out the Awaab's Law deadlines and repair target when a repair is created or its priority changes; record what was done with the awaab_*_at fields."
    },
    {
      "name": "Repair events",
      "description": "Each repair's history: created, triaged, assigned, scheduled, status changes and completion."
    },
    {
      "name": "Complaints",
      "description": "Complaints, followed through both stages of the Housing Ombudsman's Complaint Handling Code. HOUSING-iQ sets the acknowledgement and reply deadlines in working days."
    },
    {
      "name": "Cases",
      "description": "Casework: support, arrears, welfare, safeguarding and tenancy cases. Needs the sensitive scope."
    },
    {
      "name": "Appointments",
      "description": "Support visits, inspections, reviews and other appointments. The tenant is told when one is booked, moved or cancelled. Repair visits are booked on the repair itself (set scheduled_for on the repair) and HOUSING-iQ adds the appointment for you, so they are listed here but not created here."
    },
    {
      "name": "Rent accounts",
      "description": "One rent account per tenant. The balance changes only through rent transactions; weekly rent is added by HOUSING-iQ on the day it is due."
    },
    {
      "name": "Rent transactions",
      "description": "The rent statement. A line is never edited or deleted: put a mistake right with an adjustment. Charges are positive; payments and Housing Benefit or Universal Credit are negative; an adjustment can be either and needs a description."
    },
    {
      "name": "Anti-social behaviour reports",
      "description": "ASB reports. The diary that goes with each report cannot be changed and is not available through the API. Needs the sensitive scope."
    },
    {
      "name": "Inspections",
      "description": "Home inspections."
    },
    {
      "name": "Empty homes",
      "description": "Empty homes, from vacant to let."
    },
    {
      "name": "Compliance certificates",
      "description": "Gas, electrical, energy, fire risk and legionella certificates for each home."
    },
    {
      "name": "Documents",
      "description": "Documents shared with tenants, and whether each has been signed. File contents are not available through the API."
    },
    {
      "name": "Notices",
      "description": "News and alerts shown to tenants in the app."
    },
    {
      "name": "Wellbeing check-ins",
      "description": "Wellbeing check-ins from tenants and how staff responded. Needs the sensitive scope. Needs the sensitive scope."
    },
    {
      "name": "Events"
    },
    {
      "name": "Export"
    }
  ],
  "paths": {
    "/properties": {
      "get": {
        "tags": [
          "Properties"
        ],
        "operationId": "list_properties",
        "summary": "List properties",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include removed records."
          },
          {
            "name": "scheme",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by scheme. Separate several values with commas."
          },
          {
            "name": "postcode",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by postcode. Separate several values with commas."
          },
          {
            "name": "property_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "flat",
                "house",
                "bedsit",
                "bungalow",
                "maisonette",
                "room",
                "other"
              ]
            },
            "description": "Filter by property_type. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "occupied",
                "void",
                "unavailable"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Property"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Properties"
        ],
        "operationId": "create_property",
        "summary": "Create a property",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "scheme": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "The scheme or estate the home belongs to."
                  },
                  "address_line1": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "First line of the address."
                  },
                  "address_line2": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "Second line of the address."
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Town or city."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "UK postcode."
                  },
                  "property_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "flat",
                      "house",
                      "bedsit",
                      "bungalow",
                      "maisonette",
                      "room",
                      "other"
                    ],
                    "description": "Kind of home."
                  },
                  "bedrooms": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of bedrooms."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "occupied",
                      "void",
                      "unavailable"
                    ],
                    "description": "Whether the home is lived in."
                  },
                  "latitude": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": -90,
                    "maximum": 90,
                    "description": "Latitude."
                  },
                  "longitude": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Longitude."
                  }
                },
                "required": [
                  "address_line1",
                  "postcode"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Property"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/properties/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Properties"
        ],
        "operationId": "get_property",
        "summary": "Retrieve a property",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Property"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Properties"
        ],
        "operationId": "update_property",
        "summary": "Update a property",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "scheme": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "The scheme or estate the home belongs to."
                  },
                  "address_line1": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "First line of the address."
                  },
                  "address_line2": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "Second line of the address."
                  },
                  "city": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Town or city."
                  },
                  "postcode": {
                    "type": "string",
                    "maxLength": 10,
                    "description": "UK postcode."
                  },
                  "property_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "flat",
                      "house",
                      "bedsit",
                      "bungalow",
                      "maisonette",
                      "room",
                      "other"
                    ],
                    "description": "Kind of home."
                  },
                  "bedrooms": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 20,
                    "description": "Number of bedrooms."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "occupied",
                      "void",
                      "unavailable"
                    ],
                    "description": "Whether the home is lived in."
                  },
                  "latitude": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": -90,
                    "maximum": 90,
                    "description": "Latitude."
                  },
                  "longitude": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": -180,
                    "maximum": 180,
                    "description": "Longitude."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Property"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Properties"
        ],
        "operationId": "delete_property",
        "summary": "Remove a property",
        "description": "Sets deleted_at. The record is kept and can be listed with include_deleted=true. Needs the write scope.",
        "responses": {
          "200": {
            "description": "The removed record, with deleted: true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Property"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tenants": {
      "get": {
        "tags": [
          "Tenants"
        ],
        "operationId": "list_tenants",
        "summary": "List tenants",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "email",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by email. Separate several values with commas."
          },
          {
            "name": "is_active",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by is_active. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tenant"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Tenants"
        ],
        "operationId": "create_tenant",
        "summary": "Create a tenant",
        "description": "Creates the tenant and their account. The response includes temporary_password once; hand it to the tenant privately. Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "first_name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "First name."
                  },
                  "last_name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Last name."
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 254,
                    "description": "Email address, used to sign in and for email updates."
                  }
                },
                "required": [
                  "first_name",
                  "last_name",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tenants/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Tenants"
        ],
        "operationId": "get_tenant",
        "summary": "Retrieve a tenant",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tenancies": {
      "get": {
        "tags": [
          "Tenancies"
        ],
        "operationId": "list_tenancies",
        "summary": "List tenancies",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include removed records."
          },
          {
            "name": "property_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by property_id. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "tenancy_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "secure",
                "assured",
                "starter",
                "temporary",
                "emergency",
                "licence"
              ]
            },
            "description": "Filter by tenancy_type. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tenancy"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Tenancies"
        ],
        "operationId": "create_tenancy",
        "summary": "Create a tenancy",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "property_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The tenant (see Tenants)."
                  },
                  "household_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The household, when grouped."
                  },
                  "start_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Tenancy start date."
                  },
                  "end_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Tenancy end date, if ended."
                  },
                  "tenancy_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "secure",
                      "assured",
                      "starter",
                      "temporary",
                      "emergency",
                      "licence"
                    ],
                    "description": "Kind of tenancy."
                  },
                  "is_lead": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "The lead tenant of the household."
                  },
                  "weekly_charge": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 5000,
                    "description": "Weekly rent, in pounds."
                  }
                },
                "required": [
                  "property_id",
                  "tenant_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tenancies/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Tenancies"
        ],
        "operationId": "get_tenancy",
        "summary": "Retrieve a tenancy",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Tenancies"
        ],
        "operationId": "update_tenancy",
        "summary": "Update a tenancy",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "household_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The household, when grouped."
                  },
                  "start_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Tenancy start date."
                  },
                  "end_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Tenancy end date, if ended."
                  },
                  "tenancy_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "secure",
                      "assured",
                      "starter",
                      "temporary",
                      "emergency",
                      "licence"
                    ],
                    "description": "Kind of tenancy."
                  },
                  "is_lead": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "The lead tenant of the household."
                  },
                  "weekly_charge": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 5000,
                    "description": "Weekly rent, in pounds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Tenancies"
        ],
        "operationId": "delete_tenancy",
        "summary": "Remove a tenancy",
        "description": "Sets deleted_at. The record is kept and can be listed with include_deleted=true. Needs the write scope.",
        "responses": {
          "200": {
            "description": "The removed record, with deleted: true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenancy"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/repairs": {
      "get": {
        "tags": [
          "Repairs"
        ],
        "operationId": "list_repairs",
        "summary": "List repairs",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by reference. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "property_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by property_id. Separate several values with commas."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "damp_mould",
                "heating",
                "plumbing",
                "electrical",
                "doors_windows",
                "pests",
                "safety_hazard",
                "general"
              ]
            },
            "description": "Filter by category. Separate several values with commas."
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "emergency",
                "urgent",
                "routine"
              ]
            },
            "description": "Filter by priority. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "triaged",
                "assigned",
                "scheduled",
                "in_progress",
                "completed",
                "cancelled"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          },
          {
            "name": "is_damp",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by is_damp. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Repair"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Repairs"
        ],
        "operationId": "create_repair",
        "summary": "Create a repair",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The tenant (see Tenants)."
                  },
                  "property_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "damp_mould",
                      "heating",
                      "plumbing",
                      "electrical",
                      "doors_windows",
                      "pests",
                      "safety_hazard",
                      "general"
                    ],
                    "description": "What needs repairing."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Short description."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Full description."
                  },
                  "priority": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "emergency",
                      "urgent",
                      "routine"
                    ],
                    "description": "Priority. Sets the repair target."
                  },
                  "is_damp": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Damp or mould is involved."
                  },
                  "hazard_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "damp_mould",
                      "excess_cold",
                      "excess_heat",
                      "falls",
                      "structural_collapse",
                      "fire_explosion",
                      "electrical",
                      "domestic_hygiene",
                      "other_hhsrs"
                    ],
                    "description": "The Awaab's Law hazard, if any."
                  },
                  "hazard_class": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "none",
                      "significant",
                      "emergency"
                    ],
                    "description": "Awaab's Law class: an emergency hazard gets a 24-hour clock."
                  }
                },
                "required": [
                  "tenant_id",
                  "category",
                  "title"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Repair"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/repairs/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Repairs"
        ],
        "operationId": "get_repair",
        "summary": "Retrieve a repair",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Repair"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Repairs"
        ],
        "operationId": "update_repair",
        "summary": "Update a repair",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "property_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "damp_mould",
                      "heating",
                      "plumbing",
                      "electrical",
                      "doors_windows",
                      "pests",
                      "safety_hazard",
                      "general"
                    ],
                    "description": "What needs repairing."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Short description."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Full description."
                  },
                  "priority": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "emergency",
                      "urgent",
                      "routine"
                    ],
                    "description": "Priority. Sets the repair target."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "new",
                      "triaged",
                      "assigned",
                      "scheduled",
                      "in_progress",
                      "completed",
                      "cancelled"
                    ],
                    "description": "Where the repair has got to. The tenant is told of each change."
                  },
                  "is_damp": {
                    "type": [
                      "boolean",
                      "null"
                    ],
                    "description": "Damp or mould is involved."
                  },
                  "hazard_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "damp_mould",
                      "excess_cold",
                      "excess_heat",
                      "falls",
                      "structural_collapse",
                      "fire_explosion",
                      "electrical",
                      "domestic_hygiene",
                      "other_hhsrs"
                    ],
                    "description": "The Awaab's Law hazard, if any."
                  },
                  "hazard_class": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "none",
                      "significant",
                      "emergency"
                    ],
                    "description": "Awaab's Law class: an emergency hazard gets a 24-hour clock."
                  },
                  "scheduled_for": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Booked visit. The tenant is told."
                  },
                  "assigned_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The officer responsible (a staff member id)."
                  },
                  "contractor_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Contractor contact name."
                  },
                  "contractor_company": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Contractor company."
                  },
                  "contractor_phone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40,
                    "description": "Contractor phone number, shown to the tenant."
                  },
                  "awaab_investigated_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When the investigation was done. The later deadlines follow from it."
                  },
                  "awaab_summary_sent_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When the written summary was sent."
                  },
                  "awaab_safety_work_done_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When the home was made safe."
                  },
                  "awaab_preventative_started_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When further work started."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Repair"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/repair_events": {
      "get": {
        "tags": [
          "Repair events"
        ],
        "operationId": "list_repair_events",
        "summary": "List repair events",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "repair_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by repair_id. Separate several values with commas."
          },
          {
            "name": "event_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created",
                "ai_triage",
                "status_change",
                "note",
                "scheduled",
                "assigned",
                "escalation",
                "completed",
                "priority_change",
                "contractor"
              ]
            },
            "description": "Filter by event_type. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RepairEvent"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/repair_events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Repair events"
        ],
        "operationId": "get_repair_event",
        "summary": "Retrieve a repair event",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepairEvent"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/complaints": {
      "get": {
        "tags": [
          "Complaints"
        ],
        "operationId": "list_complaints",
        "summary": "List complaints",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by reference. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "repairs",
                "anti_social_behaviour",
                "staff",
                "rent_and_charges",
                "communication",
                "neighbourhood",
                "other"
              ]
            },
            "description": "Filter by category. Separate several values with commas."
          },
          {
            "name": "channel",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "app",
                "phone",
                "in_person",
                "letter",
                "email",
                "other"
              ]
            },
            "description": "Filter by channel. Separate several values with commas."
          },
          {
            "name": "stage",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "stage_1",
                "stage_2",
                "ombudsman"
              ]
            },
            "description": "Filter by stage. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "acknowledged",
                "responded",
                "closed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Complaint"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Complaints"
        ],
        "operationId": "create_complaint",
        "summary": "Create a complaint",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The tenant (see Tenants)."
                  },
                  "subject": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "What the complaint is about, in a line."
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 10000,
                    "description": "The complaint in full."
                  },
                  "category": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "repairs",
                      "anti_social_behaviour",
                      "staff",
                      "rent_and_charges",
                      "communication",
                      "neighbourhood",
                      "other"
                    ],
                    "description": "Category."
                  },
                  "desired_outcome": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "What the tenant would like to happen."
                  },
                  "channel": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "app",
                      "phone",
                      "in_person",
                      "letter",
                      "email",
                      "other"
                    ],
                    "description": "How the complaint was made."
                  },
                  "received_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When it was received (defaults to now)."
                  }
                },
                "required": [
                  "tenant_id",
                  "subject",
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/complaints/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Complaints"
        ],
        "operationId": "get_complaint",
        "summary": "Retrieve a complaint",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Complaints"
        ],
        "operationId": "update_complaint",
        "summary": "Update a complaint",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "owner_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The member of staff handling it."
                  },
                  "stage1_acknowledged_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Stage 1: when acknowledged."
                  },
                  "stage1_extended_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Stage 1: extended reply date."
                  },
                  "stage1_extension_reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Stage 1: why the reply date was extended."
                  },
                  "stage1_responded_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Stage 1: when the reply was sent."
                  },
                  "stage1_response": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20000,
                    "description": "Stage 1: the reply."
                  },
                  "stage2_acknowledged_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Stage 2: when acknowledged."
                  },
                  "stage2_extended_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Stage 2: extended reply date."
                  },
                  "stage2_extension_reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Stage 2: why the reply date was extended."
                  },
                  "stage2_responded_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Stage 2: when the reply was sent."
                  },
                  "stage2_response": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 20000,
                    "description": "Stage 2: the reply."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/cases": {
      "get": {
        "tags": [
          "Cases"
        ],
        "operationId": "list_cases",
        "summary": "List cases",
        "description": "Newest first. Needs the read and sensitive scopes.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by reference. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "case_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "rent_arrears",
                "asb",
                "welfare",
                "repairs_related",
                "safeguarding",
                "complaint",
                "tenancy",
                "other"
              ]
            },
            "description": "Filter by case_type. Separate several values with commas."
          },
          {
            "name": "priority",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "p1",
                "p2",
                "p3",
                "p4"
              ]
            },
            "description": "Filter by priority. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "in_progress",
                "on_hold",
                "closed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          },
          {
            "name": "risk_level",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ]
            },
            "description": "Filter by risk_level. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Case"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/cases/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Cases"
        ],
        "operationId": "get_case",
        "summary": "Retrieve a case",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/appointments": {
      "get": {
        "tags": [
          "Appointments"
        ],
        "operationId": "list_appointments",
        "summary": "List appointments",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include removed records."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "appointment_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "repair_visit",
                "support_visit",
                "inspection",
                "review",
                "other"
              ]
            },
            "description": "Filter by appointment_type. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "requested",
                "confirmed",
                "completed",
                "cancelled",
                "missed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          },
          {
            "name": "repair_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by repair_id. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Appointment"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Appointments"
        ],
        "operationId": "create_appointment",
        "summary": "Create a appointment",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The tenant (see Tenants)."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "What the appointment is."
                  },
                  "appointment_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "repair_visit",
                      "support_visit",
                      "inspection",
                      "review",
                      "other"
                    ],
                    "description": "Kind of appointment. repair_visit appointments come from repairs and cannot be created here."
                  },
                  "scheduled_for": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When it is."
                  },
                  "duration_mins": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 5,
                    "maximum": 720,
                    "description": "Length in minutes."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "requested",
                      "confirmed",
                      "completed",
                      "cancelled",
                      "missed"
                    ],
                    "description": "Status."
                  },
                  "location": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "Where."
                  },
                  "contractor_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Who is coming."
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Notes for the tenant."
                  }
                },
                "required": [
                  "tenant_id",
                  "title",
                  "scheduled_for"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appointment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/appointments/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Appointments"
        ],
        "operationId": "get_appointment",
        "summary": "Retrieve a appointment",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appointment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Appointments"
        ],
        "operationId": "update_appointment",
        "summary": "Update a appointment",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "What the appointment is."
                  },
                  "appointment_type": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "repair_visit",
                      "support_visit",
                      "inspection",
                      "review",
                      "other"
                    ],
                    "description": "Kind of appointment. repair_visit appointments come from repairs and cannot be created here."
                  },
                  "scheduled_for": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When it is."
                  },
                  "duration_mins": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 5,
                    "maximum": 720,
                    "description": "Length in minutes."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "requested",
                      "confirmed",
                      "completed",
                      "cancelled",
                      "missed"
                    ],
                    "description": "Status."
                  },
                  "location": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 300,
                    "description": "Where."
                  },
                  "contractor_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Who is coming."
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2000,
                    "description": "Notes for the tenant."
                  },
                  "cancel_reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500,
                    "description": "Why it was cancelled."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appointment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/rent_accounts": {
      "get": {
        "tags": [
          "Rent accounts"
        ],
        "operationId": "list_rent_accounts",
        "summary": "List rent accounts",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RentAccount"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Rent accounts"
        ],
        "operationId": "create_rent_account",
        "summary": "Create a rent account",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The tenant (see Tenants)."
                  },
                  "tenancy_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The tenancy."
                  },
                  "weekly_charge": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 5000,
                    "description": "Weekly rent, in pounds."
                  },
                  "next_due_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "When rent is next added. Cannot be in the past."
                  }
                },
                "required": [
                  "tenant_id",
                  "weekly_charge"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RentAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/rent_accounts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Rent accounts"
        ],
        "operationId": "get_rent_account",
        "summary": "Retrieve a rent account",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RentAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Rent accounts"
        ],
        "operationId": "update_rent_account",
        "summary": "Update a rent account",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "weekly_charge": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 5000,
                    "description": "Weekly rent, in pounds."
                  },
                  "next_due_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "When rent is next added. Cannot be in the past."
                  },
                  "payment_plan_note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500,
                    "description": "Note on any payment plan."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RentAccount"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/rent_transactions": {
      "get": {
        "tags": [
          "Rent transactions"
        ],
        "operationId": "list_rent_transactions",
        "summary": "List rent transactions",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "rent_account_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by rent_account_id. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "txn_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "charge",
                "payment",
                "adjustment",
                "housing_benefit"
              ]
            },
            "description": "Filter by txn_type. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "confirmed",
                "pending",
                "disputed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/RentTransaction"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Rent transactions"
        ],
        "operationId": "create_rent_transaction",
        "summary": "Create a rent transaction",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "rent_account_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The rent account."
                  },
                  "amount": {
                    "type": "number",
                    "minimum": -20000,
                    "maximum": 20000,
                    "description": "Amount in pounds: positive adds to what is owed, negative reduces it."
                  },
                  "txn_type": {
                    "type": "string",
                    "enum": [
                      "charge",
                      "payment",
                      "adjustment",
                      "housing_benefit"
                    ],
                    "description": "Kind of line."
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 200,
                    "description": "What the line is for (required for adjustments)."
                  },
                  "occurred_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Date of the payment or charge (up to a year back, not in the future)."
                  }
                },
                "required": [
                  "rent_account_id",
                  "amount",
                  "txn_type"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RentTransaction"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/rent_transactions/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Rent transactions"
        ],
        "operationId": "get_rent_transaction",
        "summary": "Retrieve a rent transaction",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RentTransaction"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/asb_reports": {
      "get": {
        "tags": [
          "Anti-social behaviour reports"
        ],
        "operationId": "list_asb_reports",
        "summary": "List anti-social behaviour reports",
        "description": "Newest first. Needs the read and sensitive scopes.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "reference",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by reference. Separate several values with commas."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by category. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "investigating",
                "resolved",
                "closed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          },
          {
            "name": "risk_level",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "medium",
                "high"
              ]
            },
            "description": "Filter by risk_level. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AsbReport"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/asb_reports/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Anti-social behaviour reports"
        ],
        "operationId": "get_asb_report",
        "summary": "Retrieve a asb report",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AsbReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inspections": {
      "get": {
        "tags": [
          "Inspections"
        ],
        "operationId": "list_inspections",
        "summary": "List inspections",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "property_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by property_id. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "scheduled",
                "in_progress",
                "completed"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Inspection"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Inspections"
        ],
        "operationId": "create_inspection",
        "summary": "Create a inspection",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "property_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "inspector_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The inspecting member of staff."
                  },
                  "scheduled_for": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When."
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Notes."
                  }
                },
                "required": [
                  "property_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/inspections/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Inspections"
        ],
        "operationId": "get_inspection",
        "summary": "Retrieve a inspection",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Inspections"
        ],
        "operationId": "update_inspection",
        "summary": "Update a inspection",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "inspector_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "The inspecting member of staff."
                  },
                  "scheduled_for": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "scheduled",
                      "in_progress",
                      "completed"
                    ],
                    "description": "Status."
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Notes."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inspection"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/voids": {
      "get": {
        "tags": [
          "Empty homes"
        ],
        "operationId": "list_voids",
        "summary": "List empty homes",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "property_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by property_id. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "vacant",
                "works",
                "ready",
                "let"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Void"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Empty homes"
        ],
        "operationId": "create_void",
        "summary": "Create a void",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "property_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "vacated_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "When the home became empty."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "vacant",
                      "works",
                      "ready",
                      "let"
                    ],
                    "description": "Status."
                  },
                  "allocation_notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Allocation notes."
                  }
                },
                "required": [
                  "property_id"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Void"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/voids/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Empty homes"
        ],
        "operationId": "get_void",
        "summary": "Retrieve a void",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Void"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Empty homes"
        ],
        "operationId": "update_void",
        "summary": "Update a void",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "vacated_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "When the home became empty."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "vacant",
                      "works",
                      "ready",
                      "let"
                    ],
                    "description": "Status."
                  },
                  "allocation_notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Allocation notes."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Void"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/compliance_certificates": {
      "get": {
        "tags": [
          "Compliance certificates"
        ],
        "operationId": "list_compliance_certificates",
        "summary": "List compliance certificates",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "property_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by property_id. Separate several values with commas."
          },
          {
            "name": "cert_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "gas_cp12",
                "eicr",
                "epc",
                "fire_risk",
                "legionella"
              ]
            },
            "description": "Filter by cert_type. Separate several values with commas."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "valid",
                "due_soon",
                "expired"
              ]
            },
            "description": "Filter by status. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ComplianceCertificate"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Compliance certificates"
        ],
        "operationId": "create_compliance_certificate",
        "summary": "Create a compliance certificate",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "property_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "The home (see Properties)."
                  },
                  "cert_type": {
                    "type": "string",
                    "enum": [
                      "gas_cp12",
                      "eicr",
                      "epc",
                      "fire_risk",
                      "legionella"
                    ],
                    "description": "Kind of certificate."
                  },
                  "issued_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Issued."
                  },
                  "expires_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Expires."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "valid",
                      "due_soon",
                      "expired"
                    ],
                    "description": "Status."
                  }
                },
                "required": [
                  "property_id",
                  "cert_type"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCertificate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/compliance_certificates/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Compliance certificates"
        ],
        "operationId": "get_compliance_certificate",
        "summary": "Retrieve a compliance certificate",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCertificate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Compliance certificates"
        ],
        "operationId": "update_compliance_certificate",
        "summary": "Update a compliance certificate",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "issued_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Issued."
                  },
                  "expires_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Expires."
                  },
                  "status": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "valid",
                      "due_soon",
                      "expired"
                    ],
                    "description": "Status."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ComplianceCertificate"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/documents": {
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "list_documents",
        "summary": "List documents",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "tenancy",
                "certificate",
                "guide",
                "form",
                "other"
              ]
            },
            "description": "Filter by category. Separate several values with commas."
          },
          {
            "name": "sign_state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "requested",
                "signed"
              ]
            },
            "description": "Filter by sign_state. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Document"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/documents/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Documents"
        ],
        "operationId": "get_document",
        "summary": "Retrieve a document",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/notices": {
      "get": {
        "tags": [
          "Notices"
        ],
        "operationId": "list_notices",
        "summary": "List notices",
        "description": "Newest first. Needs the read scope.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "updated_since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records changed at or after this time. Use it to sync."
          },
          {
            "name": "include_deleted",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Include removed records."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Notice"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "post": {
        "tags": [
          "Notices"
        ],
        "operationId": "create_notice",
        "summary": "Create a notice",
        "description": "Needs the write scope. Send an Idempotency-Key header to make retries safe.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "description": "Any unique value; a retry with the same key returns the first response."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Title."
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Text."
                  },
                  "tone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "info",
                      "warning",
                      "good_news"
                    ],
                    "description": "How it is shown."
                  },
                  "audience": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "org",
                      "households",
                      "tenants"
                    ],
                    "description": "Who sees it."
                  },
                  "audience_ids": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Household or tenant ids, when the audience is households or tenants."
                  },
                  "published_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When it is shown from."
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/notices/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Notices"
        ],
        "operationId": "get_notice",
        "summary": "Retrieve a notice",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Notices"
        ],
        "operationId": "update_notice",
        "summary": "Update a notice",
        "description": "Send only the fields to change. Needs the write scope.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Title."
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Text."
                  },
                  "tone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "info",
                      "warning",
                      "good_news"
                    ],
                    "description": "How it is shown."
                  },
                  "audience": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "org",
                      "households",
                      "tenants"
                    ],
                    "description": "Who sees it."
                  },
                  "audience_ids": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Household or tenant ids, when the audience is households or tenants."
                  },
                  "published_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When it is shown from."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Notices"
        ],
        "operationId": "delete_notice",
        "summary": "Remove a notice",
        "description": "Sets deleted_at. The record is kept and can be listed with include_deleted=true. Needs the write scope.",
        "responses": {
          "200": {
            "description": "The removed record, with deleted: true.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/checkins": {
      "get": {
        "tags": [
          "Wellbeing check-ins"
        ],
        "operationId": "list_checkins",
        "summary": "List wellbeing check-ins",
        "description": "Newest first. Needs the read and sensitive scopes.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "How many to return (1 to 100)."
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "The next_cursor from the previous page."
          },
          {
            "name": "created_after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created after this time."
          },
          {
            "name": "created_before",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only records created before this time."
          },
          {
            "name": "tenant_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by tenant_id. Separate several values with commas."
          },
          {
            "name": "mood",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "great",
                "good",
                "okay",
                "low",
                "struggling"
              ]
            },
            "description": "Filter by mood. Separate several values with commas."
          },
          {
            "name": "crisis_flagged",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Filter by crisis_flagged. Separate several values with commas."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of results.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "const": "list"
                    },
                    "url": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Checkin"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/checkins/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Wellbeing check-ins"
        ],
        "operationId": "get_checkin",
        "summary": "Retrieve a checkin",
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Checkin"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/repairs/{id}/events": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "tags": [
          "Repairs"
        ],
        "operationId": "list_repair_history",
        "summary": "List a repair's history",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "starting_after",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of repair events."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/organisation": {
      "get": {
        "tags": [
          "Organisation"
        ],
        "operationId": "get_organisation",
        "summary": "Retrieve your organisation",
        "description": "The organisation the key acts on (its sandbox for test keys), with livemode.",
        "responses": {
          "200": {
            "description": "Your organisation."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "list_events",
        "summary": "List events",
        "description": "Every change, oldest first, kept for 30 days. Pass the next_after value back as after to read on from where you stopped.",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only events after this event id."
          },
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Only events at or after this time."
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Event types, separated by commas."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "const": "list"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_after": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/events/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "get": {
        "tags": [
          "Events"
        ],
        "operationId": "get_event",
        "summary": "Retrieve an event",
        "responses": {
          "200": {
            "description": "The event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/export/{resource}": {
      "parameters": [
        {
          "name": "resource",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "enum": [
              "properties",
              "tenants",
              "tenancies",
              "repairs",
              "repair_events",
              "complaints",
              "cases",
              "appointments",
              "rent_accounts",
              "rent_transactions",
              "asb_reports",
              "inspections",
              "voids",
              "compliance_certificates",
              "documents",
              "notices",
              "checkins"
            ]
          }
        }
      ],
      "get": {
        "tags": [
          "Export"
        ],
        "operationId": "export_resource",
        "summary": "Export every record as NDJSON",
        "description": "One JSON object per line, oldest first, up to 100,000 records. Takes the same filters as the list. Use it to load your data warehouse.",
        "responses": {
          "200": {
            "description": "Newline-delimited JSON.",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "webhooks": {
    "property.created": {
      "post": {
        "summary": "property.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "property.updated": {
      "post": {
        "summary": "property.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "property.deleted": {
      "post": {
        "summary": "property.deleted",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "tenant.created": {
      "post": {
        "summary": "tenant.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "tenant.updated": {
      "post": {
        "summary": "tenant.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "tenancy.created": {
      "post": {
        "summary": "tenancy.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "tenancy.updated": {
      "post": {
        "summary": "tenancy.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "tenancy.deleted": {
      "post": {
        "summary": "tenancy.deleted",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "repair.created": {
      "post": {
        "summary": "repair.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "repair.updated": {
      "post": {
        "summary": "repair.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "repair_event.created": {
      "post": {
        "summary": "repair_event.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "repair_event.updated": {
      "post": {
        "summary": "repair_event.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "complaint.created": {
      "post": {
        "summary": "complaint.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "complaint.updated": {
      "post": {
        "summary": "complaint.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "case.created": {
      "post": {
        "summary": "case.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "case.updated": {
      "post": {
        "summary": "case.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "appointment.created": {
      "post": {
        "summary": "appointment.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "appointment.updated": {
      "post": {
        "summary": "appointment.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "rent_account.created": {
      "post": {
        "summary": "rent_account.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "rent_account.updated": {
      "post": {
        "summary": "rent_account.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "rent_transaction.created": {
      "post": {
        "summary": "rent_transaction.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "rent_transaction.updated": {
      "post": {
        "summary": "rent_transaction.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "asb_report.created": {
      "post": {
        "summary": "asb_report.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "asb_report.updated": {
      "post": {
        "summary": "asb_report.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "inspection.created": {
      "post": {
        "summary": "inspection.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "inspection.updated": {
      "post": {
        "summary": "inspection.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "void.created": {
      "post": {
        "summary": "void.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "void.updated": {
      "post": {
        "summary": "void.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "compliance_certificate.created": {
      "post": {
        "summary": "compliance_certificate.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "compliance_certificate.updated": {
      "post": {
        "summary": "compliance_certificate.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "document.created": {
      "post": {
        "summary": "document.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "document.updated": {
      "post": {
        "summary": "document.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "notice.created": {
      "post": {
        "summary": "notice.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "notice.updated": {
      "post": {
        "summary": "notice.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "notice.deleted": {
      "post": {
        "summary": "notice.deleted",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "checkin.created": {
      "post": {
        "summary": "checkin.created",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "checkin.updated": {
      "post": {
        "summary": "checkin.updated",
        "description": "Signed with the endpoint secret: HOUSING-iQ-Signature: t=<unix time>,v1=<HMAC-SHA256 of \"<t>.<raw body>\">.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Event"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "hiq_live_... or hiq_test_...",
        "description": "Create keys in the staff console: More, then API."
      }
    },
    "schemas": {
      "Property": {
        "type": "object",
        "title": "Properties",
        "description": "The homes your organisation manages.",
        "properties": {
          "object": {
            "type": "string",
            "const": "property",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "scheme": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "The scheme or estate the home belongs to."
          },
          "address_line1": {
            "type": "string",
            "maxLength": 200,
            "description": "First line of the address."
          },
          "address_line2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "Second line of the address."
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "Town or city."
          },
          "postcode": {
            "type": "string",
            "maxLength": 10,
            "description": "UK postcode."
          },
          "property_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "flat",
              "house",
              "bedsit",
              "bungalow",
              "maisonette",
              "room",
              "other"
            ],
            "description": "Kind of home."
          },
          "bedrooms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 20,
            "description": "Number of bedrooms."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "occupied",
              "void",
              "unavailable"
            ],
            "description": "Whether the home is lived in."
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ],
            "minimum": -90,
            "maximum": 90,
            "description": "Latitude."
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ],
            "minimum": -180,
            "maximum": 180,
            "description": "Longitude."
          },
          "formatted_address": {
            "type": [
              "string",
              "null"
            ],
            "description": "The full address on one line, when known."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the record was removed. Removed records are only listed with include_deleted=true."
          }
        },
        "required": [
          "object",
          "id",
          "scheme",
          "address_line1",
          "address_line2",
          "city",
          "postcode",
          "property_type",
          "bedrooms",
          "status",
          "latitude",
          "longitude",
          "formatted_address",
          "created_at",
          "updated_at",
          "deleted_at"
        ]
      },
      "Tenant": {
        "type": "object",
        "title": "Tenants",
        "description": "The people who live in your homes. Creating a tenant creates their HOUSING-iQ account and returns a one-time temporary password for you to hand over; they choose their own password when they first sign in.",
        "properties": {
          "object": {
            "type": "string",
            "const": "tenant",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "first_name": {
            "type": "string",
            "maxLength": 80,
            "description": "First name."
          },
          "last_name": {
            "type": "string",
            "maxLength": 80,
            "description": "Last name."
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "description": "Email address, used to sign in and for email updates."
          },
          "language": {
            "type": [
              "string",
              "null"
            ],
            "description": "Language the tenant uses the app in (en, pl, ro, so, ur, ar)."
          },
          "is_active": {
            "type": "boolean",
            "description": "False when the account has been deactivated."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "first_name",
          "last_name",
          "email",
          "language",
          "is_active",
          "created_at",
          "updated_at"
        ]
      },
      "Tenancy": {
        "type": "object",
        "title": "Tenancies",
        "description": "Who lives where, on what kind of tenancy.",
        "properties": {
          "object": {
            "type": "string",
            "const": "tenancy",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "property_id": {
            "type": "string",
            "format": "uuid",
            "description": "The home (see Properties)."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "household_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The household, when grouped."
          },
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Tenancy start date."
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Tenancy end date, if ended."
          },
          "tenancy_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secure",
              "assured",
              "starter",
              "temporary",
              "emergency",
              "licence"
            ],
            "description": "Kind of tenancy."
          },
          "is_lead": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The lead tenant of the household."
          },
          "weekly_charge": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 5000,
            "description": "Weekly rent, in pounds."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the record was removed. Removed records are only listed with include_deleted=true."
          }
        },
        "required": [
          "object",
          "id",
          "property_id",
          "tenant_id",
          "household_id",
          "start_date",
          "end_date",
          "tenancy_type",
          "is_lead",
          "weekly_charge",
          "created_at",
          "updated_at",
          "deleted_at"
        ]
      },
      "Repair": {
        "type": "object",
        "title": "Repairs",
        "description": "Repairs reported by tenants or staff. HOUSING-iQ works out the Awaab's Law deadlines and repair target when a repair is created or its priority changes; record what was done with the awaab_*_at fields.",
        "properties": {
          "object": {
            "type": "string",
            "const": "repair",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference shown to the tenant, such as REP-0042."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "property_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The home (see Properties)."
          },
          "category": {
            "type": "string",
            "enum": [
              "damp_mould",
              "heating",
              "plumbing",
              "electrical",
              "doors_windows",
              "pests",
              "safety_hazard",
              "general"
            ],
            "description": "What needs repairing."
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Short description."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Full description."
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "emergency",
              "urgent",
              "routine"
            ],
            "description": "Priority. Sets the repair target."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "new",
              "triaged",
              "assigned",
              "scheduled",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "description": "Where the repair has got to. The tenant is told of each change."
          },
          "is_damp": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Damp or mould is involved."
          },
          "is_repeat": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The same problem has been reported before."
          },
          "hazard_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "damp_mould",
              "excess_cold",
              "excess_heat",
              "falls",
              "structural_collapse",
              "fire_explosion",
              "electrical",
              "domestic_hygiene",
              "other_hhsrs"
            ],
            "description": "The Awaab's Law hazard, if any."
          },
          "hazard_class": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "significant",
              "emergency"
            ],
            "description": "Awaab's Law class: an emergency hazard gets a 24-hour clock."
          },
          "reported_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the repair was reported."
          },
          "target_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Repair target date (from your repair targets)."
          },
          "sla_due_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Repair target, as a time."
          },
          "scheduled_for": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Booked visit. The tenant is told."
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the repair was completed."
          },
          "assigned_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The officer responsible (a staff member id)."
          },
          "contractor_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "Contractor contact name."
          },
          "contractor_company": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "Contractor company."
          },
          "contractor_phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40,
            "description": "Contractor phone number, shown to the tenant."
          },
          "awaab_aware_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the landlord became aware (Awaab's Law clock start)."
          },
          "awaab_emergency_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Emergency hazards: make safe by (24 hours)."
          },
          "awaab_investigate_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Investigate by (10 working days)."
          },
          "awaab_summary_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Written summary to the tenant by (3 working days after investigating)."
          },
          "awaab_fix_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Begin safety work by (5 working days after investigating)."
          },
          "awaab_preventative_start_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Start further work by."
          },
          "awaab_preventative_latest": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Further work physically under way by (12 weeks)."
          },
          "awaab_investigated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the investigation was done. The later deadlines follow from it."
          },
          "awaab_summary_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the written summary was sent."
          },
          "awaab_safety_work_done_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the home was made safe."
          },
          "awaab_preventative_started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When further work started."
          },
          "ai_urgency_score": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Urgency score (0 to 100) from the automatic triage, for staff to confirm."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "reference",
          "tenant_id",
          "property_id",
          "category",
          "title",
          "description",
          "priority",
          "status",
          "is_damp",
          "is_repeat",
          "hazard_type",
          "hazard_class",
          "reported_at",
          "target_date",
          "sla_due_at",
          "scheduled_for",
          "completed_at",
          "assigned_to",
          "contractor_name",
          "contractor_company",
          "contractor_phone",
          "awaab_aware_at",
          "awaab_emergency_by",
          "awaab_investigate_by",
          "awaab_summary_by",
          "awaab_fix_by",
          "awaab_preventative_start_by",
          "awaab_preventative_latest",
          "awaab_investigated_at",
          "awaab_summary_sent_at",
          "awaab_safety_work_done_at",
          "awaab_preventative_started_at",
          "ai_urgency_score",
          "created_at",
          "updated_at"
        ]
      },
      "RepairEvent": {
        "type": "object",
        "title": "Repair events",
        "description": "Each repair's history: created, triaged, assigned, scheduled, status changes and completion.",
        "properties": {
          "object": {
            "type": "string",
            "const": "repair_event",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "repair_id": {
            "type": "string",
            "format": "uuid",
            "description": "The repair."
          },
          "event_type": {
            "type": "string",
            "enum": [
              "created",
              "ai_triage",
              "status_change",
              "note",
              "scheduled",
              "assigned",
              "escalation",
              "completed",
              "priority_change",
              "contractor"
            ],
            "description": "What happened."
          },
          "actor_type": {
            "type": "string",
            "enum": [
              "tenant",
              "staff",
              "ai",
              "system"
            ],
            "description": "Who did it."
          },
          "actor_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The person, when a person did it."
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": "Details."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          }
        },
        "required": [
          "object",
          "id",
          "repair_id",
          "event_type",
          "actor_type",
          "actor_id",
          "body",
          "created_at"
        ]
      },
      "Complaint": {
        "type": "object",
        "title": "Complaints",
        "description": "Complaints, followed through both stages of the Housing Ombudsman's Complaint Handling Code. HOUSING-iQ sets the acknowledgement and reply deadlines in working days.",
        "properties": {
          "object": {
            "type": "string",
            "const": "complaint",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference, such as CMP-0012."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "subject": {
            "type": "string",
            "maxLength": 200,
            "description": "What the complaint is about, in a line."
          },
          "description": {
            "type": "string",
            "maxLength": 10000,
            "description": "The complaint in full."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "repairs",
              "anti_social_behaviour",
              "staff",
              "rent_and_charges",
              "communication",
              "neighbourhood",
              "other"
            ],
            "description": "Category."
          },
          "desired_outcome": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "What the tenant would like to happen."
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "app",
              "phone",
              "in_person",
              "letter",
              "email",
              "other"
            ],
            "description": "How the complaint was made."
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was received (defaults to now)."
          },
          "stage": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "stage_1",
              "stage_2",
              "ombudsman"
            ],
            "description": "Stage."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "open",
              "acknowledged",
              "responded",
              "closed"
            ],
            "description": "Status."
          },
          "owner_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The member of staff handling it."
          },
          "stage1_acknowledge_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 1: acknowledge by."
          },
          "stage1_acknowledged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Stage 1: when acknowledged."
          },
          "stage1_respond_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 1: reply by."
          },
          "stage1_extended_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 1: extended reply date."
          },
          "stage1_extension_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Stage 1: why the reply date was extended."
          },
          "stage1_responded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Stage 1: when the reply was sent."
          },
          "stage1_response": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Stage 1: the reply."
          },
          "escalated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it went to stage 2."
          },
          "escalation_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it went to stage 2."
          },
          "stage2_acknowledge_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 2: acknowledge by."
          },
          "stage2_acknowledged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Stage 2: when acknowledged."
          },
          "stage2_respond_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 2: reply by."
          },
          "stage2_extended_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Stage 2: extended reply date."
          },
          "stage2_extension_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Stage 2: why the reply date was extended."
          },
          "stage2_responded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Stage 2: when the reply was sent."
          },
          "stage2_response": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20000,
            "description": "Stage 2: the reply."
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was closed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "reference",
          "tenant_id",
          "subject",
          "description",
          "category",
          "desired_outcome",
          "channel",
          "received_at",
          "stage",
          "status",
          "owner_id",
          "stage1_acknowledge_by",
          "stage1_acknowledged_at",
          "stage1_respond_by",
          "stage1_extended_to",
          "stage1_extension_reason",
          "stage1_responded_at",
          "stage1_response",
          "escalated_at",
          "escalation_reason",
          "stage2_acknowledge_by",
          "stage2_acknowledged_at",
          "stage2_respond_by",
          "stage2_extended_to",
          "stage2_extension_reason",
          "stage2_responded_at",
          "stage2_response",
          "closed_at",
          "created_at",
          "updated_at"
        ]
      },
      "Case": {
        "type": "object",
        "title": "Cases",
        "description": "Casework: support, arrears, welfare, safeguarding and tenancy cases.",
        "properties": {
          "object": {
            "type": "string",
            "const": "case",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference, such as CASE-0007."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "case_type": {
            "type": "string",
            "enum": [
              "rent_arrears",
              "asb",
              "welfare",
              "repairs_related",
              "safeguarding",
              "complaint",
              "tenancy",
              "other"
            ],
            "description": "Kind of case."
          },
          "title": {
            "type": "string",
            "description": "Title."
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Summary written by staff."
          },
          "priority": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "description": "Priority (p1 highest)."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "open",
              "in_progress",
              "on_hold",
              "closed"
            ],
            "description": "Status."
          },
          "risk_level": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "description": "Risk level."
          },
          "owner_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Case owner."
          },
          "opened_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Opened."
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Closed."
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "resolved",
              "signposted",
              "no_action",
              "escalated",
              "withdrawn"
            ],
            "description": "Outcome."
          },
          "closure_summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "Summary written when closing."
          },
          "linked_repair_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A linked repair."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "reference",
          "tenant_id",
          "case_type",
          "title",
          "summary",
          "priority",
          "status",
          "risk_level",
          "owner_id",
          "opened_at",
          "closed_at",
          "outcome",
          "closure_summary",
          "linked_repair_id",
          "created_at",
          "updated_at"
        ]
      },
      "Appointment": {
        "type": "object",
        "title": "Appointments",
        "description": "Support visits, inspections, reviews and other appointments. The tenant is told when one is booked, moved or cancelled. Repair visits are booked on the repair itself (set scheduled_for on the repair) and HOUSING-iQ adds the appointment for you, so they are listed here but not created here.",
        "properties": {
          "object": {
            "type": "string",
            "const": "appointment",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "What the appointment is."
          },
          "appointment_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "repair_visit",
              "support_visit",
              "inspection",
              "review",
              "other"
            ],
            "description": "Kind of appointment. repair_visit appointments come from repairs and cannot be created here."
          },
          "scheduled_for": {
            "type": "string",
            "format": "date-time",
            "description": "When it is."
          },
          "duration_mins": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 5,
            "maximum": 720,
            "description": "Length in minutes."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "requested",
              "confirmed",
              "completed",
              "cancelled",
              "missed"
            ],
            "description": "Status."
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "Where."
          },
          "contractor_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120,
            "description": "Who is coming."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Notes for the tenant."
          },
          "repair_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "For repair visits: the repair."
          },
          "cancel_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Why it was cancelled."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the record was removed. Removed records are only listed with include_deleted=true."
          }
        },
        "required": [
          "object",
          "id",
          "tenant_id",
          "title",
          "appointment_type",
          "scheduled_for",
          "duration_mins",
          "status",
          "location",
          "contractor_name",
          "notes",
          "repair_id",
          "cancel_reason",
          "created_at",
          "updated_at",
          "deleted_at"
        ]
      },
      "RentAccount": {
        "type": "object",
        "title": "Rent accounts",
        "description": "One rent account per tenant. The balance changes only through rent transactions; weekly rent is added by HOUSING-iQ on the day it is due.",
        "properties": {
          "object": {
            "type": "string",
            "const": "rent_account",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "tenancy_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The tenancy."
          },
          "balance": {
            "type": [
              "number",
              "null"
            ],
            "description": "Amount owed, in pounds (negative means in credit)."
          },
          "weekly_charge": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 5000,
            "description": "Weekly rent, in pounds."
          },
          "next_due_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "When rent is next added. Cannot be in the past."
          },
          "payment_plan_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Note on any payment plan."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "tenant_id",
          "tenancy_id",
          "balance",
          "weekly_charge",
          "next_due_date",
          "payment_plan_note",
          "created_at",
          "updated_at"
        ]
      },
      "RentTransaction": {
        "type": "object",
        "title": "Rent transactions",
        "description": "The rent statement. A line is never edited or deleted: put a mistake right with an adjustment. Charges are positive; payments and Housing Benefit or Universal Credit are negative; an adjustment can be either and needs a description.",
        "properties": {
          "object": {
            "type": "string",
            "const": "rent_transaction",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "rent_account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The rent account."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (taken from the rent account)."
          },
          "amount": {
            "type": "number",
            "minimum": -20000,
            "maximum": 20000,
            "description": "Amount in pounds: positive adds to what is owed, negative reduces it."
          },
          "txn_type": {
            "type": "string",
            "enum": [
              "charge",
              "payment",
              "adjustment",
              "housing_benefit"
            ],
            "description": "Kind of line."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "confirmed",
              "pending",
              "disputed"
            ],
            "description": "Lines you record are confirmed; payments tenants log wait for staff to check."
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "description": "What the line is for (required for adjustments)."
          },
          "occurred_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Date of the payment or charge (up to a year back, not in the future)."
          },
          "charge_for": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "For weekly rent added by HOUSING-iQ: the week it is for."
          },
          "recorded_by": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Who recorded it."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          }
        },
        "required": [
          "object",
          "id",
          "rent_account_id",
          "tenant_id",
          "amount",
          "txn_type",
          "status",
          "description",
          "occurred_on",
          "charge_for",
          "recorded_by",
          "created_at"
        ]
      },
      "AsbReport": {
        "type": "object",
        "title": "Anti-social behaviour reports",
        "description": "ASB reports. The diary that goes with each report cannot be changed and is not available through the API.",
        "properties": {
          "object": {
            "type": "string",
            "const": "asb_report",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reference."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "category": {
            "type": "string",
            "description": "Kind of behaviour."
          },
          "description": {
            "type": "string",
            "description": "What happened."
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "description": "Where."
          },
          "involves": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "residents",
              "external",
              "both",
              "unknown"
            ],
            "description": "Who was involved."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "open",
              "investigating",
              "resolved",
              "closed"
            ],
            "description": "Status."
          },
          "risk_level": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "standard",
              "medium",
              "high"
            ],
            "description": "Risk level."
          },
          "hate_incident": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Recorded as a hate incident (TSM NM01)."
          },
          "owner_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Officer."
          },
          "closure_summary": {
            "type": [
              "string",
              "null"
            ],
            "description": "What was done."
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Closed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "reference",
          "tenant_id",
          "category",
          "description",
          "location",
          "involves",
          "status",
          "risk_level",
          "hate_incident",
          "owner_id",
          "closure_summary",
          "closed_at",
          "created_at",
          "updated_at"
        ]
      },
      "Inspection": {
        "type": "object",
        "title": "Inspections",
        "description": "Home inspections.",
        "properties": {
          "object": {
            "type": "string",
            "const": "inspection",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "property_id": {
            "type": "string",
            "format": "uuid",
            "description": "The home (see Properties)."
          },
          "inspector_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The inspecting member of staff."
          },
          "scheduled_for": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "scheduled",
              "in_progress",
              "completed"
            ],
            "description": "Status."
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Notes."
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was completed."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "property_id",
          "inspector_id",
          "scheduled_for",
          "status",
          "notes",
          "completed_at",
          "created_at",
          "updated_at"
        ]
      },
      "Void": {
        "type": "object",
        "title": "Empty homes",
        "description": "Empty homes, from vacant to let.",
        "properties": {
          "object": {
            "type": "string",
            "const": "void",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "property_id": {
            "type": "string",
            "format": "uuid",
            "description": "The home (see Properties)."
          },
          "vacated_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "When the home became empty."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "vacant",
              "works",
              "ready",
              "let"
            ],
            "description": "Status."
          },
          "days_vacant": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Days empty (worked out for you)."
          },
          "allocation_notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000,
            "description": "Allocation notes."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "property_id",
          "vacated_on",
          "status",
          "days_vacant",
          "allocation_notes",
          "created_at",
          "updated_at"
        ]
      },
      "ComplianceCertificate": {
        "type": "object",
        "title": "Compliance certificates",
        "description": "Gas, electrical, energy, fire risk and legionella certificates for each home.",
        "properties": {
          "object": {
            "type": "string",
            "const": "compliance_certificate",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "property_id": {
            "type": "string",
            "format": "uuid",
            "description": "The home (see Properties)."
          },
          "cert_type": {
            "type": "string",
            "enum": [
              "gas_cp12",
              "eicr",
              "epc",
              "fire_risk",
              "legionella"
            ],
            "description": "Kind of certificate."
          },
          "issued_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Issued."
          },
          "expires_on": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Expires."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "valid",
              "due_soon",
              "expired"
            ],
            "description": "Status."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "property_id",
          "cert_type",
          "issued_on",
          "expires_on",
          "status",
          "created_at",
          "updated_at"
        ]
      },
      "Document": {
        "type": "object",
        "title": "Documents",
        "description": "Documents shared with tenants, and whether each has been signed. File contents are not available through the API.",
        "properties": {
          "object": {
            "type": "string",
            "const": "document",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "title": {
            "type": "string",
            "description": "Title."
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tenancy",
              "certificate",
              "guide",
              "form",
              "other"
            ],
            "description": "Category."
          },
          "requires_signature": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The tenant is asked to sign it."
          },
          "sign_state": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "none",
              "requested",
              "signed"
            ],
            "description": "Signature status."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          }
        },
        "required": [
          "object",
          "id",
          "tenant_id",
          "title",
          "category",
          "requires_signature",
          "sign_state",
          "created_at",
          "updated_at"
        ]
      },
      "Notice": {
        "type": "object",
        "title": "Notices",
        "description": "News and alerts shown to tenants in the app.",
        "properties": {
          "object": {
            "type": "string",
            "const": "notice",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "title": {
            "type": "string",
            "maxLength": 200,
            "description": "Title."
          },
          "body": {
            "type": "string",
            "maxLength": 5000,
            "description": "Text."
          },
          "tone": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "info",
              "warning",
              "good_news"
            ],
            "description": "How it is shown."
          },
          "audience": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "org",
              "households",
              "tenants"
            ],
            "description": "Who sees it."
          },
          "audience_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Household or tenant ids, when the audience is households or tenants."
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it is shown from."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record last changed."
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the record was removed. Removed records are only listed with include_deleted=true."
          }
        },
        "required": [
          "object",
          "id",
          "title",
          "body",
          "tone",
          "audience",
          "audience_ids",
          "published_at",
          "created_at",
          "updated_at",
          "deleted_at"
        ]
      },
      "Checkin": {
        "type": "object",
        "title": "Wellbeing check-ins",
        "description": "Wellbeing check-ins from tenants and how staff responded. Needs the sensitive scope.",
        "properties": {
          "object": {
            "type": "string",
            "const": "checkin",
            "description": "The kind of object."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier."
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid",
            "description": "The tenant (see Tenants)."
          },
          "mood": {
            "type": "string",
            "enum": [
              "great",
              "good",
              "okay",
              "low",
              "struggling"
            ],
            "description": "Mood."
          },
          "stress": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Stress, 1 to 5."
          },
          "loneliness": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Loneliness, 1 to 5."
          },
          "sleep": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Sleep, 1 to 5."
          },
          "crisis_flagged": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "May signal a crisis."
          },
          "responded_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When staff responded."
          },
          "response_action": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "spoke_to_tenant",
              "visited",
              "referred",
              "emergency_services",
              "left_message",
              "no_answer"
            ],
            "description": "What staff did."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the record was created."
          }
        },
        "required": [
          "object",
          "id",
          "tenant_id",
          "mood",
          "stress",
          "loneliness",
          "sleep",
          "crisis_flagged",
          "responded_at",
          "response_action",
          "created_at"
        ]
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "evt_3f2a9c..."
          },
          "object": {
            "const": "event"
          },
          "type": {
            "type": "string",
            "enum": [
              "ping",
              "property.created",
              "property.updated",
              "property.deleted",
              "tenant.created",
              "tenant.updated",
              "tenancy.created",
              "tenancy.updated",
              "tenancy.deleted",
              "repair.created",
              "repair.updated",
              "repair_event.created",
              "repair_event.updated",
              "complaint.created",
              "complaint.updated",
              "case.created",
              "case.updated",
              "appointment.created",
              "appointment.updated",
              "rent_account.created",
              "rent_account.updated",
              "rent_transaction.created",
              "rent_transaction.updated",
              "asb_report.created",
              "asb_report.updated",
              "inspection.created",
              "inspection.updated",
              "void.created",
              "void.updated",
              "compliance_certificate.created",
              "compliance_certificate.updated",
              "document.created",
              "document.updated",
              "notice.created",
              "notice.updated",
              "notice.deleted",
              "checkin.created",
              "checkin.updated"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "livemode": {
            "type": "boolean",
            "description": "False for events from your API sandbox."
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "type": "object",
                "description": "The record after the change, in the same shape the API returns."
              },
              "previous_attributes": {
                "type": "object",
                "description": "For updates: the fields that changed, with their old values."
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request_error",
                  "authentication_error",
                  "permission_error",
                  "rate_limit_error",
                  "idempotency_error",
                  "api_error"
                ]
              },
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string",
                "description": "A message you can show to a person."
              },
              "param": {
                "type": "string",
                "description": "The field the error is about, when there is one."
              },
              "request_id": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "An error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}