Docs API reference

Authentication & tenants

Sign in, API keys, and creating tenants.

Every request acts for exactly one tenant, which comes from the credential: a login token or an API key. There is no tenant header to forge. See the Authentication guide for the full model.

7 endpoints · base path /api/v1

GET/api/v1/api-keys#

List API keys

AccessAdmin user only. API keys cannot do this.

Lists the tenant's API keys with their name, public prefix, scopes, expiry, last use and revocation time. The secret and its hash are never returned.

Responses

200OK· list of ApiKeyView
Example response
[
  {
    "createdAt": "2026-11-25T14:03:11Z",
    "expiresAt": "2026-11-25T14:03:11Z",
    "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
    "lastUsedAt": "2026-11-25T14:03:11Z",
    "name": "Acme Company",
    "prefix": "nbl_ab12cd34",
    "revokedAt": "2026-11-25T14:03:11Z",
    "scopes": [
      "read",
      "write"
    ]
  }
]

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/api-keys" \
  -H "Authorization: Bearer $LMS_TOKEN"
POST/api/v1/api-keys#

Create an API key

AccessAdmin user only. API keys cannot do this.

Creates a key for server-to-server use. scopes is a list drawn from read and write (write also allows reading). expiresAt is optional.

The full key is returned once, in secretKey (nbl_<prefix>.<secret>). Only a hash is stored, so it can't be shown again. Send it as the X-API-Key header.

Keys can't create or revoke other keys; that needs a signed-in admin.

Request body application/json · CreateRequest

FieldTypeNotes
expiresAtstring (date-time)—
namerequiredstringmin length 1
scopesrequiredstring[]items match read|write; min 1 item
Example request body
{
  "name": "Website checkout",
  "scopes": [
    "read",
    "write"
  ]
}

Responses

201Created· CreatedApiKey
Example response
{
  "key": {
    "createdAt": "2026-11-25T14:03:11Z",
    "expiresAt": "2026-11-25T14:03:11Z",
    "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
    "lastUsedAt": "2026-11-25T14:03:11Z",
    "name": "Acme Company",
    "prefix": "nbl_ab12cd34",
    "revokedAt": "2026-11-25T14:03:11Z",
    "scopes": [
      "read",
      "write"
    ]
  },
  "secretKey": "nbl_ab12cd34.3q2…"
}

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.

Errors use RFC 9457 problem details.

curl -X POST "$LMS_URL/api/v1/api-keys" \
  -H "Authorization: Bearer $LMS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Website checkout",
  "scopes": [
    "read",
    "write"
  ]
}'
DELETE/api/v1/api-keys/{id}#

Revoke an API key

AccessAdmin user only. API keys cannot do this.

Revokes a key immediately. Revoking an already revoked key is fine and returns 204 again.

Parameters

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

Responses

204No Content

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.

API_KEY_ID=37386ae0-0ea5-44e0-a02e-161f807af560
curl -X DELETE "$LMS_URL/api/v1/api-keys/$API_KEY_ID" \
  -H "Authorization: Bearer $LMS_TOKEN"
GET/api/v1/audit-log#

List the audit log

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

The history of changes made through the API: who made each one (a signed-in user or an API key), what they did, which record it touched, and the request body with secrets removed. Newest first.

Every successful POST, PUT, PATCH and DELETE is recorded, including issuing learner tokens and creating licenses. Reads, failed requests and learners' own progress are not. Entries can't be edited or deleted.

Admins only: an API key can't read the log, so a leaked key can't be used to check what it was used for. Filter by entityType (the first part of the route, like organizations), entityId, actorId, action (contains match, like licenses), and a from/to time range.

Parameters

NameInTypeNotes
entityTypequerystring—
entityIdquerystring (uuid)—
actorIdquerystring (uuid)—
actionquerystring—
fromquerystring (date-time)—
toquerystring (date-time)—
limitqueryinteger (int32)—
offsetqueryinteger (int32)—

Responses

