Docs API reference
Customers, licenses & members
Organizations, seats, invitations and who belongs where.
A customer is an organization. A license gives it a product with a number of seats. Managers invite people, and a role decides which courses they get. See Selling & onboarding.
13 endpoints · base path /api/v1
Accept an invitation
AccessPublic. The invitation token is the credential.
The invitee opens the emailed link and posts the token here. The token is the credential, so this endpoint is public.
- A new person must send
givenName,familyNameand a password of at least 10 characters. - If that email already has an account in the tenant, the password and names are ignored and the person simply joins.
On success the person is a member, their role's courses are enrolled, and a login token is returned. If seats are short the whole acceptance is rolled back and the invitation stays pending.
Request body application/json · AcceptRequest
| Field | Type | Notes |
|---|---|---|
| familyName | string | — |
| givenName | string | — |
| password | string | — |
| tokenrequired | string | min length 1 |
Example request body
{
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}Responses
Example response
{
"organizationId": "44b78147-d73b-4117-ab62-4292d9ca20db",
"token": {
"accessToken": "eyJhbGciOiJIUzI1NiJ9…",
"expiresInSeconds": 3600
},
"userId": "11f967df-4272-482f-ac0b-7bea76dd8093"
}Errors
| Status | When |
|---|---|
| 400 | The request was malformed or failed validation. errors lists each field. |
| 404 | The token isn't recognised. |
| 409 | There are no free seats right now. The invitation stays pending. |
| 410 | The invitation was already used, revoked or has expired. |
Errors use RFC 9457 problem details.
curl -X POST "$LMS_URL/api/v1/invitations/accept" \
-H "Content-Type: application/json" \
-d '{
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}'const LMS_URL = process.env.LMS_URL
const res = await fetch(`${LMS_URL}/api/v1/invitations/accept`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}),
})
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
const data = await res.json()const LMS_URL = process.env.LMS_URL!
const res = await fetch(`${LMS_URL}/api/v1/invitations/accept`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}),
})
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"]
res = requests.post(f"{LMS_URL}/api/v1/invitations/accept", json={
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…",
}, 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 body = """
{
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/invitations/accept"))
.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/invitations/accept")
request = Net::HTTP::Post.new(uri, "Content-Type" => "application/json")
request.body = {
"familyName" => "Chen",
"givenName" => "Maya",
"password" => "a long, unique passphrase",
"token" => "tok_3q2…",
}.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/invitations/accept");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
"familyName" => "Chen",
"givenName" => "Maya",
"password" => "a long, unique passphrase",
"token" => "tok_3q2…",
]),
]);
$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(`{
"familyName": "Chen",
"givenName": "Maya",
"password": "a long, unique passphrase",
"token": "tok_3q2…"
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/invitations/accept", body)
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))
}List customers
AccessAdmin, or an API key with the read or write scope.
Lists the tenant's organizations (the businesses or individuals who buy from you).
Responses
Example response
[
{
"createdAt": "2026-11-25T14:03:11Z",
"externalRef": "order-5001",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"kind": "BUSINESS",
"name": "Acme Company",
"status": "ACTIVE"
}
]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/organizations" \
-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/organizations`, {
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/organizations`, {
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/organizations", 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/organizations"))
.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/organizations")
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/organizations");
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/organizations", 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 customer
AccessAdmin, or an API key with the write scope.
Creates an organization. kind is BUSINESS (default) or INDIVIDUAL (a person buying for themselves). externalRef is your customer id and is unique per tenant.
Request body application/json · CreateOrganization
| Field | Type | Notes |
|---|---|---|
| externalRef | string | — |
| kind | string | matches BUSINESS|INDIVIDUAL |
| namerequired | string | min length 1 |
Example request body
{
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}Responses
Example response
{
"createdAt": "2026-11-25T14:03:11Z",
"externalRef": "order-5001",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"kind": "BUSINESS",
"name": "Acme Company",
"status": "ACTIVE"
}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 externalRef is already used by another customer. |
Errors use RFC 9457 problem details.
curl -X POST "$LMS_URL/api/v1/organizations" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const res = await fetch(`${LMS_URL}/api/v1/organizations`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}),
})
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/organizations`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}),
})
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/organizations", headers=HEADERS, json={
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company",
}, 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 = """
{
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations"))
.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/organizations")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"externalRef" => "order-5001",
"kind" => "BUSINESS",
"name" => "Acme Company",
}.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/organizations");
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([
"externalRef" => "order-5001",
"kind" => "BUSINESS",
"name" => "Acme Company",
]),
]);
$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(`{
"externalRef": "order-5001",
"kind": "BUSINESS",
"name": "Acme Company"
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/organizations", 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 customer
AccessAdmin, an API key with read or write, or a manager of that organization.
Returns the organization. A manager of the organization may read it; so may admins and keys.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"createdAt": "2026-11-25T14:03:11Z",
"externalRef": "order-5001",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"kind": "BUSINESS",
"name": "Acme Company",
"status": "ACTIVE"
}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.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X GET "$LMS_URL/api/v1/organizations/$ORG_ID" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.get(f"{LMS_URL}/api/v1/organizations/{org_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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId, 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))
}A customer's learner progress
AccessAdmin, an API key with read or write, or a manager of that organization.
A page of enrollments for one organization, with progress. This is what a customer's manager sees.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
| courseId | query | string (uuid) | — |
| userId | query | string (uuid) | — |
| status | query | string | matches ACTIVE|COMPLETED|EXPIRED|WITHDRAWN |
| limit | query | integer (int32) | — |
| offset | query | integer (int32) | — |
Responses
Example response
{
"items": [
{
"completedAt": "2026-11-25T14:03:11Z",
"courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
"courseSlug": "string",
"courseTitle": "Workplace Safety Essentials",
"dueAt": "2026-11-25T14:03:11Z",
"enrolledAt": "2026-11-25T14:03:11Z",
"expiresAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"lastActivityAt": "2026-11-25T14:03:11Z",
"learnerEmail": "maya.chen@example.com",
"learnerExternalRef": "string",
"learnerName": "Maya Chen",
"organizationId": "44b78147-d73b-4117-ab62-4292d9ca20db",
"progressPercent": 40,
"source": "ROLE",
"status": "ACTIVE",
"userId": "11f967df-4272-482f-ac0b-7bea76dd8093"
}
],
"total": 1
}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.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X GET "$LMS_URL/api/v1/organizations/$ORG_ID/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.get(f"{LMS_URL}/api/v1/organizations/{org_id}/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093", 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093")
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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/enrollments?courseId=ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561&userId=11f967df-4272-482f-ac0b-7bea76dd8093", 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 invitations
AccessAdmin, an API key with read or write, or a manager of that organization.
Lists invitations with status PENDING, ACCEPTED, REVOKED or EXPIRED. The token is never shown; it exists only in the email.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
[
{
"access": "MEMBER",
"createdAt": "2026-11-25T14:03:11Z",
"email": "maya.chen@example.com",
"expiresAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
"status": "ACTIVE"
}
]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.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X GET "$LMS_URL/api/v1/organizations/$ORG_ID/invitations" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.get(f"{LMS_URL}/api/v1/organizations/{org_id}/invitations", 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/invitations"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/invitations")
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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/invitations");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/invitations", 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))
}Invite someone
AccessAdmin, an API key with write, or a manager of that organization.
Emails an invitation. The inviter chooses the person's access and role up front. No account exists until they accept, so there are no placeholder users.
Invitations expire after 7 days. Only a hash of the token is stored.
Email delivery is a stand-in today: the message is logged (and written to the dev outbox if one is configured). Connect your provider behind the
Mailerinterface before going live.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · InviteRequest
| Field | Type | Notes |
|---|---|---|
| accessrequired | string | matches MANAGER|MEMBER |
| emailrequired | string (email) | min length 1 |
| roleId | string (uuid) | — |
Example request body
{
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}Responses
Example response
{
"access": "MEMBER",
"createdAt": "2026-11-25T14:03:11Z",
"email": "maya.chen@example.com",
"expiresAt": "2026-11-25T14:03:11Z",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
"status": "ACTIVE"
}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 | They're already a member, or there is already a pending invitation for that email. |
Errors use RFC 9457 problem details.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X POST "$LMS_URL/api/v1/organizations/$ORG_ID/invitations" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}),
})
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}),
})
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.post(f"{LMS_URL}/api/v1/organizations/{org_id}/invitations", headers=HEADERS, json={
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07",
}, 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
String body = """
{
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/invitations"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/invitations")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"email" => "tom@acme.example",
"access" => "MEMBER",
"roleId" => "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07",
}.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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/invitations");
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([
"email" => "tom@acme.example",
"access" => "MEMBER",
"roleId" => "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07",
]),
]);
$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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
body := strings.NewReader(`{
"email": "tom@acme.example",
"access": "MEMBER",
"roleId": "5c7d1a93-0e48-4b26-9f3a-2b8e6d4a1c07"
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/invitations", 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))
}Revoke an invitation
AccessAdmin, an API key with write, or a manager of that organization.
Cancels a pending invitation. The link stops working.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
| 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). |
Errors use RFC 9457 problem details.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
INVITATION_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/organizations/$ORG_ID/invitations/$INVITATION_ID" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const invitationId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations/${invitationId}`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const invitationId = "37386ae0-0ea5-44e0-a02e-161f807af560"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/invitations/${invitationId}`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
invitation_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
res = requests.delete(f"{LMS_URL}/api/v1/organizations/{org_id}/invitations/{invitation_id}", 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
String invitationId = "37386ae0-0ea5-44e0-a02e-161f807af560";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/invitations/" + invitationId))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
invitation_id = "37386ae0-0ea5-44e0-a02e-161f807af560"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/invitations/#{invitation_id}")
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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$invitationId = "37386ae0-0ea5-44e0-a02e-161f807af560";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/invitations/{$invitationId}");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
invitationId := "37386ae0-0ea5-44e0-a02e-161f807af560"
req, _ := http.NewRequest("DELETE", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/invitations/" + invitationId, 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
}List a customer's licenses
AccessAdmin, an API key with read or write, or a manager of that organization.
Lists licenses with their product, seats and seats in use, validity window and your externalRef (order id).
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
[
{
"endsAt": "2026-11-25T14:03:11Z",
"externalRef": "order-5001",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"productId": "96965701-7c48-40b1-a576-99888fcfb8cd",
"productName": "Complete Pack",
"seats": 25,
"seatsUsed": 3,
"startsAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE"
}
]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.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X GET "$LMS_URL/api/v1/organizations/$ORG_ID/licenses" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/licenses`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/licenses`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.get(f"{LMS_URL}/api/v1/organizations/{org_id}/licenses", 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/licenses"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/licenses")
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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/licenses");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/licenses", 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))
}Grant a license
AccessAdmin, or an API key with the write scope.
Gives the customer a product with a number of seats. This is the call your store makes after a purchase.
seatsis yours to set: omit it for unlimited, or use any number. One seat is used per person with an active enrollment under the license.- It is idempotent on
externalRef: replaying the same order returns the existing license with200instead of creating a second one (201means it was created). - Members who were waiting on a purchase are enrolled straight away.
Managers can't grant licenses, or they could give themselves seats.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · CreateLicense
| Field | Type | Notes |
|---|---|---|
| endsAt | string (date-time) | — |
| externalRef | string | — |
| productIdrequired | string (uuid) | — |
| seats | integer (int32) | min 1 |
| startsAt | string (date-time) | — |
Example request body
{
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}Responses
Example response
{
"endsAt": "2026-11-25T14:03:11Z",
"externalRef": "order-5001",
"id": "37386ae0-0ea5-44e0-a02e-161f807af560",
"productId": "96965701-7c48-40b1-a576-99888fcfb8cd",
"productName": "Complete Pack",
"seats": 25,
"seatsUsed": 3,
"startsAt": "2026-11-25T14:03:11Z",
"status": "ACTIVE"
}Errors
| Status | When |
|---|---|
| 400 | Unknown or archived product, or endsAt isn't after startsAt. |
| 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 | That externalRef is already used by a different license. |
Errors use RFC 9457 problem details.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X POST "$LMS_URL/api/v1/organizations/$ORG_ID/licenses" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/licenses`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}),
})
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/licenses`, {
method: 'POST',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}),
})
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.post(f"{LMS_URL}/api/v1/organizations/{org_id}/licenses", headers=HEADERS, json={
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001",
}, 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
String body = """
{
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/licenses"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/licenses")
request = Net::HTTP::Post.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"productId" => "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats" => 25,
"endsAt" => "2027-11-25T00:00:00Z",
"externalRef" => "order-5001",
}.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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/licenses");
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([
"productId" => "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats" => 25,
"endsAt" => "2027-11-25T00:00:00Z",
"externalRef" => "order-5001",
]),
]);
$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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
body := strings.NewReader(`{
"productId": "8e5a2d17-3f60-4b94-b1c8-6a0d9e4f2713",
"seats": 25,
"endsAt": "2027-11-25T00:00:00Z",
"externalRef": "order-5001"
}`)
req, _ := http.NewRequest("POST", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/licenses", 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))
}List a customer's people
AccessAdmin, an API key with read or write, or a manager of that organization.
Lists members with their access level (MANAGER or MEMBER), role and status.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
[
{
"access": "MEMBER",
"email": "maya.chen@example.com",
"familyName": "Chen",
"givenName": "Maya",
"joinedAt": "2026-11-25T14:03:11Z",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
"roleKey": "team_lead",
"status": "ACTIVE",
"userId": "11f967df-4272-482f-ac0b-7bea76dd8093"
}
]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.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
curl -X GET "$LMS_URL/api/v1/organizations/$ORG_ID/members" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members`, {
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members`, {
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
res = requests.get(f"{LMS_URL}/api/v1/organizations/{org_id}/members", 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/members"))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/members")
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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/members");
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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
req, _ := http.NewRequest("GET", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/members", 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))
}Change a member's access or role
AccessAdmin, an API key with write, or a manager of that organization.
Sets the member's access and roleId (omit roleId for no role), then recalculates their enrollments from the new role. If the new role's courses can't all be given because seats are short, nothing changes and you get 409.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
| userIdrequired | path | string (uuid) | The id from a previous response. |
Request body application/json · UpdateMember
| Field | Type | Notes |
|---|---|---|
| accessrequired | string | matches MANAGER|MEMBER |
| roleId | string (uuid) | — |
Example request body
{
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}Responses
Example response
{
"courseIdsWithoutSeat": [
"1adbf417-2b63-42e7-ae43-d462a19ea16b"
],
"enrolled": 1,
"withdrawn": 1
}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 change would leave the organization with no manager, or there aren't enough seats. |
Errors use RFC 9457 problem details.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
USER_ID=11f967df-4272-482f-ac0b-7bea76dd8093
curl -X PUT "$LMS_URL/api/v1/organizations/$ORG_ID/members/$USER_ID" \
-H "X-API-Key: $LMS_KEY" \
-H "Content-Type: application/json" \
-d '{
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}'const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const userId = "11f967df-4272-482f-ac0b-7bea76dd8093"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members/${userId}`, {
method: 'PUT',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}),
})
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const userId = "11f967df-4272-482f-ac0b-7bea76dd8093"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members/${userId}`, {
method: 'PUT',
headers: { "X-API-Key": LMS_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}),
})
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
user_id = "11f967df-4272-482f-ac0b-7bea76dd8093"
res = requests.put(f"{LMS_URL}/api/v1/organizations/{org_id}/members/{user_id}", headers=HEADERS, json={
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
}, 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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
String userId = "11f967df-4272-482f-ac0b-7bea76dd8093";
String body = """
{
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}
""";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/members/" + userId))
.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")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
user_id = "11f967df-4272-482f-ac0b-7bea76dd8093"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/members/#{user_id}")
request = Net::HTTP::Put.new(uri, "X-API-Key" => ENV.fetch("LMS_KEY"), "Content-Type" => "application/json")
request.body = {
"access" => "MEMBER",
"roleId" => "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
}.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');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$userId = "11f967df-4272-482f-ac0b-7bea76dd8093";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/members/{$userId}");
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([
"access" => "MEMBER",
"roleId" => "164531fc-5f9b-4b3c-a928-1cd38aeed2cc",
]),
]);
$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() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
userId := "11f967df-4272-482f-ac0b-7bea76dd8093"
body := strings.NewReader(`{
"access": "MEMBER",
"roleId": "164531fc-5f9b-4b3c-a928-1cd38aeed2cc"
}`)
req, _ := http.NewRequest("PUT", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/members/" + userId, 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))
}Remove a member
AccessAdmin, an API key with write, or a manager of that organization.
Marks the member as removed and withdraws the enrollments they got through this organization. Their account, history and certificates are kept.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
| orgIdrequired | path | string (uuid) | The id from a previous response. |
| userIdrequired | path | string (uuid) | The id from a previous response. |
Responses
Example response
{
"courseIdsWithoutSeat": [
"1adbf417-2b63-42e7-ae43-d462a19ea16b"
],
"enrolled": 1,
"withdrawn": 1
}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 | They are the organization's last manager. |
Errors use RFC 9457 problem details.
ORG_ID=b0cf4f3c-49ad-447c-a8f9-cc936c447f0c
USER_ID=11f967df-4272-482f-ac0b-7bea76dd8093
curl -X DELETE "$LMS_URL/api/v1/organizations/$ORG_ID/members/$USER_ID" \
-H "X-API-Key: $LMS_KEY"const LMS_URL = process.env.LMS_URL
const LMS_KEY = process.env.LMS_KEY
const orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const userId = "11f967df-4272-482f-ac0b-7bea76dd8093"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members/${userId}`, {
method: 'DELETE',
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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
const userId = "11f967df-4272-482f-ac0b-7bea76dd8093"
const res = await fetch(`${LMS_URL}/api/v1/organizations/${orgId}/members/${userId}`, {
method: 'DELETE',
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"]}
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
user_id = "11f967df-4272-482f-ac0b-7bea76dd8093"
res = requests.delete(f"{LMS_URL}/api/v1/organizations/{org_id}/members/{user_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 orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
String userId = "11f967df-4272-482f-ac0b-7bea76dd8093";
var request = HttpRequest.newBuilder(URI.create(lmsUrl + "/api/v1/organizations/" + orgId + "/members/" + userId))
.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());
System.out.println(response.body());
}
}require "net/http"
require "json"
lms_url = ENV.fetch("LMS_URL")
org_id = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
user_id = "11f967df-4272-482f-ac0b-7bea76dd8093"
uri = URI("#{lms_url}/api/v1/organizations/#{org_id}/members/#{user_id}")
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)
data = JSON.parse(response.body)<?php
$lmsUrl = getenv('LMS_URL');
$orgId = "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c";
$userId = "11f967df-4272-482f-ac0b-7bea76dd8093";
$ch = curl_init("$lmsUrl/api/v1/organizations/{$orgId}/members/{$userId}");
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);
}
$data = json_decode($response, true);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
orgId := "b0cf4f3c-49ad-447c-a8f9-cc936c447f0c"
userId := "11f967df-4272-482f-ac0b-7bea76dd8093"
req, _ := http.NewRequest("DELETE", os.Getenv("LMS_URL") + "/api/v1/organizations/" + orgId + "/members/" + userId, 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))
}