Knowledge Anywhere Public API
The Knowledge Anywhere Public LMS API is provided to you in order to assist you in provisioning users and connect external applications to the Knowledge Anywhere LMS.
What You Can Do with the Public API
Use the Public API to:
- Provision users (create/update/deactivate)
- Query users (by external ID, email, SSO ID, or in bulk)
- Report on completions (retrieve course completion data)
Accessing LMS API Documentation
To obtain your API client credentials and documentation, sign into the LMS Admin Panel > access the Settings page > under the Integrations header, select Public API Keys > a Documentation link will be on the right above the table. This is unique to your LMS.
This documentation is always the most current reference for available fields, parameters, and response formats.
Note: Only a global admin can access the API documentation and credentials.
Base URL
All endpoints are hosted under:
https://LMSNAME.knowledgeanywhere.com/api
Replace LMSNAME with your organization's LMS subdomain.
Authentication
Bearer token on every request
All API calls require an Authorization header containing a Bearer token.
Token retrieval (client credentials)
The API uses an OAuth 2.0 Client Credentials flow to retrieve an access token. You will need the Client ID and Client Secret found on the Public API Keys page in your Admin Panel.
Token endpoint:
POST /auth/token
Access tokens do expire after a set period. If you receive a 401 Unauthorized response, simply request a new token and retry your request.
Example — calling an endpoint with a bearer token
Example request:
GET https://LMSNAME.knowledgeanywhere.com/api/v2/users?offset=0
Example headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Note: All POST and PUT requests require the Content-Type: application/json header.
TLS Requirements
- TLS 1.0 and 1.1 are not supported
- Recommended: TLS 1.2 or higher
- If you attempt to connect using TLS 1.1 or lower, you may receive a generic connection error
Rate Limiting
- Default limit: 100 requests per minute
- If you exceed the limit within a 60-second window, the API returns: 429 — Too Many Requests
- Additional requests may be blocked for up to one minute
Rate-limit headers returned on responses:
- X-RATE-LIMIT-LIMIT — the maximum number of requests allowed in the current window
- X-RATE-LIMIT-REMAINING — remaining requests in the current window (-1 indicates the limit has been exceeded)
- X-RATE-LIMIT-RETRY-AFTER — when the rate limit will reset (available when the limit has been exceeded)
If you need a higher rate limit for your integration, please contact support@knowledgeanywhere.com.
Paging (Bulk Endpoints)
For bulk queries, responses are limited to 1,000 records per request by default.
Use the offset parameter to page through results:
- Start with offset=0 (or omit it)
- Increase by 1,000 for the next page (example: offset=1000, then offset=2000, etc.)
- When a response returns fewer than 1,000 records, you've reached the last page
In simpler terms, think of offset as a starting point — it tells the API how many records to skip before returning the next batch of 1,000.
A Note on Date Formats
The API accepts dates in two different formats depending on the endpoint type:
- GET requests (query parameters): Dates should be sent as Unix timestamps in milliseconds (example: 1704067200000 for January 1, 2024)
- POST requests (JSON body): Dates should be sent in ISO 8601 format (example: "2024-01-01T00:00:00Z")
A Note on Case Sensitivity
Email and externalId lookups are case-insensitive. For example, learner@example.com and Learner@Example.com will match the same user.
Endpoints Overview
A. User Management (Provisioning)
Create a user
Endpoint:
POST /v2/user
Creates a new user.
Minimum required fields:
- externalId (unique) — this is your organization's unique identifier for the user, such as an employee ID or HR system ID
- email (unique)
- firstName
- lastName
Notes:
- If no password is provided, the user will need to use your LMS sign-in process (such as SSO or a password reset) to access their account.
- You can optionally assign users to a group by including a registrationCode — this is the code associated with a registration group in your LMS.
- Custom profile fields can be included using the customFields array. The name must match an existing custom field in your LMS exactly.
- If you try to create a user with an externalId or email that already exists, the API will return a 400 error with a message like ERROR_EXTERNALID_EXISTS or ERROR_EMAIL_EXISTS.
Example request body:
{
"externalID": "E12345",
"email": "learner@example.com",
"firstName": "Pat",
"lastName": "Lee",
"active": true,
"registrationCode": "ABC-123",
"customFields": [
{ "name": "Department", "value": "Operations" }
]
}
A successful response returns a 200 status code with a confirmation message:
{
"message": "USER_PROVISION_SUCCESS",
"warnings": [],
"hasWarnings": false
}
If something was partially off (for example, an unrecognized country or locale), the response may still succeed but include warnings in the warnings array with hasWarnings set to true.
Update a user
Endpoint:
PUT /v2/user/{externalId}
Updates an existing user. Partial updates are supported — include only the fields you want to change.
Important:
- externalId cannot be updated.
- email can be updated when the user is identified by their externalId in the URL. If the new email is already in use by another user, the request will fail.
Deactivate a user
Endpoint:
DELETE /v2/user/{externalId}
Deactivates (inactivates) a user. The user's data and completion history are preserved, but they will no longer be able to sign in. Deactivated users do not count toward your active user total.
B. User Queries
Get a user by external ID
Endpoint:
GET /v2/user/{externalId}
Returns a single user matching the externalId.
List/search users (GET)
Endpoint:
GET /v2/users
Returns up to 1,000 users per request. Use offset to page.
Common query parameters:
- externalids — filter by one or more external IDs
- ssoids — filter by SSO identifiers (the unique ID from your SAML single sign-on system used to match users at login)
- emails — filter by email address (supports partial matching, so searching for example.com would return all users with that domain)
- startdate — return users created or modified on or after this date (Unix timestamp in milliseconds)
- enddate — return users created or modified on or before this date (Unix timestamp in milliseconds)
- offset — number of records to skip (for paging)
- includeinactive — set to true to include deactivated users
Example request:
GET https://LMSNAME.knowledgeanywhere.com/api/v2/users?includeinactive=false&offset=0
Example header:
Authorization: Bearer YOUR_ACCESS_TOKEN
List/search users (POST)
Endpoint:
POST /v2/users
Provides an alternative way to search users by sending search criteria in a JSON body (useful when your query would be too large for URL parameters). Returns up to 1,000 users per request.
Example request body:
{
"externalIds": "E12345,E67890,E11111",
"emails": "example.com",
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-12-31T23:59:59Z",
"offset": 0,
"includeInactive": false
}
Note: When using the POST version, dates are sent in ISO 8601 format (not Unix timestamps).
C. Course Completions (Reporting)
Search course completions (bulk)
Endpoint:
POST /v2/usercourses
Search and retrieve course completion records across your organization (up to 1,000 per request). Use offset to page through results.
Example request body:
{
"startDate": "2024-01-01T00:00:00Z",
"endDate": "2024-12-31T23:59:59Z",
"courseIDs": "1,45,3433",
"courseStatus": "1",
"offset": 0
}
- courseIDs — comma-separated list of course IDs to filter by
- courseStatus — "1" for active courses only, "0" for inactive only
- customUserFieldFilter — filter results by a custom user field value (example: "Department=Engineering")
Refer to your API documentation for the full list of available search filters and response fields.
Get all course completions for a learner
Endpoint:
GET /v2/user/{emailAddress}/courses
Returns all course completion records for the specified learner email address.
Get a specific course completion
Endpoint:
GET /v2/user/{emailAddress}/courses/{courseFriendlyUrl}
Returns completion details for a specific course for the specified learner email address.
Common Response Codes & Error Format
Common HTTP response codes include:
- 200 — Success
- 400 — Bad Request (missing or invalid fields, duplicate externalId or email)
- 401 — Unauthorized (token is missing, invalid, or expired)
- 404 — Not Found (the requested user or resource does not exist)
- 429 — Too Many Requests (rate limit exceeded)
- 500 — Internal Server Error
When an error response body is returned, it includes:
- statusCode (integer)
- message (string)
Support
Knowledge Anywhere suggests downloading and using Postman to make test API requests.
For the latest endpoint details, field definitions, and response schemas, check the API documentation in your LMS Admin Panel under Settings > Public API Keys > Documentation.
For more help with API credentials, troubleshooting, or rate-limit adjustments, please contact support@knowledgeanywhere.com.