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 optional context / result). The request must include a Content-Type header.
    • Response: 204 No Content on success.

Errors

  • 400 Bad Request — missing ref_id or missing Content-Type header.
  • 404 Not Found — the ref_id (or the given assignment_id) does not exist.