Content preview API
Lets aztec_staff and admin open any Published Version as a learner would see it, in a chosen language, with no assignment. A preview writes no learner records: no assignment check, no cmi5 registration, no statements under any learner. POST /api/launch stays learner-only.
| Operation | Route | Notes |
|---|---|---|
| Open a preview | POST /api/preview | Body: versionId (required) and locale (optional, for example es-US). Returns the same body as POST /api/launch: launchUrl, packageUrl, packageUrlExpiresAt, registration, lrsEndpoint, fetchUrl, variant, fallbackUsed and notice. |
| cmi5 fetch | POST /api/launch/fetch?token= | Same call as for a launch. A preview token returns a preview credential. |
Errors
401 not signed in. 403 any role other than aztec_staff or admin. 404 unknown Version. 422 the Version is Draft or Retired, the locale is not a valid language tag, or the Version has no unit that can be previewed. 503 URL signing is unavailable, with friendly copy.
Fetch refusals are the same as for launch: HTTP 200 with error-code 1 already used, 2 expired (5 minutes after the preview), 3 invalid.
Rules
- The signed package URL lasts 15 minutes. The fetch token is single-use and lasts 5 minutes.
- The Variant comes from ResolveVariant. When it falls back to another locale,
fallbackUsedis true andnoticeis the same text as for a launch. - The first unit of the Version is previewed.
registrationis a random value that is never stored. - Content calls the xAPI endpoint with a preview credential. Statements and state writes return success and nothing is stored. State reads find nothing, except
LMS.LaunchData, which is generated withlaunchModeBrowseandmoveOnNotApplicable. - A Version retired while a preview is open keeps working; the next preview request returns 422.
Telemetry
Events: preview requested, succeeded, denied (with reason), Variant fallback used. Each carries the caller's role and never a learner.