Modules API
Base path: /api/modules
Modules (also called longforms) are the content documents produced by the editor. This is the core content workflow: create and save versions, browse history, share, assign, and export.
Authorization, permission filtering, LTI verification, and Google Classroom hand-off all live behind the backend’s repository — the routes only handle HTTP.
List and search
GET /api/modules— list the modules the requester may see.- Query:
from,size,include(comma-separated relations),filter[published],filter[featured],organization_id,created_by, and the LTI contextlti_platform_id+id_token.
- Query:
GET /api/modules/search— full-text search across accessible modules.- Query:
q(search terms),from,size,include,lti_platform_id,id_token.
- Query:
Search is powered directly by PostgreSQL — see System requirements.
Read
GET /api/modules/:id— fetch a single module descriptor. Returnsnullwhen the module is not visible to the requester.
Save
POST /api/modules/:id— save a new version of a module.- Body:
{ "data": Module, "rev": string | null }. revprovides optimistic concurrency: pass the revision you based your edit on. If it is stale, the request fails with409 Conflictinstead of overwriting a newer version.- The response echoes the saved content with the new revision id.
- Body:
DELETE /api/modules/:id— soft-delete a module.
Version history
GET /api/modules/:id/versions— list past revisions. Query:from,size.GET /api/modules/:id/versions/:version_id— fetch the content of one past version, for rollback or audit.
Sharing
GET /api/modules/:id/share— read the module’s sharing options.POST /api/modules/:id/share— update sharing options.
Assignments
Link a module to a learning platform (e.g. Google Classroom — see Google Classroom):
GET /api/modules/:id/assignments— list a module’s assignments.POST /api/modules/:id/assignments— create an assignment for the module.
Export
GET /api/modules/:id/linked-data— the current version as JSON-LD.GET /api/modules/:id/download— a self-contained offline package (application/zip) bundling the content, its media, and the viewer runtime as a single HTML file. Add?scormto include a SCORM 2004imsmanifest.xmlfor upload to a SCORM-compatible LMS.