{"openapi":"3.1.0","info":{"title":"Skills Experts LMS API","version":"1.0.0-preview","description":"Multi-tenant LMS API for TOTG, EOTG, Road Wellness, Ergonomics SA and white-label licensees. Preview: data is fictional and in-memory; course shells are drafts with no claimed accreditation.","contact":{"name":"House of Experts"}},"servers":[{"url":"/"}],"tags":[{"name":"Platform"},{"name":"Catalogue"},{"name":"Enrolment"},{"name":"Assessment"},{"name":"Certificates"},{"name":"CPD"},{"name":"Employer"},{"name":"Tenders"},{"name":"xAPI"},{"name":"Auth"}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Required for writes when SE_API_KEY is set (production)."},"oidc":{"type":"openIdConnect","openIdConnectUrl":"{OIDC_ISSUER}/.well-known/openid-configuration","description":"Planned - group IdP federation."}},"responses":{"Problem":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"status":{"type":"integer"}}}}}}},"schemas":{"Course":{"type":"object","required":["id","code","title","status","priceZar","accreditation"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","review","published","retired"]},"priceZar":{"type":"number"},"durationHours":{"type":"number"},"validityMonths":{"type":["integer","null"]},"accreditation":{"type":"object","properties":{"status":{"type":"string"},"route":{"type":"string"}}}}},"Enrolment":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string"},"courseId":{"type":"string"},"cohortId":{"type":"string"},"status":{"type":"string"},"progressPct":{"type":"number"},"source":{"type":"string"}}},"EnrolmentRequest":{"type":"object","required":["personId","courseId"],"properties":{"personId":{"type":"string"},"courseId":{"type":"string"},"cohortId":{"type":"string"}}},"BulkRequest":{"type":"object","required":["employerId","courseId","csv"],"properties":{"employerId":{"type":"string"},"courseId":{"type":"string"},"csv":{"type":"string","description":"name,email,job_title,date_of_birth - no ID numbers"}}},"Verification":{"type":"object","properties":{"valid":{"type":"boolean"},"authentic":{"type":"boolean"},"state":{"type":"string"},"certificate":{"type":"object"}}},"XapiStatement":{"type":"object","required":["actor","verb","object"],"properties":{"actor":{"type":"object"},"verb":{"type":"object"},"object":{"type":"object"},"result":{"type":"object"}}}}},"paths":{"/api/v1/health":{"get":{"tags":["Platform"],"summary":"Health check","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/openapi.json":{"get":{"tags":["Platform"],"summary":"This specification","responses":{"200":{"description":"OpenAPI document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants":{"get":{"tags":["Platform"],"summary":"List tenants and themes","responses":{"200":{"description":"Tenants","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}":{"get":{"tags":["Platform"],"summary":"Tenant detail","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"200":{"description":"Tenant","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/tenants/{tenant}/courses":{"get":{"tags":["Catalogue"],"summary":"Tenant catalogue","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"200":{"description":"Courses","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Course"}}}}}}}}}},"/api/v1/tenants/{tenant}/courses/{courseId}":{"get":{"tags":["Catalogue"],"summary":"Course with modules and lessons","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}},{"name":"courseId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Course","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"}}}},"404":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/tenants/{tenant}/enrolments":{"get":{"tags":["Enrolment"],"summary":"List enrolments","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}},{"name":"personId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Enrolments","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Enrolment"],"summary":"Enrol a learner (rules engine)","security":[{"apiKey":[]}],"parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Enrolment"}}}},"400":{"$ref":"#/components/responses/Problem"},"422":{"description":"Refused with reasons","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}/enrolments/bulk":{"post":{"tags":["Employer"],"summary":"Bulk enrol staff from CSV","security":[{"apiKey":[]}],"parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}},{"name":"dryRun","in":"query","schema":{"type":"boolean"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRequest"}}}},"responses":{"200":{"description":"Dry-run result","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Enrolled","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}/evidence":{"get":{"tags":["Assessment"],"summary":"Portfolio of evidence items","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"200":{"description":"Evidence","content":{"application/json":{"schema":{"type":"object"}}}}}},"post":{"tags":["Assessment"],"summary":"Capture evidence","security":[{"apiKey":[]}],"parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"201":{"description":"Captured","content":{"application/json":{"schema":{"type":"object"}}}},"422":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/tenants/{tenant}/cpd/{personId}":{"get":{"tags":["CPD"],"summary":"CPD ledger and rolling 12-month summary","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}},{"name":"personId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CPD","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}/employers/{employerId}/compliance":{"get":{"tags":["Employer"],"summary":"Compliance matrix (JSON or CSV)","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}},{"name":"employerId","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"]}}],"responses":{"200":{"description":"Matrix","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}/rate-card":{"get":{"tags":["Tenders"],"summary":"Indicative rate card for Tender Factory pricing","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"200":{"description":"Rate card","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenants/{tenant}/tender-evidence":{"get":{"tags":["Tenders"],"summary":"Truthful returnables feed for training bids","parameters":[{"name":"tenant","in":"path","required":true,"schema":{"type":"string","enum":["totg","eotg","road-wellness","ergonomics-sa","demo-licensee"]}}],"responses":{"200":{"description":"Evidence","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/tenders/awards":{"post":{"tags":["Tenders"],"summary":"Award intake from Tender Factory (dry run)","security":[{"apiKey":[]}],"responses":{"200":{"description":"Cohort plan","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/certificates/{number}":{"get":{"tags":["Certificates"],"summary":"Public verification","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Z]{2,6}-\\d{4}-\\d{6}-[0-9A-Z]$"}}],"responses":{"200":{"description":"Verification","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"404":{"$ref":"#/components/responses/Problem"}}}},"/api/v1/certificates/{number}/pdf":{"get":{"tags":["Certificates"],"summary":"Certificate PDF with verification QR","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{}}}}}},"/api/v1/xapi/statements":{"post":{"tags":["xAPI"],"summary":"Store xAPI statements (LRS-lite)","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/XapiStatement"},{"type":"array","items":{"$ref":"#/components/schemas/XapiStatement"}}]}}}},"responses":{"200":{"description":"Statement ids","content":{"application/json":{"schema":{"type":"object"}}}}}},"get":{"tags":["xAPI"],"summary":"Recent statements","responses":{"200":{"description":"Statements","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/auth/oidc/{action}":{"get":{"tags":["Auth"],"summary":"OIDC federation stub (status, login, callback)","parameters":[{"name":"action","in":"path","required":true,"schema":{"type":"string","enum":["status","login","callback"]}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object"}}}},"501":{"$ref":"#/components/responses/Problem"}}}}}}