{
  "openapi": "3.1.0",
  "info": {
    "title": "GoEduHub Examination & Accreditation API",
    "version": "1.0.0",
    "description": "API for taking standardized educational exams, checking candidate status, and verifying ROHUB certificates."
  },
  "servers": [
    {
      "url": "https://goeduhub.xyz"
    }
  ],
  "paths": {
    "/api.php": {
      "get": {
        "summary": "Query GoEduHub Resources",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["stats", "organizations", "questions", "announcements", "verify_certificate", "candidate_results"]
            }
          },
          {
            "name": "org_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "username",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful query response",
            "content": {
              "application/json": {}
            }
          }
        }
      },
      "post": {
        "summary": "Submit Examination or Action",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": { "type": "string" },
                  "org_code": { "type": "string" },
                  "username": { "type": "string" },
                  "full_name": { "type": "string" },
                  "template_name": { "type": "string" },
                  "answers": { "type": "object" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission and grading result",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    }
  }
}
