xAPI statements API
Base path: /api/statements
Ingests xAPI (Experience API) statements — the learning records emitted when a learner interacts with exercises and assignments. The route resolves the referenced content and assignment and hands the statement to the statements repository for persistence.
Endpoint
POST /api/statements/:ref_id/:assignment_id?— record one xAPI statement.- Path:
ref_id(required) — the content reference the statement is about;assignment_id(optional) — the assignment the statement belongs to. - Body: a standard xAPI statement (
actor,verb,object, and optionalcontext/result). The request must include aContent-Typeheader. - Response:
204 No Contenton success.
- Path:
Errors
400 Bad Request— missingref_idor missingContent-Typeheader.404 Not Found— theref_id(or the givenassignment_id) does not exist.