Docs API reference
Courses & versions
Create, version and publish courses.
A course is a stable identity with versions beneath it. You edit a draft; publishing freezes it as the new published version. Read the Courses & versions guide.
10 endpoints · base path /api/v1
List courses
AccessAdmin, or an API key with the read or write scope.
Lists every course in the tenant with its title, status, and which version numbers are published or in draft.
Responses
Example response
[
{
"createdAt": "2026-11-25T14:03:11Z",
"draftVersion": 1,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"publishedVersion": 1,
"slug": "workplace-safety-essentials",
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}
]Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
Errors use RFC 9457 problem details.
curl -X GET "$LMS_URL/api/v1/courses" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const res = await fetch(`${LMS_URL}/api/v1/courses`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const res = await fetch(`${LMS_URL}/api/v1/courses`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
res = requests.get(f"{LMS_URL}/api/v1/courses", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses"))
.header("X-API-Key", lmsKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
uri = URI("#{lms_url}/api/v1/courses")
request = Net::HTTP::Get.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$ch = curl_init("$lmsUrl/api/v1/courses");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/courses", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Create a course
AccessAdmin, or an API key with the write scope.
Creates the course and an empty draft version (v1) you can start building in. slug is the course's stable address in your own system: lowercase letters, digits and dashes, unique per tenant.
A course isn't visible to learners until you publish it.
Request body application/json · CreateCourse
| Field | Type | Notes |
|---|---|---|
| slugrequired | string | matches [a-z0-9][a-z0-9-]{0,100}; min length 1 |
| summary | string | — |
| titlerequired | string | min length 1 |
Example request body
{
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}Responses
Example response
{
"createdAt": "2026-11-25T14:03:11Z",
"draftVersion": 1,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"publishedVersion": 1,
"slug": "workplace-safety-essentials",
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 400 | The request was malformed or failed validation. errors lists each field. |
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 409 | The slug is already used by another course. |
Errors use RFC 9457 problem details.
curl -X POST "$LMS_URL/api/v1/courses" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const res = await fetch(`${LMS_URL}/api/v1/courses`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const res = await fetch(`${LMS_URL}/api/v1/courses`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
res = requests.post(f"{LMS_URL}/api/v1/courses", headers=HEADERS, json={
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials",
}, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String body = """
{
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses"))
.header("X-API-Key", lmsKey)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
uri = URI("#{lms_url}/api/v1/courses")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"slug" => "workplace-safety-essentials",
"summary" => "Fire safety and everyday hazards.",
"title" => "Workplace Safety Essentials",
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$ch = curl_init("$lmsUrl/api/v1/courses");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"slug" => "workplace-safety-essentials",
"summary" => "Fire safety and everyday hazards.",
"title" => "Workplace Safety Essentials",
]),
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{
"slug": "workplace-safety-essentials",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/courses", body)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Get a course
AccessAdmin, or an API key with the read or write scope.
Returns the course summary. Use the versions endpoints to read its content.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"createdAt": "2026-11-25T14:03:11Z",
"draftVersion": 1,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"publishedVersion": 1,
"slug": "workplace-safety-essentials",
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X GET "$LMS_URL/api/v1/courses/$COURSE_ID" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.get(f"{LMS_URL}/api/v1/courses/{course_id}", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId))
.header("X-API-Key", lmsKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}")
request = Net::HTTP::Get.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId, nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Read the draft as a tree
AccessAdmin, or an API key with the read or write scope.
Shortcut for GET /courses/{id}/versions/draft.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"assessments": [
{
"feedbackMode": "AFTER_ATTEMPT",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"instructions": "string",
"items": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"pointsOverride": 1.5,
"poolBankId": "2d96d03c-9296-457c-ae5b-8193fa93cc0c",
"poolDrawCount": 1,
"position": 0,
"questionVersionId": "feab681a-824d-43fa-a46a-64050ba5aed2"
}
],
"maxAttempts": 3,
"passPercent": 70,
"shuffleOptions": true,
"shuffleQuestions": true,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"timeLimitSeconds": 1,
"title": "Workplace Safety Essentials"
}
],
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"modules": [
{
"description": "A short description.",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"lessons": [
{
"blocks": [
{}
],
"completionMode": "MANUAL",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"isRequired": true,
"position": 0,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"title": "Workplace Safety Essentials",
"unlockMode": "OPEN"
}
],
"position": 0,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"title": "Workplace Safety Essentials"
}
],
"slug": "workplace-safety-essentials",
"version": {
"certificateTemplateId": "f9369757-51f7-4227-a2e1-3922edbd9bab",
"certificateValidityDays": 1,
"completionPercent": 80,
"completionPolicy": "ALL_REQUIRED",
"coverAssetId": "ce4ba24d-c68c-4c3d-aa93-d96cac1be0a9",
"description": "A short description.",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"number": 1,
"publishedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | The course has no draft. |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X GET "$LMS_URL/api/v1/courses/$COURSE_ID/draft" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.get(f"{LMS_URL}/api/v1/courses/{course_id}/draft", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/draft"))
.header("X-API-Key", lmsKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/draft")
request = Net::HTTP::Get.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/draft");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/draft", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Update the draft's settings
AccessAdmin, or an API key with the write scope.
Replaces the draft's metadata: title, descriptions, cover image, estimated time, the completion rule, and the certificate.
completionPolicyisALL_REQUIREDorPERCENT_REQUIRED.completionPercentis required with the latter and not allowed with the former.certificateTemplateIdmakes completion issue a certificate;certificateValidityDayssets its expiry (omit for never).
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · Metadata
| Field | Type | Notes |
|---|---|---|
| certificateTemplateId | string (uuid) | — |
| certificateValidityDays | integer (int32) | min 1 |
| completionPercent | integer (int32) | min 1 |
| completionPolicyrequired | string | matches ALL_REQUIRED|PERCENT_REQUIRED |
| coverAssetId | string (uuid) | — |
| description | string | — |
| estimatedMinutes | integer (int32) | min 0 |
| summary | string | — |
| titlerequired | string | min length 1 |
Example request body
{
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}Responses
Example response
{
"certificateTemplateId": "f9369757-51f7-4227-a2e1-3922edbd9bab",
"certificateValidityDays": 1,
"completionPercent": 80,
"completionPolicy": "ALL_REQUIRED",
"coverAssetId": "ce4ba24d-c68c-4c3d-aa93-d96cac1be0a9",
"description": "A short description.",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"number": 1,
"publishedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 400 | The request was malformed or failed validation. errors lists each field. |
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | The course has no draft to edit. |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X PUT "$LMS_URL/api/v1/courses/$COURSE_ID/draft" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'PUT',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'PUT',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.put(f"{LMS_URL}/api/v1/courses/{course_id}/draft", headers=HEADERS, json={
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365,
}, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
String body = """
{
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/draft"))
.header("X-API-Key", lmsKey)
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/draft")
request = Net::HTTP::Put.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"title" => "Workplace Safety Essentials",
"summary" => "Fire safety and everyday hazards.",
"completionPolicy" => "ALL_REQUIRED",
"certificateTemplateId" => "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays" => 365,
}.to_json
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/draft");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY'), 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"title" => "Workplace Safety Essentials",
"summary" => "Fire safety and everyday hazards.",
"completionPolicy" => "ALL_REQUIRED",
"certificateTemplateId" => "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays" => 365,
]),
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
body := strings.NewReader(`{
"title": "Workplace Safety Essentials",
"summary": "Fire safety and everyday hazards.",
"completionPolicy": "ALL_REQUIRED",
"certificateTemplateId": "7a1e3c52-9b4d-4f08-a2c6-5d81e0b39f17",
"certificateValidityDays": 365
}`)
req, _ := http.NewRequest("PUT", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/draft", body)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Discard the draft
AccessAdmin, or an API key with the write scope.
Throws the draft away. The published version is untouched. You can't discard the only version of a course.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | The course has no draft, or the draft is its only version. |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/courses/$COURSE_ID/draft" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'DELETE',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/draft`, {
method: 'DELETE',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.delete(f"{LMS_URL}/api/v1/courses/{course_id}/draft", headers=HEADERS, timeout=10)
res.raise_for_status()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/draft"))
.header("X-API-Key", lmsKey)
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/draft")
request = Net::HTTP::Delete.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/draft");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("DELETE", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/draft", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
_ = data
}Publish the draft
AccessAdmin, or an API key with the write scope.
Freezes the draft as the new published version and retires the previous one. Learners already enrolled keep the version they started on; new enrollments get this one. Emits course.published.
Publishing is validated. If anything is wrong you get a 422 with every problem at once, in problems:
- the course has no lessons
- a section has no lessons, or a lesson has no content blocks
- a lesson completes by passing an assessment but has no assessment block
- an assessment used in a lesson has no questions
- a pool draws more questions than its bank holds
- the certificate template is archived
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"createdAt": "2026-11-25T14:03:11Z",
"draftVersion": 1,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"publishedVersion": 1,
"slug": "workplace-safety-essentials",
"status": "ACTIVE",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | There is no draft to publish. Start one with POST /courses/{id}/versions. |
| 422 | The draft can't be published yet. The body's problems array lists everything to fix. |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X POST "$LMS_URL/api/v1/courses/$COURSE_ID/publish" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/publish`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/publish`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.post(f"{LMS_URL}/api/v1/courses/{course_id}/publish", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/publish"))
.header("X-API-Key", lmsKey)
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/publish")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/publish");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/publish", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}List versions
AccessAdmin, or an API key with the read or write scope.
Lists every version of the course, newest first, with its status (DRAFT, PUBLISHED or RETIRED) and publish time.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
[
{
"certificateTemplateId": "f9369757-51f7-4227-a2e1-3922edbd9bab",
"certificateValidityDays": 1,
"completionPercent": 80,
"completionPolicy": "ALL_REQUIRED",
"coverAssetId": "ce4ba24d-c68c-4c3d-aa93-d96cac1be0a9",
"description": "A short description.",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"number": 1,
"publishedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}
]Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X GET "$LMS_URL/api/v1/courses/$COURSE_ID/versions" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.get(f"{LMS_URL}/api/v1/courses/{course_id}/versions", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/versions"))
.header("X-API-Key", lmsKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/versions")
request = Net::HTTP::Get.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/versions");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/versions", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Start a new draft
AccessAdmin, or an API key with the write scope.
Copies the published version into a new draft, preserving each section's, lesson's and quiz's stableKey so progress can be related across versions. The copy gets new row ids.
A course has at most one draft and one published version at a time. Emits course.version.created.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"certificateTemplateId": "f9369757-51f7-4227-a2e1-3922edbd9bab",
"certificateValidityDays": 1,
"completionPercent": 80,
"completionPolicy": "ALL_REQUIRED",
"coverAssetId": "ce4ba24d-c68c-4c3d-aa93-d96cac1be0a9",
"description": "A short description.",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"number": 1,
"publishedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
| 409 | The course already has a draft, or has no published version to copy. |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X POST "$LMS_URL/api/v1/courses/$COURSE_ID/versions" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.post(f"{LMS_URL}/api/v1/courses/{course_id}/versions", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/versions"))
.header("X-API-Key", lmsKey)
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/versions")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/versions");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/versions", nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}Read a version as a tree
AccessAdmin, or an API key with the read or write scope.
Returns a whole version: metadata, sections, lessons, blocks and assessments. which is draft, published, or a version number such as 3. Any version can be read; only drafts can be edited.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| idrequired | path | string (uuid) | The id from a previous response. |
| whichrequired | path | string | draft, published, or a version number |
Responses
Example response
{
"assessments": [
{
"feedbackMode": "AFTER_ATTEMPT",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"instructions": "string",
"items": [
{
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"pointsOverride": 1.5,
"poolBankId": "2d96d03c-9296-457c-ae5b-8193fa93cc0c",
"poolDrawCount": 1,
"position": 0,
"questionVersionId": "feab681a-824d-43fa-a46a-64050ba5aed2"
}
],
"maxAttempts": 3,
"passPercent": 70,
"shuffleOptions": true,
"shuffleQuestions": true,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"timeLimitSeconds": 1,
"title": "Workplace Safety Essentials"
}
],
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"modules": [
{
"description": "A short description.",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"lessons": [
{
"blocks": [
{}
],
"completionMode": "MANUAL",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"isRequired": true,
"position": 0,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"title": "Workplace Safety Essentials",
"unlockMode": "OPEN"
}
],
"position": 0,
"stableKey": "adc0be0d-16e2-4bfd-a77c-ffacab0bd969",
"title": "Workplace Safety Essentials"
}
],
"slug": "workplace-safety-essentials",
"version": {
"certificateTemplateId": "f9369757-51f7-4227-a2e1-3922edbd9bab",
"certificateValidityDays": 1,
"completionPercent": 80,
"completionPolicy": "ALL_REQUIRED",
"coverAssetId": "ce4ba24d-c68c-4c3d-aa93-d96cac1be0a9",
"description": "A short description.",
"estimatedMinutes": 30,
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"number": 1,
"publishedAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE",
"summary": "Fire safety and everyday hazards.",
"title": "Workplace Safety Essentials"
}
}Errors
| Status | When |
|---|---|
| 401 | Missing, invalid or expired credentials. |
| 403 | Your credential is valid but isn't allowed to do this. |
| 404 | It doesn't exist, or it belongs to another tenant (the two look the same on purpose). |
Errors use RFC 9457 problem details.
COURSE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
WHICH=string
curl -X GET "$LMS_URL/api/v1/courses/$COURSE_ID/versions/$WHICH" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const which = "string"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions/${which}`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const LMS_KEY = process.env.LMS_KEY!
const courseId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const which = "string"
const res = await fetch(`${LMS_URL}/api/v1/courses/${courseId}/versions/${which}`, {
method: 'GET',
headers: { "X-API-Key": LMS_KEY },
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data: unknown = await res.json()import os
import requests
LMS_URL = os.environ["LMS_URL"]
HEADERS = {"X-API-Key": os.environ["LMS_KEY"]}
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
which = "string"
res = requests.get(f"{LMS_URL}/api/v1/courses/{course_id}/versions/{which}", headers=HEADERS, timeout=10)
res.raise_for_status()
data = res.json()import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Request {
public static void main(String[] args) throws Exception {
String lmsUrl = System.getenv("LMS_URL");
String lmsKey = System.getenv("LMS_KEY");
String courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
String which = "string";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/courses/" + courseId + "/versions/" + which))
.header("X-API-Key", lmsKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() >= 300) throw new IllegalStateException(response.statusCode() + " " + response.body());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
course_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
which = "string"
uri = URI("#{lms_url}/api/v1/courses/#{course_id}/versions/#{which}")
request = Net::HTTP::Get.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"))
response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(request) }
raise "#{response.code} #{response.body}" unless response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$courseId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$which = "string";
$ch = curl_init("$lmsUrl/api/v1/courses/{$courseId}/versions/{$which}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('LMS_KEY')],
]);
$response = curl_exec($ch);
if (curl_getinfo($ch, CURLINFO_RESPONSE_CODE) >= 300) {
throw new RuntimeException($response);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
courseId := "37386ae0-0ea5-44e0-a02e-161f807af560"
which := "string"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/courses/" + courseId + "/versions/" + which, nil)
req.Header.Set("X-API-Key", os.Getenv("LMS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
if res.StatusCode >= 300 {
panic(fmt.Sprintf("%d %s", res.StatusCode, data))
}
fmt.Println(string(data))
}