{"openapi":"3.1.0","info":{"title":"HutSnag trails API","version":"1.1","contact":{"name":"HutSnag","url":"https://www.hutsnag.com/contact","email":"tom@hutsnag.com"},"description":"Read-only trail guides, stays, sample itineraries and the latest observed hut availability. Availability is an observation of each booking system, not a reservation: confirm a night with the hut or its booking site. For itineraries searched against live beds, use the MCP server at /mcp."},"servers":[{"url":"https://www.hutsnag.com/api/v1"}],"security":[],"externalDocs":{"description":"MCP, authentication and availability semantics","url":"https://www.hutsnag.com/docs/mcp"},"paths":{"/trails":{"get":{"operationId":"listTrails","summary":"Trails with collected data","description":"Discover supported trail IDs, seasons and guide links before requesting a route. Planning coverage is wider than cancellation-alert coverage; use the list_alert_routes MCP tool for alerts.","responses":{"200":{"description":"Trails and links to their pages and data.","content":{"application/json":{"schema":{"type":"object","properties":{"trails":{"type":"array","items":{"$ref":"#/components/schemas/TrailSummary"}}}}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trails/{route}":{"get":{"operationId":"getTrailGuide","summary":"A trail guide","description":"Read the mapped stages, route variants, accommodation, access and booking rules. This describes the trail; use dated availability or the MCP planner before proposing bookable nights.","parameters":[{"name":"route","in":"path","required":true,"description":"Trail id from /trails, such as tmb.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,40}$"}}],"responses":{"200":{"description":"Totals, stages, elevation profile and line, variants, buses and lifts, stays in route order, booking rules and sources.","content":{"application/json":{"schema":{"type":"object","description":"Trail guide","additionalProperties":true}}}},"404":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trails/{route}/availability":{"get":{"operationId":"getTrailAvailability","summary":"Night states for every stay on a trail","description":"Query an inclusive window for the entire party. Missing night keys mean no observation, never sold out. Check each stay observation time and booking method. Departure permits are separate from hut nights.","parameters":[{"name":"route","in":"path","required":true,"description":"Trail id from /trails, such as tmb.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,40}$"}},{"name":"start","in":"query","description":"First night, YYYY-MM-DD. Defaults to today.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last night, YYYY-MM-DD, at most 93 nights after start inclusive. Defaults to 30 days after start.","schema":{"type":"string","format":"date"}},{"name":"party","in":"query","description":"People needing places; nights with fewer published places read as full.","schema":{"type":"integer","minimum":1,"maximum":20,"default":2}}],"responses":{"200":{"description":"Stays with nightly states and, on permit routes, a separate permits list of dated departure requirements. A departure pass does not reserve a walk-in hut bunk.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NightWindow"}}}},"400":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trails/{route}/itineraries/{days}":{"get":{"operationId":"getSampleItinerary","summary":"A sample itinerary for a reviewed trip length","description":"Retrieve an illustrative itinerary, not a custom search or a reservation. Use the lengths advertised in itineraryDays. For fitness, transport and flexible-date constraints use plan_itinerary over MCP.","parameters":[{"name":"route","in":"path","required":true,"description":"Trail id from /trails, such as tmb.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,40}$"}},{"name":"days","in":"path","required":true,"description":"Trip length in days; the trail lists its reviewed lengths in itineraryDays.","schema":{"type":"integer","minimum":2,"maximum":30}}],"responses":{"200":{"description":"The best-fit plan assuming a bed at every stay, its days and elevation profile, and the coming start dates on which that chain of stays has beds.","content":{"application/json":{"schema":{"type":"object","description":"Sample itinerary","additionalProperties":true}}}},"404":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/huts":{"get":{"operationId":"listHuts","summary":"Every hut, campsite and lodge on a collected trail","description":"Discover stable stay slugs and the trails each belongs to. The live flag means a calendar is monitored, not that a requested night is available.","responses":{"200":{"description":"Stays with their location, trails and links.","content":{"application/json":{"schema":{"type":"object","properties":{"huts":{"type":"array","items":{"$ref":"#/components/schemas/StaySummary"}}}}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/huts/{slug}":{"get":{"operationId":"getHut","summary":"One stay across the trails it is on","description":"Read accommodation facts, booking sources, route neighbours and recent night observations. Confirm bookings with the original provider; a missing count is not a reserved bed.","parameters":[{"name":"slug","in":"path","required":true,"description":"Stay slug from /huts, such as refugio-grey.","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,80}$"}}],"responses":{"200":{"description":"Every reviewed fact, ways to book, neighbours on each trail and observed nights from today.","content":{"application/json":{"schema":{"type":"object","description":"Stay","additionalProperties":true}}}},"404":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"An error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Night":{"type":"object","required":["status","remaining","exact"],"properties":{"status":{"type":"string","enum":["available","full","closed","unknown","walk_in"]},"remaining":{"type":["integer","null"],"minimum":0,"description":"Published places if known. Null is not zero."},"exact":{"type":"boolean","description":"Whether the source gives an exact count."},"bookingUrl":{"type":["string","null"],"format":"uri"}}},"NightWindow":{"type":"object","required":["route","start","end","party","stays"],"properties":{"route":{"type":"string"},"start":{"type":"string","format":"date"},"end":{"type":"string","format":"date"},"party":{"type":"integer","minimum":1,"maximum":20},"observedAt":{"type":["string","null"],"format":"date-time"},"stays":{"type":"array","items":{"type":"object","required":["id","name","nights"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"observedAt":{"type":["string","null"],"format":"date-time"},"booking":{"type":"object","description":"Original booking source and booking method. Walk-in bunks cannot be reserved.","additionalProperties":true},"nights":{"type":"object","description":"ISO date keys. Absent dates have no observation; never infer zero places.","additionalProperties":{"$ref":"#/components/schemas/Night"}}}}},"permits":{"type":"array","description":"Separate departure-date requirements; not overnight hut inventory.","items":{"allOf":[{"$ref":"#/components/schemas/Night"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"date":{"type":"string","format":"date"},"observedAt":{"type":["string","null"],"format":"date-time"},"note":{"type":["string","null"]}}}]}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["bad_request","not_found","unavailable"]},"message":{"type":"string"}}}}},"TrailSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortName":{"type":"string"},"region":{"type":"string"},"countries":{"type":"array","items":{"type":"string"}},"shape":{"type":"string","enum":["loop","linear"]},"distanceKm":{"type":["number","null"]},"ascentM":{"type":["number","null"]},"stays":{"type":"integer"},"defaultDays":{"type":["integer","null"]},"itineraryDays":{"type":"array","items":{"type":"integer"}},"observedAt":{"type":["string","null"],"format":"date-time"},"links":{"type":"object","additionalProperties":true}}},"StaySummary":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"area":{"type":["string","null"]},"country":{"type":["string","null"]},"altitudeM":{"type":["number","null"]},"coordinates":{"type":["array","null"],"description":"[longitude, latitude]","items":{"type":"number"}},"routes":{"type":"array","items":{"type":"string"}},"live":{"type":"boolean","description":"HutSnag reads this stay's booking calendar."},"indexable":{"type":"boolean"},"links":{"type":"object","additionalProperties":true}}}}}}