{
  "openapi": "3.0.3",
  "info": {
    "title": "Make My Plan API",
    "description": "Public read-only facts about Make My Plan, the AI goal planner. No API key is required.",
    "version": "1.0.0",
    "contact": {
      "name": "Praneet Brar",
      "email": "praneetbrar7@gmail.com",
      "url": "https://makemyplan.net/contact"
    }
  },
  "servers": [
    { "url": "https://makemyplan.net" }
  ],
  "paths": {
    "/api/v1/site": {
      "get": {
        "operationId": "getSite",
        "summary": "Read public site facts",
        "description": "Returns the public name, summary, contact email, and canonical links for Make My Plan. Authentication is not required.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Optional hint for a public page slug. The site payload is unchanged; use getPage to read one page.",
            "schema": {
              "type": "string",
              "enum": ["home", "documentation", "make-it-yours", "custom", "about", "contact", "docs", "developers"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public site facts",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Site" }
              }
            }
          },
          "404": {
            "description": "No API resource at this path",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          },
          "405": {
            "description": "Only GET is allowed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/v1/pages/{slug}": {
      "get": {
        "operationId": "getPage",
        "summary": "Read one public page",
        "description": "Returns the title and canonical URL for one published Make My Plan page. Authentication is not required.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public page slug, such as home or documentation.",
            "schema": {
              "type": "string",
              "enum": ["home", "custom", "grab-opportunity", "documentation", "make-it-yours", "privacy-policy", "terms-of-service", "license", "about", "contact", "developers", "docs", "cli"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One public page",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Page" }
              }
            }
          },
          "404": {
            "description": "Unknown page slug",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          },
          "405": {
            "description": "Only GET is allowed",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Site": {
        "type": "object",
        "required": ["name", "description", "url"],
        "properties": {
          "name": { "type": "string" },
          "description": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "contactEmail": { "type": "string", "format": "email" },
          "docs": { "type": "string", "format": "uri" },
          "openapi": { "type": "string", "format": "uri" },
          "llms": { "type": "string", "format": "uri" }
        }
      },
      "Page": {
        "type": "object",
        "required": ["slug", "title", "url"],
        "properties": {
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "summary": { "type": "string" }
        }
      },
      "ErrorBody": {
        "type": "object",
        "required": ["code", "message", "hint"],
        "properties": {
          "code": { "type": "string", "description": "Stable machine-readable error code." },
          "message": { "type": "string", "description": "What went wrong." },
          "hint": { "type": "string", "description": "What the caller should do next." }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "$ref": "#/components/schemas/ErrorBody" }
        }
      }
    }
  }
}
