{
  "openapi": "3.1.1",
  "info": {
    "title": "MyKii API",
    "version": "1.0.0",
    "description": "Connect your website or integration to MyKii. List properties, manage contacts and favourites, and submit viewing and valuation requests. Send `Accept: application/json` with each request."
  },
  "servers": [
    {
      "url": "https://mykii.io/api",
      "description": "MyKii production API"
    }
  ],
  "security": [
    {
      "TenantToken": []
    }
  ],
  "tags": [
    {
      "name": "Properties"
    },
    {
      "name": "Lookups"
    },
    {
      "name": "Bookings"
    },
    {
      "name": "Contacts"
    },
    {
      "name": "Meetings"
    },
    {
      "name": "Buyer preferences"
    }
  ],
  "paths": {
    "/properties": {
      "get": {
        "operationId": "listProperties",
        "tags": [
          "Properties"
        ],
        "summary": "List published properties",
        "description": "Returns a paginated list. The property records are in data.data.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Results per page. Unsupported values fall back to 15.",
            "schema": {
              "type": "integer",
              "enum": [
                9,
                12,
                15,
                24
              ],
              "default": 15
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Contact ID used to populate the liked field.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search by property name or slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "featured",
            "in": "query",
            "required": false,
            "description": "Return featured properties when true.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minPrice",
            "in": "query",
            "required": false,
            "description": "Minimum asking price.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "maxPrice",
            "in": "query",
            "required": false,
            "description": "Maximum asking price. The value 1000000 leaves the upper bound open.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "parish",
            "in": "query",
            "required": false,
            "description": "Parish ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated review stage IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "sale_types",
            "in": "query",
            "required": false,
            "description": "Comma-separated sale type IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "property_types",
            "in": "query",
            "required": false,
            "description": "Comma-separated property type IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "property_amenities",
            "in": "query",
            "required": false,
            "description": "Comma-separated amenity IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "property_purposes",
            "in": "query",
            "required": false,
            "description": "Comma-separated property purpose IDs.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer"
              }
            },
            "style": "form",
            "explode": false
          },
          {
            "name": "bedrooms_min",
            "in": "query",
            "required": false,
            "description": "Minimum number of bedrooms.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "bedrooms_max",
            "in": "query",
            "required": false,
            "description": "Maximum number of bedrooms.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "bathrooms_min",
            "in": "query",
            "required": false,
            "description": "Minimum number of bathrooms.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "bathrooms_max",
            "in": "query",
            "required": false,
            "description": "Maximum number of bathrooms.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "receptions_min",
            "in": "query",
            "required": false,
            "description": "Minimum number of receptions.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "receptions_max",
            "in": "query",
            "required": false,
            "description": "Maximum number of receptions.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "parking_min",
            "in": "query",
            "required": false,
            "description": "Minimum number of parking.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "parking_max",
            "in": "query",
            "required": false,
            "description": "Maximum number of parking.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sortByValue",
            "in": "query",
            "required": false,
            "description": "Sort by asking price.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "sortByLatest",
            "in": "query",
            "required": false,
            "description": "Sort by date added.",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of published properties.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Property"
                          }
                        },
                        "current_page": {
                          "type": "integer"
                        },
                        "last_page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        },
                        "first_page_url": {
                          "type": "string"
                        },
                        "last_page_url": {
                          "type": "string"
                        },
                        "next_page_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "prev_page_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "data",
                        "current_page",
                        "last_page",
                        "per_page",
                        "total"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "data": [
                      {
                        "id": 101,
                        "name": "Example House",
                        "slug": "example-house",
                        "price": 425000,
                        "bedrooms": 3,
                        "bathrooms": 2,
                        "liked": false,
                        "is_featured": false
                      }
                    ],
                    "current_page": 1,
                    "last_page": 1,
                    "per_page": 15,
                    "total": 1
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/properties/{slug}": {
      "get": {
        "operationId": "getProperty",
        "tags": [
          "Properties"
        ],
        "summary": "Get a property",
        "description": "Look up a property by its slug or numeric ID.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The property slug or numeric ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Contact ID used to populate the liked field.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Property details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Property"
                    },
                    "next": {
                      "type": "string",
                      "description": "Slug of the next property, when available."
                    },
                    "previous": {
                      "type": "string",
                      "description": "Slug of the previous property, when available."
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 101,
                    "name": "Example House",
                    "slug": "example-house",
                    "price": 425000,
                    "bedrooms": 3,
                    "bathrooms": 2,
                    "liked": false,
                    "is_featured": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/properties/watchlist/{slug}/update": {
      "post": {
        "operationId": "togglePropertyWatchlist",
        "tags": [
          "Properties"
        ],
        "summary": "Toggle a favourite",
        "description": "Adds or removes this property from the contact’s watchlist. A repeated request reverses the previous change.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The property slug.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id"
                ]
              },
              "example": {
                "id": 42
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The resulting favourite status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "liked": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "liked"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "You have liked this property.",
                  "data": {
                    "liked": true
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/properties/brochure/{slug}/download": {
      "get": {
        "operationId": "getPropertyBrochure",
        "tags": [
          "Properties"
        ],
        "summary": "Get a property brochure",
        "description": "Generates a PDF brochure and returns its download URL and file metadata.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The property slug.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Brochure metadata and URL.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer"
                        },
                        "file_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "encoding": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "path",
                        "size",
                        "file_url",
                        "encoding",
                        "name"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "path": "/tmp/example-house.pdf",
                    "size": 12345,
                    "file_url": "https://files.example.com/example-house.pdf",
                    "encoding": "application/pdf",
                    "name": "example-house.pdf"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/helpers/properties": {
      "post": {
        "operationId": "getPropertyLookups",
        "tags": [
          "Lookups"
        ],
        "summary": "Get property lookup values",
        "description": "Returns the requested lookup lists keyed by name. Use their IDs when filtering properties.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "required_data": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "property_types",
                        "sale_types",
                        "property_amenities",
                        "parishes",
                        "property_purposes"
                      ]
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "required_data"
                ]
              },
              "example": {
                "required_data": [
                  "property_types"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The requested lookup lists.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "property_types": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "sale_types": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "property_amenities": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "parishes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "property_purposes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "property_types": [
                      {
                        "id": 1,
                        "title": "House"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/properties/{property}/book-viewing": {
      "post": {
        "operationId": "requestViewing",
        "tags": [
          "Bookings"
        ],
        "summary": "Request a property viewing",
        "description": "Submits preferred viewing times for the property.",
        "parameters": [
          {
            "name": "property",
            "in": "path",
            "required": true,
            "description": "The property ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "Include the international dialling code."
                  },
                  "selected_days": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RequestedSlot"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "name",
                  "email",
                  "phone_number",
                  "selected_days"
                ]
              },
              "example": {
                "name": "Example Contact",
                "email": "contact@example.com",
                "phone_number": "+442079460123",
                "selected_days": [
                  {
                    "day_of_week": "Monday",
                    "date_value": "11/01/2027 10:00:00",
                    "start_time": "10:00",
                    "end_time": "11:00"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The viewing request was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "You have scheduled a booking for this property.",
                  "data": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/properties/book-valuation": {
      "post": {
        "operationId": "requestValuation",
        "tags": [
          "Bookings"
        ],
        "summary": "Request a valuation",
        "description": "Submits the property address and preferred valuation times.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "Include the international dialling code."
                  },
                  "selected_days": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RequestedSlot"
                    },
                    "minItems": 1
                  },
                  "address": {
                    "type": "object",
                    "properties": {
                      "address_1": {
                        "type": "string"
                      },
                      "address_2": {
                        "type": "string"
                      },
                      "address_3": {
                        "type": "string"
                      },
                      "parish": {
                        "type": "string"
                      },
                      "postcode": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "address_1",
                      "postcode"
                    ]
                  },
                  "listing_type": {
                    "type": "integer",
                    "description": "A valid listing type ID for the workspace."
                  }
                },
                "required": [
                  "name",
                  "email",
                  "phone_number",
                  "selected_days",
                  "address",
                  "listing_type"
                ]
              },
              "example": {
                "name": "Example Contact",
                "email": "contact@example.com",
                "phone_number": "+442079460123",
                "selected_days": [
                  {
                    "day_of_week": "Monday",
                    "date_value": "11/01/2027 10:00:00",
                    "start_time": "10:00",
                    "end_time": "11:00"
                  }
                ],
                "address": {
                  "address_1": "1 Example Road",
                  "postcode": "JE1 1AA"
                },
                "listing_type": 1
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The valuation request was recorded. The response body is empty."
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact": {
      "post": {
        "operationId": "createContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Create a contact",
        "description": "Creates a contact. Use the returned ID for contact-specific requests.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email"
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Include the international dialling code."
                  }
                },
                "required": [
                  "name"
                ]
              },
              "example": {
                "name": "Example Contact",
                "email": "contact@example.com",
                "phone": "+442079460123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The created contact.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "id": 42,
                    "name": "Example Contact",
                    "email": "contact@example.com",
                    "phone_number": "+442079460123"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/sync": {
      "post": {
        "operationId": "syncContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Synchronise a contact",
        "description": "Creates or updates a contact by email address. Include the name and phone number to retain them on update.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Include the international dialling code."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "name": "Example Contact",
                "email": "contact@example.com",
                "phone": "+442079460123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The saved contact.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Contact"
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "id": 42,
                    "name": "Example Contact",
                    "email": "contact@example.com",
                    "phone_number": "+442079460123"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/properties": {
      "get": {
        "operationId": "listContactProperties",
        "tags": [
          "Contacts"
        ],
        "summary": "List a contact’s properties",
        "description": "Returns properties associated with the contact.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contact’s properties.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Property"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": [
                    {
                      "id": 101,
                      "name": "Example House",
                      "slug": "example-house",
                      "price": 425000,
                      "bedrooms": 3,
                      "bathrooms": 2,
                      "liked": false,
                      "is_featured": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/properties/{slug}/show": {
      "get": {
        "operationId": "getContactProperty",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact’s property",
        "description": "Returns a property associated with the contact, identified by slug.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The property slug.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested property.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Property"
                    },
                    "next": {
                      "type": "string",
                      "description": "Slug of the next property, when available."
                    },
                    "previous": {
                      "type": "string",
                      "description": "Slug of the previous property, when available."
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 101,
                    "name": "Example House",
                    "slug": "example-house",
                    "price": 425000,
                    "bedrooms": 3,
                    "bathrooms": 2,
                    "liked": false,
                    "is_featured": false
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/properties/favorited": {
      "get": {
        "operationId": "listContactFavourites",
        "tags": [
          "Contacts"
        ],
        "summary": "List a contact’s favourites",
        "description": "Returns properties on the contact’s watchlist.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of properties returned.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The saved properties.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Property"
                      }
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": [
                    {
                      "id": 101,
                      "name": "Example House",
                      "slug": "example-house",
                      "price": 425000,
                      "bedrooms": 3,
                      "bathrooms": 2,
                      "liked": false,
                      "is_featured": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/property/property-edits": {
      "post": {
        "operationId": "requestPropertyEdits",
        "tags": [
          "Contacts"
        ],
        "summary": "Request property edits",
        "description": "Submits a property edit for review. Send the full current editable property details with the proposed changes to preserve omitted values.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "bedrooms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "bathrooms": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "receptions": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "parking": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "sale_type_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "property_type_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "property_purpose_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "property_amenities": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "property_features": {
                    "type": [
                      "array",
                      "object"
                    ]
                  },
                  "energy_rating": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "size": {
                    "type": [
                      "number",
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The edit request was recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "Your request is being processed",
                  "data": []
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/meetings": {
      "get": {
        "operationId": "listContactMeetings",
        "tags": [
          "Meetings"
        ],
        "summary": "List a contact’s meetings",
        "description": "Returns matching events and meeting types.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matching events and meeting types.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Meeting"
                          }
                        },
                        "eventTypes": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      },
                      "required": [
                        "events",
                        "eventTypes"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "message",
                    "data"
                  ]
                },
                "example": {
                  "success": true,
                  "message": "",
                  "data": {
                    "events": [],
                    "eventTypes": []
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contact/{contact}/buy-preference": {
      "get": {
        "operationId": "getBuyerPreferences",
        "tags": [
          "Buyer preferences"
        ],
        "summary": "Get a contact’s buyer preferences",
        "description": "Returns the contact’s preferences and initialises a preference record if needed.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The buyer preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BuyerPreference"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 5,
                    "preferenceable_id": 42,
                    "price_min": 250000,
                    "bedrooms_min": 2
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "operationId": "updateBuyerPreferences",
        "tags": [
          "Buyer preferences"
        ],
        "summary": "Update a contact’s buyer preferences",
        "description": "Call GET first for a new contact. Send the full set of preferences to retain. Unspecified fields may be cleared.",
        "parameters": [
          {
            "name": "contact",
            "in": "path",
            "required": true,
            "description": "The contact ID.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "price_min": {
                    "type": [
                      "number",
                      "string",
                      "null"
                    ]
                  },
                  "price_max": {
                    "type": [
                      "number",
                      "string",
                      "null"
                    ]
                  },
                  "bedrooms_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "bedrooms_max": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "bathrooms_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "bathrooms_max": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "receptions_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "receptions_max": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "parking_min": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "parking_max": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "sale_type_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "property_purpose_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "listing_type_id": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "property_types": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "property_amenities": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                }
              },
              "example": {
                "price_min": 250000,
                "bedrooms_min": 2,
                "property_types": [
                  1
                ],
                "property_amenities": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated buyer preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BuyerPreference"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": 5,
                    "preferenceable_id": 42,
                    "price_min": 250000,
                    "bedrooms_min": 2
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/MissingToken"
          },
          "403": {
            "$ref": "#/components/responses/InvalidToken"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "TenantToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "Create an API token in your MyKii workspace under **Settings → API Tokens**. Select the appropriate permissions and store the token securely on your server. Send it as `Authorization: Bearer YOUR_API_TOKEN`. Include `Content-Type: application/json` when sending a JSON body.\n\n```sh\ncurl https://mykii.io/api/properties \\\n  -H \"Authorization: Bearer YOUR_API_TOKEN\" \\\n  -H \"Accept: application/json\"\n```"
      }
    },
    "schemas": {
      "Property": {
        "type": "object",
        "description": "Common property fields. Additional fields and loaded relationships vary by endpoint.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "string",
              "null"
            ]
          },
          "valuation": {
            "type": [
              "number",
              "string",
              "null"
            ]
          },
          "bedrooms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bathrooms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "receptions": {
            "type": [
              "integer",
              "null"
            ]
          },
          "parking": {
            "type": [
              "integer",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "object",
              "null"
            ]
          },
          "property_images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "property_floorplans": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "property_videos": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "stage_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "liked": {
            "type": "boolean"
          },
          "is_featured": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "slug"
        ]
      },
      "Contact": {
        "type": "object",
        "description": "Common fields in the returned contact record.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone_number": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ]
      },
      "Meeting": {
        "type": "object",
        "description": "Meeting times use YYYY-MM-DD HH:mm.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "start": {
            "type": "string"
          },
          "end": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "meeting_type_id": {
            "type": "integer"
          },
          "meeting_type": {
            "type": "object"
          },
          "class": {
            "type": "string"
          },
          "duration": {
            "type": "integer"
          },
          "properties": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "RequestedSlot": {
        "type": "object",
        "properties": {
          "day_of_week": {
            "type": "string"
          },
          "date_value": {
            "type": "string",
            "description": "Date and time of the requested slot in DD/MM/YYYY HH:mm:ss format."
          },
          "start_time": {
            "type": "string"
          },
          "end_time": {
            "type": "string"
          }
        },
        "required": [
          "day_of_week",
          "date_value",
          "start_time",
          "end_time"
        ]
      },
      "BuyerPreference": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "preferenceable_id": {
            "type": "integer"
          },
          "price_min": {
            "type": [
              "number",
              "string",
              "null"
            ]
          },
          "price_max": {
            "type": [
              "number",
              "string",
              "null"
            ]
          },
          "bedrooms_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bedrooms_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bathrooms_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bathrooms_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "receptions_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "receptions_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "parking_min": {
            "type": [
              "integer",
              "null"
            ]
          },
          "parking_max": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sale_type_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "property_purpose_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "listing_type_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sale_type": {
            "type": [
              "object",
              "null"
            ]
          },
          "property_purpose": {
            "type": [
              "object",
              "null"
            ]
          },
          "property_types": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "property_amenities": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        },
        "required": [
          "id"
        ]
      }
    },
    "responses": {
      "MissingToken": {
        "description": "An API token is required.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      },
      "InvalidToken": {
        "description": "The token was not recognised.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource was not found.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      },
      "ValidationError": {
        "description": "One or more request fields failed validation.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "errors": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      },
      "RateLimited": {
        "description": "The API rate limit of 240 requests per minute was exceeded.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              },
              "required": [
                "message"
              ]
            }
          }
        }
      }
    }
  }
}
