{
  "openapi": "3.1.0",
  "info": {
    "title": "Band availability",
    "version": "1.0.0",
    "description": "Public, read-only availability for bands on this site. Returns only the free dates the public booking page already shows. No booking, client or financial details are included."
  },
  "servers": [ { "url": "https://www.hopandhazlewood.com" } ],
  "paths": {
    "/availability.json": {
      "get": {
        "operationId": "getBandAvailability",
        "summary": "Find out whether a band is free on a date, or list its free dates in a range",
        "parameters": [
          { "name": "band", "in": "query", "required": true, "description": "Band name (e.g. Defunked) or band id.", "schema": { "type": "string" } },
          { "name": "date", "in": "query", "required": false, "description": "Single date to check (YYYY-MM-DD). Sets isFreeOnRequestedDate.", "schema": { "type": "string", "format": "date" } },
          { "name": "from", "in": "query", "required": false, "description": "Range start (YYYY-MM-DD). Defaults to today.", "schema": { "type": "string", "format": "date" } },
          { "name": "to", "in": "query", "required": false, "description": "Range end (YYYY-MM-DD). Defaults to 90 days after from. Maximum range is 366 days.", "schema": { "type": "string", "format": "date" } }
        ],
        "responses": {
          "200": {
            "description": "Availability for the band",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site": { "type": "string" },
                    "bandId": { "type": "string", "format": "uuid" },
                    "bandName": { "type": "string" },
                    "from": { "type": "string", "format": "date-time" },
                    "to": { "type": "string", "format": "date-time" },
                    "isFreeOnRequestedDate": { "type": ["boolean", "null"], "description": "Only set when a single date was requested." },
                    "freeDates": { "type": "array", "items": { "type": "string", "format": "date" } },
                    "note": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "description": "Invalid band, date or range" },
          "404": { "description": "Band or site not found" }
        }
      }
    }
  }
}