{
  "openapi": "3.1.0",
  "info": {
    "title": "Búzios Homes public API",
    "version": "1.0.0",
    "description": "Minimal public API of buzios.homes (vacation rentals in Armação dos Búzios, Brazil). Booking itself happens at https://booking.buzios.homes. VERSIONING: the API is v1 (implicit); every response carries an API-Version header; breaking changes would ship under /api/v2/ with old paths kept for 6 months and announced via a Deprecation header and in /llms.txt. ERRORS: every 4xx/5xx is application/problem+json (RFC 9457) with type, title, status, plus error, message and hint. RATE LIMITS: responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; a 429 adds Retry-After.",
    "contact": {
      "email": "contato@buzios.homes"
    }
  },
  "servers": [
    {
      "url": "https://buzios.homes/api/v1",
      "description": "Versioned base (v1, canonical)"
    },
    {
      "url": "https://buzios.homes",
      "description": "Unversioned alias of v1"
    }
  ],
  "paths": {
    "/contact/": {
      "post": {
        "operationId": "sendContactMessage",
        "summary": "Send a message to the hosts (email to contato@buzios.homes)",
        "description": "Rate limited to 5 requests per 10 minutes per IP. Returns 429 with JSON body when exceeded.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "dates": {
                    "type": "string",
                    "description": "Desired dates, free text"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 5000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            },
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/APIVersion"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/JsonError"
          },
          "429": {
            "description": "Rate limited (5/10min per IP)",
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/RetryAfter"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/JsonError"
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "Client-generated key; retries with the same key within 24h return ok without sending a duplicate email."
          }
        ]
      }
    },
    "/health/sync/": {
      "get": {
        "operationId": "getSyncHealth",
        "summary": "Freshness of availability/pricing data",
        "description": "200 while calendar data was synced from the PMS within the last 45 minutes; 503 when stale.",
        "responses": {
          "200": {
            "description": "Fresh",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncHealth"
                }
              }
            }
          },
          "503": {
            "description": "Stale",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncHealth"
                }
              }
            }
          }
        }
      }
    },
    "/md/{path}": {
      "get": {
        "operationId": "getMarkdownVariant",
        "summary": "Markdown variant of a page",
        "description": "Same content served when requesting a main page with Accept: text/markdown.",
        "parameters": [
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Caminho original codificado, ex.: acomodacoes ou acomodacoes/{slug}; /md/ sozinho = home"
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/JsonError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "JsonError": {
        "description": "Structured error (RFC 9457)",
        "headers": {
          "API-Version": {
            "$ref": "#/components/headers/APIVersion"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "SyncHealth": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "calendar": {
            "type": "object",
            "properties": {
              "lastOkMinutesAgo": {
                "type": "number"
              },
              "maxMinutes": {
                "type": "number"
              }
            }
          },
          "full": {
            "type": "object",
            "properties": {
              "lastOkMinutesAgo": {
                "type": "number"
              },
              "maxMinutes": {
                "type": "number"
              }
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details, extended with error/message/hint",
        "required": [
          "type",
          "title",
          "status",
          "error"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "examples": [
              "about:blank"
            ]
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "error": {
            "type": "string",
            "description": "Machine-readable code"
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          },
          "hint": {
            "type": "string",
            "description": "How to resolve"
          }
        }
      }
    },
    "headers": {
      "APIVersion": {
        "schema": {
          "type": "string"
        },
        "description": "Current API version (1)"
      },
      "RateLimitLimit": {
        "schema": {
          "type": "string"
        },
        "description": "Requests allowed in the window"
      },
      "RateLimitRemaining": {
        "schema": {
          "type": "string"
        },
        "description": "Requests left in the window"
      },
      "RateLimitReset": {
        "schema": {
          "type": "string"
        },
        "description": "Seconds until the window resets"
      },
      "RetryAfter": {
        "schema": {
          "type": "string"
        },
        "description": "Seconds to wait before retrying (on 429)"
      }
    }
  }
}