# SCORM packages

Host a SCORM package and play it as-is — no conversion. An uploaded package becomes a course (`type: "scorm"`) with the normal share, embed, and tracking machinery: learners play the original package exactly as it was authored, and completion, score, and time land on the same tracking objects as any other course.

<a id="overview"></a>

## How it works

Hosting a package is a three-step flow:

1. Request a signed upload URL and `PUT` the package zip to it.
2. Create the course from the upload — validation and extraction run asynchronously.
3. Poll the status endpoint until the package is `ready` (or `failed` with a reason).

Once ready, deliver it like any course: the share link plays it for learners, or issue an embed URL with [POST /embed/scorm](/api/scorm-packages#embed-scorm). Each embed learner arrives with your `identifier`, so playback is attributed and billed per tenant exactly like course embeds. Learner results come back through the standard [Tracking API](/api/tracking).

### Supported packages

- SCORM 1.2 and SCORM 2004 (3rd/4th Edition), single-SCO or simple multi-SCO.
- Packages that rely on SCORM 2004 **sequencing rules** (activity trees, rollup rules, global objectives) are rejected at upload with a clear reason rather than played incorrectly. Standard exports from tools like Articulate Rise and Storyline are fine — their default sequencing boilerplate is supported.
- Uploads are zip files, up to 200 MB per package by default.

### What a SCORM course doesn't do

A hosted package is never editable: it can't be opened in a builder, translated, or re-exported as SCORM. The original zip is always downloadable byte-for-byte instead.

For how unscored quizzes in Coassemble course exports report to an LMS, see [Export SCORM](/api/courses#export-scorm) in the Courses API.

<a id="upload-scorm-package"></a>

## Request an upload URL

Returns a signed URL and an upload `hash`. `PUT` the zip bytes to the URL with `Content-Type: application/zip`, then pass the `hash` to the create endpoint. The signed URL expires after one hour.

POST `/v1/headless/scorm-package/upload`

#### Body parameters

| Field | Type | Required | Desc | Options |
| --- | --- | --- | --- | --- |
| `name` | `string` | Yes | Original zip filename | — |
| `size` | `number` | Yes | Zip size in bytes | — |

#### Examples

**cURL request**

```bash
curl --request POST \
  --url "https://api.coassemble.com/api/v1/headless/scorm-package/upload" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "name": "example",
    "size": 1
}'
```

#### Response

**JSON response**

```json
{
  "url": "https://api.coassemble.com/embed/abc123def456",
  "hash": "example"
}
```

<a id="create-scorm-package"></a>

## Create a hosted SCORM course

Creates the course from an uploaded package. The response returns immediately with the new `courseId` and a package status of `uploaded` — manifest validation and content extraction run in the background, typically completing in under a minute. The course title comes from the package manifest once processing finishes.

POST `/v1/headless/scorm-package`

#### Body parameters

| Field | Type | Required | Desc | Options |
| --- | --- | --- | --- | --- |
| `hash` | `string` | Yes | Hash returned by the upload endpoint | — |
| `name` | `string` | Yes | Original zip filename | — |

#### Examples

**cURL request**

```bash
curl --request POST \
  --url "https://api.coassemble.com/api/v1/headless/scorm-package" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "hash": "example",
    "name": "example"
}'
```

#### Response

**JSON response**

```json
{
  "courseId": 1234,
  "key": "abc123",
  "title": "Workplace Safety",
  "scormPackage": {
    "status": "example",
    "scormVersion": "example",
    "error": "example",
    "errorCode": "example",
    "originalName": "example",
    "zipSize": 1,
    "extractedBytes": 1,
    "fileCount": 12,
    "maxAttempts": 1,
    "launch": null
  }
}
```

<a id="get-scorm-package"></a>

## Get processing status

Poll this endpoint after creating the course. `status` moves through:

- `uploaded` → queued for processing.
- `processing` → validating and extracting.
- `ready` → playable; `launch` describes the package's SCOs.
- `failed` → rejected or errored; `error` is a human-readable reason and `errorCode` a machine code.

Rejection codes:

- `no_manifest` — the zip has no `imsmanifest.xml`.
- `invalid_manifest` — `imsmanifest.xml` can't be parsed or isn't a valid SCORM manifest.
- `unsupported_version` — not SCORM 1.2 or 2004.
- `no_launchable_sco` — no launchable SCO resource, or its launch file is missing from the zip.
- `sequencing_present` — the package uses SCORM 2004 sequencing rules, which aren't supported.
- `not_zip`, `zip_bomb`, `too_many_files`, `unsafe_paths` — the archive itself is invalid or unsafe.
- `extract_failed` — processing failed for another reason; upload the package again.

A rejection is terminal: fix the package in your authoring tool and upload it again (which creates a new course), or convert it into an editable course with the [Generate API](/api/generate) instead.

GET `/v1/headless/scorm-package/{courseId}`

#### Path parameters

| Field | Description | Options |
| --- | --- | --- |
| `courseId` | Numeric ID of the hosted SCORM course. | — |

#### Examples

**cURL request**

```bash
curl --request GET \
  --url "https://api.coassemble.com/api/v1/headless/scorm-package/1234" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY"
```

#### Response

**JSON response**

```json
{
  "status": "example",
  "scormVersion": "example",
  "error": "example",
  "errorCode": "example",
  "originalName": "example",
  "zipSize": 1,
  "extractedBytes": 1,
  "fileCount": 12,
  "maxAttempts": 1,
  "launch": null
}
```

<a id="download-scorm-package"></a>

## Download the original package

Returns a short-lived download URL for the original uploaded zip, byte-for-byte. This is the replacement for SCORM export on hosted packages.

GET `/v1/headless/scorm-package/{courseId}/download`

#### Path parameters

| Field | Description | Options |
| --- | --- | --- |
| `courseId` | Numeric ID of the hosted SCORM course. | — |

#### Examples

**cURL request**

```bash
curl --request GET \
  --url "https://api.coassemble.com/api/v1/headless/scorm-package/1234/download" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY"
```

#### Response

**JSON response**

```json
{
  "url": "https://api.coassemble.com/embed/abc123def456",
  "expiresAt": "https://api.coassemble.com/embed/abc123def456"
}
```

<a id="embed-scorm"></a>

## Issue a SCORM embed URL

Issues a signed embed URL for a hosted SCORM course, following the same pattern as `POST /embed/course`. Pass the hosted SCORM `courseId` and your stable user `identifier`. With `action: "view"` (the default) the learner plays the package; their progress is recorded against the `identifier` you pass. With `action: "edit"` the embed shows a read-only package overview for the uploader. There is no builder for SCORM courses.

`readonly: true` silently ignores mutating requests from the embed server-side. `discardSourceDocuments` applies only to `action: "edit"` embeds.

A learner who leaves mid-package resumes where they left off on their next launch (suspend data and location persist per learner).

POST `/v1/headless/embed/scorm`

#### Body parameters

| Field | Type | Required | Desc | Options |
| --- | --- | --- | --- | --- |
| `discardSourceDocuments` | `boolean` | No | For authoring (edit) embeds only: do not retain source documents. Inherited by source uploads and generation; the embedded client cannot disable it. Files in Document blocks are course content and are kept. Workspace library documents are refused as sources with a 400. Default false. | — |
| `action` | `string` | No | view (learner playback, default) or edit (read-only package overview for the uploader) | `view` `edit` |
| `courseId` | `number` | Yes | Hosted SCORM course ID (created via the scorm-package endpoints) | — |
| `identifier` | `string` | Yes | Your stable user identifier | — |
| `clientIdentifier` | `string` | No | The client this user belongs to | — |
| `themeId` | `number` | No | Theme ID to render the embed with | — |
| `name` | `string` | No | Display name for the learner or editor. Used for presence avatars and comment authors. An empty or blank name is treated as not given. When not given, a colour-and-animal name is generated from identifier. Max 512 characters; over-limit values return HTTP 400 naming the field, limit and length sent. | — |
| `avatar` | `string` | No | Avatar image URL for the learner or editor. Used for presence avatars and comment authors. An empty or blank avatar is treated as not given. When not given, no avatar is shown; it does not generate a name. Non-blank values must be an http(s) URL. Max 2048 characters; non-blank values that exceed the limit or are not an http(s) URL return HTTP 400 naming the field, limit and length sent. | — |
| `options` | `object` | No | Optional object for embed settings, including learner \`appearance\` (\`light\`, \`dark\`, or \`device\`, the default) and link lifetime \`expiresIn\` (default \`3h\`). | — |
| `readonly` | `boolean` | No | When true, mutating requests from this embed are silently no-opped server-side. | — |

#### Examples

**cURL request**

```bash
curl --request POST \
  --url "https://api.coassemble.com/api/v1/headless/embed/scorm" \
  --header "Authorization: COASSEMBLE:YOUR_WORKSPACE_ID:YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "courseId": 1234,
    "identifier": "user_123",
    "discardSourceDocuments": true,
    "action": "view"
}'
```

#### Response

**JSON response**

```json
"https://api.coassemble.com/embed/abc123def456"
```
