Docs API reference

Products & roles

What you sell, and what each kind of learner gets.

A product is a bundle of courses you sell. A role is your own label (like "Sales") with an explicit list of courses. See Selling & onboarding.

6 endpoints · base path /api/v1

GET/api/v1/member-roles#

List roles

AccessA signed-in user (the learner's own login token).

Lists the tenant's roles ("Sales", "Support" and so on). Roles are yours to define.

Responses

200OK· list of RoleView
Example response
[
  {
    "description": "A short description.",
    "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
    "key": "team_lead",
    "name": "Acme Company",
    "status": "ACTIVE"
  }
]

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.

Errors use RFC 9457 problem details.

curl -X GET "$LMS_URL/api/v1/member-roles" \
  -H "Authorization: Bearer $LMS_TOKEN"
POST/api/v1/member-roles#

Create a role

AccessA signed-in user (the learner's own login token).

A role is a label with an explicit list of courses. key is its stable machine name: lowercase letters, digits and underscores, starting with a letter.

Roles are separate from permissions: a role only decides which courses someone gets.

Request body application/json · CreateRole

FieldTypeNotes
descriptionstring—
keyrequiredstringmatches [a-z][a-z0-9_]{0,62}; min length 1
namerequiredstringmin length 1
Example request body
{
  "description": "A short description.",
  "key": "team_lead",
  "name": "Acme Company"
}

Responses

201Created· RoleView
Example response
{
  "description": "A short description.",
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
  "key": "team_lead",
  "name": "Acme Company",
  "status": "ACTIVE"
}

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
409The key is already used.

Errors use RFC 9457 problem details.

curl -X POST "$LMS_URL/api/v1/member-roles" \
  -H "Authorization: Bearer $LMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "description": "A short description.",
  "key": "team_lead",
  "name": "Acme Company"
}'
GET/api/v1/member-roles/{id}/courses#

List a role's courses

AccessA signed-in user (the learner's own login token).

Returns the courses the role gets, with each assignment's due and access windows and its removal policy.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Responses

200OK· list of Assignment
Example response
[
  {
    "accessDays": 1,
    "courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
    "dueAfterDays": 1,
    "onRoleRemoved": "string"
  }
]

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

MEMBER_ROLE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X GET "$LMS_URL/api/v1/member-roles/$MEMBER_ROLE_ID/courses" \
  -H "Authorization: Bearer $LMS_TOKEN"
PUT/api/v1/member-roles/{id}/courses#

Set a role's courses

AccessA signed-in user (the learner's own login token).

Replaces the role's course assignments, then updates everyone who holds the role:

  • they are enrolled in newly added courses, if their organization has a license that includes the course and a free seat
  • courses removed from a WITHDRAW assignment are withdrawn from holders; with KEEP they stay

The response counts how many enrollments were added and withdrawn, and how many couldn't be enrolled for lack of seats.

Parameters

NameInTypeNotes
idrequiredpathstring (uuid)The id from a previous response.

Request body application/json · ReplaceAssignments

FieldTypeNotes
assignmentsrequiredAssignmentInput[]—
Example request body
{
  "assignments": [
    {
      "courseId": "4b2e8f90-1d73-4c5a-9e06-a8f1d3b7c254",
      "dueAfterDays": 30,
      "accessDays": 365,
      "onRoleRemoved": "KEEP"
    }
  ]
}

Responses

Example response
{
  "assignments": [
    {
      "accessDays": 1,
      "courseId": "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561",
      "dueAfterDays": 1,
      "onRoleRemoved": "string"
    }
  ],
  "enrolled": 1,
  "seatShortages": 1,
  "withdrawn": 1
}

Errors

StatusWhen
400A duplicate or unknown course id.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
404It doesn't exist, or it belongs to another tenant (the two look the same on purpose).

Errors use RFC 9457 problem details.

MEMBER_ROLE_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X PUT "$LMS_URL/api/v1/member-roles/$MEMBER_ROLE_ID/courses" \
  -H "Authorization: Bearer $LMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "assignments": [
    {
      "courseId": "4b2e8f90-1d73-4c5a-9e06-a8f1d3b7c254",
      "dueAfterDays": 30,
      "accessDays": 365,
      "onRoleRemoved": "KEEP"
    }
  ]
}'
GET/api/v1/products#

List products

AccessAdmin, or an API key with the read or write scope.

Lists products with the ids of the courses each contains.

Responses

200OK· list of ProductView
Example response
[
  {
    "courseIds": [
      "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561"
    ],
    "createdAt": "2026-11-25T14:03:11Z",
    "externalRef": "order-5001",
    "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
    "name": "Acme Company",
    "slug": "workplace-safety-essentials",
    "status": "ACTIVE"
  }
]

Errors

StatusWhen
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.

Errors use RFC 9457 problem details.

curl -X GET "$LMS_URL/api/v1/products" \
  -H "X-API-Key: $LMS_KEY"
POST/api/v1/products#

Create a product

AccessAdmin, or an API key with the write scope.

A product is a named bundle of courses you sell. externalRef is optional and is meant for your store's SKU, so you can match a purchase to a product.

Products can't be edited yet; create a new one if the bundle changes.

Request body application/json · CreateProduct

FieldTypeNotes
courseIdsrequiredstring (uuid)[]min 1 item
externalRefstring—
namerequiredstringmin length 1
slugrequiredstringmatches [a-z0-9][a-z0-9-]{0,100}; min length 1
Example request body
{
  "slug": "complete-pack",
  "name": "Complete Pack",
  "externalRef": "SKU-COMPLETE",
  "courseIds": [
    "4b2e8f90-1d73-4c5a-9e06-a8f1d3b7c254"
  ]
}

Responses

201Created· ProductView
Example response
{
  "courseIds": [
    "ecec91e5-4eb9-4c55-a6a7-b3c44ebe7561"
  ],
  "createdAt": "2026-11-25T14:03:11Z",
  "externalRef": "order-5001",
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
  "name": "Acme Company",
  "slug": "workplace-safety-essentials",
  "status": "ACTIVE"
}

Errors

StatusWhen
400One or more courseIds don't exist.
401Missing, invalid or expired credentials.
403Your credential is valid but isn't allowed to do this.
409The slug or externalRef is already in use.

Errors use RFC 9457 problem details.

curl -X POST "$LMS_URL/api/v1/products" \
  -H "X-API-Key: $LMS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "slug": "complete-pack",
  "name": "Complete Pack",
  "externalRef": "SKU-COMPLETE",
  "courseIds": [
    "4b2e8f90-1d73-4c5a-9e06-a8f1d3b7c254"
  ]
}'

Type to search guides and every endpoint.