{
  "openapi": "3.1.0",
  "info": {
    "title": "Local Property Directory read-only API",
    "version": "1.0.0",
    "description": "Preview is private and protected by site access. Contacts are published, not delivery-tested; location does not imply coverage. Mutations and private review data are intentionally excluded."
  },
  "servers": [
    {
      "url": "https://local-property-directory.gusto37.chatgpt.site"
    }
  ],
  "paths": {
    "/api/v1/agents": {
      "get": {
        "operationId": "searchAgents",
        "summary": "Search recorded branch listings; not proximity or inferred coverage",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "area",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "postcode_prefix",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 8
            }
          },
          {
            "name": "service",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sales",
                "lettings",
                "property-management"
              ]
            }
          },
          {
            "name": "contact",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "phone",
                "email"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "agency",
                "specialist"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published source-led directory data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Site authentication required"
          }
        }
      }
    },
    "/api/v1/areas": {
      "get": {
        "operationId": "listAreas",
        "responses": {
          "200": {
            "description": "Published source-led directory data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Site authentication required"
          }
        }
      }
    },
    "/api/v1/agents/{id}": {
      "get": {
        "operationId": "getAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^GM-EA-\\d{4}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published source-led directory data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Site authentication required"
          }
        }
      }
    },
    "/api/v1/agents/{id}.md": {
      "get": {
        "operationId": "getAgentMarkdown",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Source-linked Markdown profile",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/compare": {
      "get": {
        "operationId": "compareAgents",
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "One to four comma-separated stable IDs"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published source-led directory data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input"
          },
          "401": {
            "description": "Site authentication required"
          }
        }
      }
    }
  }
}
