{"openapi":"3.0.3","info":{"title":"All Abroad — Landlord Building/Room Feed","version":"1.0","description":"Schema for the JSON feed that a landlord/partner system must serve for All Abroad to import buildings, rooms and availability. All Abroad polls this endpoint and validates the full payload on every sync — if any field fails validation, the whole payload is rejected for that sync (no partial import).\nA full worked example with 10 buildings is available at `samplefeed.json` in the same folder as this file.\n"},"paths":{"/building-feed":{"get":{"summary":"Building & room feed","description":"Replace this path with whatever URL your system exposes; All Abroad calls it with a GET request and an `Accept: application/json` header.\n","responses":{"200":{"description":"Full feed payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuildingFeed"},"example":{"buildings":[{"address_line_1":"123 Example Street","address_line_2":"Flat 2","town_city":"O Carballino","country":"Spain","location":{"lat":42.5167,"lng":-7.6167},"rooms":[{"title":"Large Double Room with En-Suite","gallery":[{"url":"https://example.com/samples/img1.png","alt":"Double bed with oak headboard"},{"url":"https://example.com/samples/img2.png","alt":"Study desk and shelving"}],"description":"<p>A spacious double room with en-suite facilities on the first floor.</p>","monthly_fee":1450,"info":{"room_type":"En-Suite","bedroom_type":"Double","number_of_bedrooms":4,"number_of_bathrooms":2,"suitable_gender":"Any","ensuite":true,"bills_included":true},"facilities":["pool","wifi"],"availability":["2026-07-01","2026-07-02","2026-07-03"]},{"title":"Single Room with Shared Bathroom","gallery":[{"url":"https://example.com/samples/img5.png","alt":"Single bed with storage underneath"}],"description":"<p>A comfortable single room on the ground floor with access to a shared bathroom.</p>","monthly_fee":1100,"info":{"room_type":"Shared Bathroom","bedroom_type":"Single","number_of_bedrooms":4,"number_of_bathrooms":2,"suitable_gender":"Female","ensuite":false},"facilities":["wifi"],"ical_url":"https://example-pms.com/calendars/rooms/9821.ics"}]}]}}}}}}}},"components":{"schemas":{"BuildingFeed":{"type":"object","required":["buildings"],"properties":{"buildings":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Building"}}}},"Building":{"type":"object","description":"Matched and updated in place on re-sync by `id` if you send one (strongly recommended — see below), otherwise by the combination of address_line_1 + address_line_2 + town_city + country. If you don't send `id`, keep those address fields stable between syncs for the same property, or correcting so much as a typo in the town name will be read as a new building and duplicate it.\n","required":["address_line_1","address_line_2","town_city","country","location","rooms"],"properties":{"id":{"type":"string","maxLength":255,"description":"Optional, but strongly recommended. Your own stable identifier for this building. When sent, we match and update this building by `id` on every future sync instead of the address fields, so you're free to correct an address or town name later without it being read as a new building. Sent as a string or number, either is accepted.\n"},"address_line_1":{"type":"string","maxLength":255},"address_line_2":{"type":"string","maxLength":255,"description":"The key must always be present, even with no second line — send an empty string (\"\") rather than omitting the field.\n"},"town_city":{"type":"string","maxLength":255},"country":{"type":"string","maxLength":255},"location":{"$ref":"#/components/schemas/Location"},"rooms":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/Room"}}}},"Location":{"type":"object","required":["lat","lng"],"properties":{"lat":{"type":"number","format":"double","minimum":-90,"maximum":90},"lng":{"type":"number","format":"double","minimum":-180,"maximum":180}}},"Room":{"type":"object","description":"Matched and updated in place on re-sync by `id` if you send one (strongly recommended — see below), otherwise by `title` within its parent building. If you don't send `id`, keep a room's title stable between syncs, or the importer will read it as a new room and create a duplicate instead of updating the existing one — this includes two genuinely different rooms in the same building sharing one title (e.g. both named after the building rather than something room-specific): without an `id` they'll be treated as the same room and overwrite each other.\nExactly one of `availability` or `ical_url` must be provided. Sending both, or neither, fails validation for the whole payload.\n","required":["title","gallery","description","monthly_fee","info"],"properties":{"id":{"type":"string","maxLength":255,"description":"Optional, but strongly recommended, for the same reason as `id` on Building above — matches and updates this room by `id` on every future sync instead of by `title`, so two rooms sharing a title (or a title changing later) can't be confused with each other. Sent as a string or number, either is accepted.\n"},"code":{"type":"string","maxLength":255,"description":"Optional. Your own separate reference for this room, distinct from `id` above — `id` is only used internally to match the room on re-sync and is never shown to anyone; `code` is yours to use however you like and we display it back to you as \"Room code\" on every booking email, so you can use it to match a booking back to your own system (e.g. to know which bank account to send the rent to).\n"},"title":{"type":"string","maxLength":255},"gallery":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/GalleryImage"}},"description":{"type":"string","description":"Free text. HTML tags are accepted and rendered as-is (e.g. <p>...</p>)."},"monthly_fee":{"type":"number","minimum":0,"description":"Major currency unit (e.g. 1450 = €1,450), not cents. The default rate used whenever a stay's length doesn't fall inside any tier below (or when `pricing_tiers` is omitted entirely).\n"},"pricing_tiers":{"type":"array","items":{"$ref":"#/components/schemas/PricingTier"},"description":"Optional. Charge a different monthly rate depending on how long the stay is (e.g. 1-3 months at a higher rate, 4-12 months cheaper). Omit entirely to always charge the flat `monthly_fee` above regardless of stay length.\n"},"info":{"$ref":"#/components/schemas/RoomInfo"},"facilities":{"type":"array","items":{"type":"string","maxLength":255},"description":"Optional. Free-text facility tags, no fixed enum enforced server-side — any tag sent will be created and attached to the room. Reuse the same lowercase, hyphen-free tag for the same facility across all listings (e.g. always \"wifi\", not a mix of \"wifi\" / \"WiFi\" / \"wi-fi\").\n"},"availability":{"type":"array","minItems":1,"items":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"One of two mutually exclusive availability sources (see `ical_url`). Explicit list of dates (YYYY-MM-DD) on which the room is available to book; any date not listed is treated as unavailable. Duplicates are de-duplicated automatically. Stored and applied immediately on that sync.\n"},"ical_url":{"type":"string","format":"uri","maxLength":2048,"description":"One of two mutually exclusive availability sources (see `availability`). URL to a standard iCal (.ics) feed for this room. Any VEVENT is treated as a blocked/booked period; availability is computed as the complement over a rolling 24-month window. Polled on our own schedule (currently every 5 minutes), independently of how often we pull your JSON feed, so it may lag slightly behind a booking rather than updating on the same request. Switching a room from one field to the other on a later sync is supported — the unused field is cleared automatically.\n"}}},"GalleryImage":{"type":"object","required":["url","alt"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"alt":{"type":"string","maxLength":255}}},"PricingTier":{"type":"object","required":["min_months","monthly_rate"],"properties":{"min_months":{"type":"integer","minimum":0,"description":"This tier applies to a stay of at least this many months. Use 0 to include very short stays (under a month).\n"},"max_months":{"type":"integer","minimum":1,"nullable":true,"description":"This tier applies up to and including this many months. Omit (or send null) for an open-ended tier, e.g. \"12+ months\", that applies to every stay at least `min_months` long with no upper bound. Must be greater than or equal to `min_months` if sent.\n"},"monthly_rate":{"type":"number","minimum":0,"description":"Major currency unit (e.g. 1450 = €1,450), not cents."}}},"RoomInfo":{"type":"object","required":["room_type","bedroom_type","number_of_bedrooms","number_of_bathrooms","suitable_gender","ensuite"],"properties":{"room_type":{"type":"string","maxLength":100,"enum":["En-Suite","Shared Bathroom","Studio"],"description":"Describes the bathroom arrangement. Not strictly enforced server-side (free text, max 100 chars) but must be one of these values to render correctly on the site.\n"},"bedroom_type":{"type":"string","maxLength":100,"enum":["Single","Double"],"description":"Describes bed/room occupancy. Not strictly enforced server-side (free text, max 100 chars) but must be one of these values to render correctly on the site.\n"},"number_of_bedrooms":{"type":"integer","minimum":0,"description":"The total number of bedrooms in the whole flat/building this room belongs to — not a count for this individual room. Send the same value on every room that shares the flat.\n"},"number_of_bathrooms":{"type":"integer","minimum":0,"description":"The total number of bathrooms in the whole flat/building this room belongs to — not a count for this individual room. Send the same value on every room that shares the flat.\n"},"suitable_gender":{"type":"string","enum":["Any","Male","Female"],"description":"Strictly validated, exact case."},"ensuite":{"type":"boolean","description":"Whether this room has its own private (en-suite) bathroom."},"bills_included":{"type":"boolean","description":"Optional. Overrides this room's \"all bills included\" wording, regardless of your account's default setting. Omit to inherit your account default."}}}}}}