{
 "openapi": "3.1.0",
 "info": {
  "title": "Singroost public API",
  "version": "1.0.0",
  "summary": "Student accommodation in Singapore: residences, rooms, prices, fees, FAQ and booking requests.",
  "description": "Read-only public data from the Singroost website (the same values the pages show), plus the public booking-request form. No authentication. Please cache (ETag supported) and keep requests modest. Every website page is also available as Markdown by adding .md to its address. An MCP server for AI assistants is at /mcp.",
  "contact": {
   "name": "Singroost",
   "url": "https://www.singroost.sg/contact"
  }
 },
 "servers": [
  {
   "url": "https://www.singroost.sg"
  }
 ],
 "externalDocs": {
  "description": "Summary for AI assistants (llms.txt)",
  "url": "https://www.singroost.sg/llms.txt"
 },
 "paths": {
  "/data/rooms.json": {
   "get": {
    "operationId": "listRooms",
    "summary": "Every published residence, room type and room",
    "description": "Residences with room types and from-prices; rooms with facts, monthly rent by lease length, availability (available-now; available from a month within 90 days; coming, with the month when known), photos and page URLs.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/public/catalog": {
   "get": {
    "operationId": "getCatalog",
    "summary": "Compact public catalog (residences, room types, amenities, commute)",
    "parameters": [
     {
      "name": "channel",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "website",
        "app",
        "mini"
       ],
       "default": "website"
      },
      "description": "Channel view"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/public/properties/{slug}": {
   "get": {
    "operationId": "getResidence",
    "summary": "One residence by slug",
    "parameters": [
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/public/fees": {
   "get": {
    "operationId": "getFees",
    "summary": "Registration fee, deposits, stamp duty, payment plans, other fees and what the rent includes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/public/faq": {
   "get": {
    "operationId": "listFaq",
    "summary": "Published frequently asked questions",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "question": {
              "type": "string"
             },
             "answer": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/booking-plans": {
   "get": {
    "operationId": "getPaymentPlans",
    "summary": "Payment plans allowed for a lease length",
    "parameters": [
     {
      "name": "months",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer",
       "minimum": 3,
       "maximum": 36
      },
      "description": "Lease length in whole months"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/booking-price": {
   "get": {
    "operationId": "getPriceQuote",
    "summary": "Price estimate for one room, move-in date, lease length and plan",
    "parameters": [
     {
      "name": "room",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "rooms[].id from /data/rooms.json"
     },
     {
      "name": "start",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Move-in date (YYYY-MM-DD, today or later)"
     },
     {
      "name": "months",
      "in": "query",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Lease length in months"
     },
     {
      "name": "plan",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Plan id from /api/booking-plans"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/booking-request": {
   "post": {
    "operationId": "submitBookingRequest",
    "summary": "Send a booking request for a student (only with the student's consent)",
    "description": "GET this address first to receive the session cookie. A request is not a booking: Singroost confirms by email to the student. Limits: 5 accepted requests per session, 20 per IP address per hour. Available only while online booking is open.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "schemaVersion",
         "idempotencyKey",
         "room",
         "start",
         "months",
         "name",
         "email",
         "phoneCountry",
         "phone",
         "channel",
         "contactConsent",
         "passport"
        ],
        "properties": {
         "schemaVersion": {
          "const": 4
         },
         "idempotencyKey": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{20,80}$"
         },
         "room": {
          "type": "string"
         },
         "start": {
          "type": "string",
          "format": "date"
         },
         "months": {
          "type": "integer"
         },
         "plan": {
          "type": "string"
         },
         "name": {
          "type": "string"
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "phoneCountry": {
          "type": "string",
          "example": "SG"
         },
         "phone": {
          "type": "string"
         },
         "channel": {
          "const": "email"
         },
         "contactConsent": {
          "const": true
         },
         "femaleEligibilityConfirmed": {
          "type": "boolean"
         },
         "passport": {
          "type": "object",
          "properties": {
           "name": {
            "type": "string"
           },
           "mime": {
            "type": "string"
           },
           "data": {
            "type": "string",
            "contentEncoding": "base64"
           }
          }
         },
         "note": {
          "type": "string",
          "maxLength": 500
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "409": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "operationId": "mcp",
    "summary": "Model Context Protocol server (JSON-RPC 2.0, Streamable HTTP, JSON responses)",
    "description": "Tools: search_rooms, get_room, list_residences, get_fees, get_payment_plans, get_price_quote, list_faq, get_page, how_to_book.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "Notification accepted"
     }
    }
   }
  }
 }
}