{
  "openapi": "3.1.0",
  "info": {
    "title": "APPLoja Public API",
    "version": "1.0.0",
    "description": "Public machine-readable endpoints for APPLoja discovery. Authenticated business APIs are added only after explicit approval for public integration."
  },
  "servers": [{ "url": "https://web.apploja.com" }],
  "paths": {
    "/api/agent/health": {
      "get": {
        "operationId": "getAgentHealth",
        "summary": "Check APPLoja public API availability",
        "description": "Returns a small JSON document proving that the public API surface is reachable and machine-readable.",
        "responses": {
          "200": {
            "description": "API is available.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/HealthResponse" }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["ok", "service", "documentation"],
        "properties": {
          "ok": { "type": "boolean", "description": "Whether the service is available." },
          "service": { "type": "string", "description": "Stable public service name." },
          "documentation": { "type": "string", "format": "uri", "description": "Developer portal URL." }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": ["code", "message", "hint"],
            "properties": {
              "code": { "type": "string", "description": "Stable machine-readable error code." },
              "message": { "type": "string", "description": "Human-readable error summary." },
              "hint": { "type": "string", "description": "Suggested resolution for the caller." }
            }
          }
        }
      }
    }
  }
}
