{"openapi":"3.1.0","info":{"title":"MedStudio agency API","version":"1.0.0","description":"Results of your courses for your own systems. Viewers are identified only by the pseudonymous ID you sent (or a hash of an LMS e-mail); MedStudio stores no names, e-mails or IP addresses. Guide: https://app.medstudio.sk/dokumentacia"},"servers":[{"url":"https://api.medstudio.sk"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key msk_… issued by MedStudio. Send it from your server only."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Module":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"required":{"type":"boolean"}}},"Course":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","review","approved","published","archived"]},"language":{"type":"string","enum":["sk","cs","en"]},"createdAt":{"type":"string","format":"date-time"},"modules":{"type":"array","items":{"$ref":"#/components/schemas/Module"}}}},"LearnerResult":{"type":"object","properties":{"externalId":{"type":"string","description":"Your viewer ID (or h_… hash of an LMS e-mail)."},"attributes":{"type":"object","additionalProperties":{"type":"string"},"description":"Optional attributes you sent (profession, region)."},"completed":{"type":"boolean"},"completedAt":{"type":["string","null"],"format":"date-time"},"modules":{"type":"object","additionalProperties":{"type":["object","null"],"properties":{"watchedPct":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Percent, one decimal place."},"completed":{"type":"boolean"}}},"description":"Per module ID; null = not started."},"questions":{"type":"object","properties":{"answered":{"type":"integer"},"correct":{"type":"integer"}}},"tests":{"type":"object","properties":{"prePct":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Percent, one decimal place."},"postPct":{"type":["number","null"],"minimum":0,"maximum":100,"description":"Percent, one decimal place."},"passed":{"type":["boolean","null"],"description":"Post test reached the pass threshold (null: no threshold or no post test yet)."}}},"firstSeenAt":{"type":"string","format":"date-time"},"lastActivityAt":{"type":"string","format":"date-time"}}},"WebhookEvent":{"type":"object","required":["id","type","createdAt","data"],"properties":{"id":{"type":"string","description":"Unique; a retried delivery has the same id."},"type":{"type":"string","enum":["course.completed","attempt.completed","test.completed","ping"]},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","description":"course {id,title}, learner {externalId}, and per type: completedAt, tests {prePct, postPct, passScore, passed}, module, watchedS, durationS, test, scorePct."}}}}},"paths":{"/v1/org/courses":{"get":{"summary":"Your courses and their parts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"courses":{"type":"array","items":{"$ref":"#/components/schemas/Course"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (120 per minute per key)."}}}},"/v1/org/courses/{id}/learners":{"get":{"summary":"Results per viewer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Viewers who started the course on or after this day (Slovak time)."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Viewers who started the course on or before this day (Slovak time)."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"course":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"}}},"modules":{"type":"array","items":{"$ref":"#/components/schemas/Module"}},"summary":{"type":"object","description":"Viewers, completion, average watched share, correct answers and test averages."},"learners":{"type":"array","items":{"$ref":"#/components/schemas/LearnerResult"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown course, or a course of another organization."},"429":{"description":"Too many requests (120 per minute per key)."}}}},"/v1/org/courses/{id}/export":{"get":{"summary":"Results as CSV for Excel (semicolon, UTF-8 with BOM)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Viewers who started the course on or after this day (Slovak time)."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Viewers who started the course on or before this day (Slovak time)."}],"responses":{"200":{"description":"CSV file","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found."},"429":{"description":"Too many requests (120 per minute per key)."}}}},"/v1/org/xapi/statements":{"get":{"summary":"Viewer activity as xAPI 1.0.3 statements, oldest first","parameters":[{"name":"courseId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer","minimum":0},"description":"Continue with the URL from `more`."}],"responses":{"200":{"description":"OK (header X-Experience-API-Version: 1.0.3)","content":{"application/json":{"schema":{"type":"object","properties":{"statements":{"type":"array","items":{"type":"object"}},"more":{"type":"string","description":"Next page URL path, empty at the end."}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests (120 per minute per key)."}}}},"/v1/org/learners/{externalId}":{"get":{"summary":"GDPR: everything stored about one viewer","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"},"description":"Your viewer ID or the e-mail an LMS sent."}],"responses":{"200":{"description":"JSON export"},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such viewer."},"429":{"description":"Too many requests (120 per minute per key)."}}},"delete":{"summary":"GDPR: erase one viewer (key with scope learners:delete)","parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Erased","content":{"application/json":{"schema":{"type":"object","properties":{"erased":{"type":"integer"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key may not delete."},"404":{"description":"No such viewer."},"429":{"description":"Too many requests (120 per minute per key)."}}}}},"webhooks":{"event":{"post":{"summary":"Event sent to your HTTPS endpoint","description":"Header X-MedStudio-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your whsec_ secret>. Answer 2xx within 10 s; failures are retried after 1 min, 5 min, 30 min, 2 h and 12 h.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received"}}}}}}