{
  "openapi": "3.1.0",
  "info": {
    "title": "Elephant & Cross Courses API",
    "version": "1.0",
    "summary": "Read-only facts about every course Elephant & Cross sells, for people and for AI agents.",
    "description": "Static JSON generated at build from the same course data the pages show: level (EQF, MQF, QQI), price and monthly plan, duration, assessment, entry requirements, modules, progression and Malta's Get Qualified eligibility. No authentication. Free to read and quote with a link to the course page. Every HTML page on the site also answers `Accept: text/markdown` with a Markdown version.",
    "contact": { "name": "Elephant & Cross", "url": "https://elephantcross.org/contact", "email": "info@elephantcross.org" },
    "termsOfService": "https://elephantcross.org/terms"
  },
  "servers": [{ "url": "https://elephantcross.org/api/v1" }],
  "paths": {
    "/index.json": {
      "get": {
        "operationId": "getIndex",
        "summary": "Where everything is",
        "responses": { "200": { "description": "The API's endpoints, docs and related files", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Index" } } } } }
      }
    },
    "/courses.json": {
      "get": {
        "operationId": "listCourses",
        "summary": "Every listed course as a summary",
        "responses": { "200": { "description": "All courses", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CourseList" } } } } }
      }
    },
    "/courses/{slug}.json": {
      "get": {
        "operationId": "getCourse",
        "summary": "One course in full",
        "parameters": [{ "name": "slug", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "example": "business-management-diploma-online-mqf-level-5" }],
        "responses": {
          "200": { "description": "The course", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CourseResponse" } } } },
          "404": { "description": "No such course" }
        }
      }
    },
    "/guides.json": {
      "get": {
        "operationId": "listGuides",
        "summary": "The guides and country articles",
        "responses": { "200": { "description": "All guides", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuideList" } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "Envelope": {
        "type": "object",
        "required": ["api_version", "generated", "site"],
        "properties": {
          "api_version": { "type": "string", "example": "1.0" },
          "generated": { "type": "string", "format": "date", "description": "The build date" },
          "site": { "type": "string", "format": "uri" }
        }
      },
      "Index": { "allOf": [{ "$ref": "#/components/schemas/Envelope" }, { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "endpoints": { "type": "object", "additionalProperties": { "type": "string" } }, "openapi": { "type": "string", "format": "uri" }, "docs": { "type": "string", "format": "uri" }, "llms": { "type": "string", "format": "uri" }, "markdown": { "type": "string" }, "terms": { "type": "string" } } }] },
      "CourseList": { "allOf": [{ "$ref": "#/components/schemas/Envelope" }, { "type": "object", "required": ["total", "courses"], "properties": { "total": { "type": "integer" }, "courses": { "type": "array", "items": { "$ref": "#/components/schemas/CourseSummary" } } } }] },
      "CourseResponse": { "allOf": [{ "$ref": "#/components/schemas/Envelope" }, { "type": "object", "required": ["course"], "properties": { "course": { "$ref": "#/components/schemas/Course" } } }] },
      "GuideList": { "allOf": [{ "$ref": "#/components/schemas/Envelope" }, { "type": "object", "required": ["total", "guides"], "properties": { "total": { "type": "integer" }, "guides": { "type": "array", "items": { "$ref": "#/components/schemas/Guide" } } } }] },
      "Level": {
        "type": "object",
        "description": "The qualification level. EQF and MQF (Malta) match level for level; the Irish wording follows the QQI framework.",
        "properties": {
          "eqf": { "type": "integer", "minimum": 3, "maximum": 8 },
          "framework": { "type": ["string", "null"], "enum": ["MQF", "QQI", "EQF", null] },
          "number": { "type": ["integer", "null"] },
          "malta": { "type": "string", "example": "MQF Level 5" },
          "ireland": { "type": "string", "example": "QQI Level 6" }
        }
      },
      "Price": {
        "type": "object",
        "required": ["amount", "currency"],
        "properties": {
          "amount": { "type": "number", "description": "The full fee. 0 means priced per paper or on enquiry" },
          "currency": { "type": "string", "enum": ["EUR", "GBP"] },
          "monthly": { "type": ["number", "null"], "description": "The monthly instalment, where the course is paid monthly" },
          "installments": { "type": ["integer", "null"] },
          "notes": { "type": ["string", "null"] }
        }
      },
      "GetQualified": {
        "type": "object",
        "required": ["eligible"],
        "properties": {
          "eligible": { "type": "boolean", "description": "Eligible for Malta's Get Qualified Scheme" },
          "refund_percent": { "type": ["integer", "null"], "description": "The share of the fees returned as a tax credit once the course is finished" },
          "scheme": { "type": ["string", "null"] },
          "note": { "type": ["string", "null"] }
        }
      },
      "CourseSummary": {
        "type": "object",
        "required": ["slug", "name", "title", "url", "markdown", "kind", "subjects", "duration", "price", "get_qualified", "no_exams", "awarding_body"],
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string", "description": "The course name as the page's heading shows it" },
          "title": { "type": "string", "description": "The full title with its level and credits" },
          "url": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri", "description": "The page as Markdown" },
          "kind": { "type": "string", "enum": ["foundation-diploma", "diploma", "postgraduate-diploma", "top-up-degree", "mba-top-up", "acca-paper", "acca-programme"] },
          "kind_label": { "type": "string" },
          "subjects": { "type": "array", "items": { "type": "string" } },
          "subject_labels": { "type": "array", "items": { "type": "string" } },
          "level": { "oneOf": [{ "$ref": "#/components/schemas/Level" }, { "type": "null" }] },
          "credits": { "type": ["number", "null"] },
          "awarding_body": { "type": "string" },
          "duration": { "type": "object", "properties": { "text": { "type": "string" }, "short": { "type": "string", "example": "10 to 15 months" } } },
          "delivery": { "type": "string", "enum": ["online"] },
          "no_exams": { "type": "boolean", "description": "True when the course's own assessment says so; ACCA papers sit exams" },
          "price": { "$ref": "#/components/schemas/Price" },
          "get_qualified": { "$ref": "#/components/schemas/GetQualified" }
        }
      },
      "Course": {
        "allOf": [
          { "$ref": "#/components/schemas/CourseSummary" },
          {
            "type": "object",
            "properties": {
              "lead": { "type": ["string", "null"] },
              "assessment": { "type": ["string", "null"] },
              "entry_requirements": { "type": "array", "items": { "type": "string" } },
              "modules": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": ["string", "null"] } } } },
              "progression": { "type": "array", "items": { "type": "string" } },
              "progression_to": { "type": "array", "items": { "type": "string" }, "description": "Slugs of the courses this one leads into" },
              "faqs": { "type": "array", "items": { "type": "object", "properties": { "question": { "type": "string" }, "answer": { "type": "string" } } } },
              "awards": { "type": "array", "items": { "type": "object", "properties": { "framework": { "type": "string" }, "level": { "type": "integer" }, "credits": { "type": ["number", "null"] }, "geo": { "type": "string" }, "awarding_body": { "type": "string" } } } },
              "partner_delivered": { "type": "boolean", "description": "Delivered by a partner university (the Arden top-ups)" },
              "acca": { "type": ["object", "null"], "properties": { "code": { "type": "string" }, "weeks": { "type": "integer" }, "exam": { "type": "string" }, "where_it_sits": { "type": "string" } } },
              "contact": { "type": "object", "properties": { "phone": { "type": "string" }, "whatsapp": { "type": "string", "format": "uri" }, "email": { "type": "string" }, "hours": { "type": "string" }, "book_a_call": { "type": "string", "format": "uri" }, "enquire": { "type": "string", "format": "uri" } } }
            }
          }
        ]
      },
      "Guide": {
        "type": "object",
        "required": ["title", "url", "markdown"],
        "properties": {
          "title": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "markdown": { "type": "string", "format": "uri" },
          "excerpt": { "type": "string" },
          "country": { "type": ["string", "null"], "enum": ["Malta", "Ireland", null] },
          "category": { "type": "string" },
          "published": { "type": ["string", "null"] },
          "modified": { "type": ["string", "null"] },
          "author": { "type": ["string", "null"] }
        }
      }
    }
  }
}