200OK· EntryPage
Example response
{
  "items": [
    {
      "action": "string",
      "actorId": "3c94fe17-180d-4ce7-aedf-8a62124da36b",
      "actorType": "string",
      "changes": {},
      "entityId": "81693677-5a0d-4747-a284-49422f7ba84b",
      "entityType": "string",
      "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
      "ip": "string",
      "occurredAt": "2026-11-25T14:03:11Z"
    }
  ],
  "total": 1
}

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/audit-log?entityType=string&entityId=81693677-5a0d-4747-a284-49422f7ba84b" \
  -H "X-API-Key: $LMS_KEY"
POST/api/v1/auth/login#

Sign in

AccessPublic. The credentials are in the request body.

Exchanges an organisation code (your tenant's slug), an email and a password for a short-lived access token. Send it on later requests as Authorization: Bearer <token>.

Every failure returns the same 401: wrong password, unknown email, unknown organisation, suspended account. The endpoint can't be used to discover who has an account.

Tokens last one hour (expiresInSeconds). There are no refresh tokens yet, so sign in again when one expires.

Request body application/json · LoginRequest

FieldTypeNotes
emailrequiredstringmin length 1
passwordrequiredstringmin length 1
tenantrequiredstringmin length 1
Example request body
{
  "email": "maya.chen@example.com",
  "password": "a long, unique passphrase",
  "tenant": "acme"
}

Responses

200OK· Issued
Example response
{
  "accessToken": "eyJhbGciOiJIUzI1NiJ9…",
  "expiresInSeconds": 3600
}

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401Invalid credentials. The message is deliberately identical for every kind of failure.

Errors use RFC 9457 problem details.

curl -X POST "$LMS_URL/api/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "maya.chen@example.com",
  "password": "a long, unique passphrase",
  "tenant": "acme"
}'
GET/api/v1/auth/me#

Who am I?

AccessAny signed-in user or API key.

Returns the tenant the credential belongs to, whether the caller is a USER or an API_KEY, its id, and its authorities (for example ROLE_ADMIN or SCOPE_write). A quick way to check that a key works and what it may do.

Responses

200OK· Me
Example response
{
  "authorities": [
    "string"
  ],
  "id": "37386ae0-0ea5-44e0-a02e-161f807af560",
  "tenantId": "672af6a0-5fa6-44a0-a3ab-2c5fc28d9e20",
  "type": "USER"
}

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/auth/me" \
  -H "Authorization: Bearer $LMS_TOKEN"
POST/api/v1/platform/tenants#

Create a tenant

AccessPlatform token, sent as X-Platform-Token.

Operator-level endpoint that creates a new tenant together with its first administrator. It is guarded by a static platform token sent as X-Platform-Token. If the server has no PLATFORM_TOKEN configured, this endpoint does not exist and returns 404.

slug is the tenant's login code: lowercase letters, digits and dashes. The admin password must be at least 10 characters.

Request body application/json · CreateTenantRequest

FieldTypeNotes
adminEmailrequiredstring (email)min length 1
adminFamilyNamerequiredstringmin length 1
adminGivenNamerequiredstringmin length 1
adminPasswordrequiredstringmin length 10; max length 200
namerequiredstringmin length 1
slugrequiredstringmatches [a-z0-9][a-z0-9-]{1,62}; min length 1
Example request body
{
  "adminEmail": "string",
  "adminFamilyName": "string",
  "adminGivenName": "string",
  "adminPassword": "string",
  "name": "Acme Company",
  "slug": "workplace-safety-essentials"
}

Responses

201Created· CreatedTenant
Example response
{
  "adminUserId": "5400b7fa-3e2a-4dda-a34a-aa6505e50532",
  "tenantId": "672af6a0-5fa6-44a0-a3ab-2c5fc28d9e20"
}

Errors

StatusWhen
400The request was malformed or failed validation. errors lists each field.
401The platform token is missing or wrong.
404The server has no platform token configured, so tenant creation is switched off.
409That slug is already taken.

Errors use RFC 9457 problem details.

curl -X POST "$LMS_URL/api/v1/platform/tenants" \
  -H "X-Platform-Token: $PLATFORM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "adminEmail": "string",
  "adminFamilyName": "string",
  "adminGivenName": "string",
  "adminPassword": "string",
  "name": "Acme Company",
  "slug": "workplace-safety-essentials"
}'

Type to search guides and every endpoint.