BrainCert LMS API: Developer Guide
The BrainCert LMS API allows you to integrate, automate, and extend the capabilities of your BrainCert LMS instance. With this API, you can programmatically manage users, groups, courses, live classes, bundles, tests, products, discounts, and more.
This guide focuses on two essentials:
-
How to generate and use your API key (with Domain ID).
-
The complete list of supported API calls across all LMS resources.
For event-driven triggers, see our Webhook Documentation.
Generating an API Key
Log in to your BrainCert LMS Admin Dashboard. Go to Global Settings → Basic Settings→ Create API Keys.
Copy the API Key and your Domain ID, and keep them secure.
API Endpoints (Supported Calls)
The BrainCert LMS API v1 provides a wide range of endpoints to manage your LMS resources. To make navigation easier, the endpoints are grouped into categories. Each category represents a type of resource (such as users, courses, or tests) and contains the common actions you can perform.
Users
Method | Endpoint | Action |
---|---|---|
POST | /users/create |
Create user |
DELETE | /users/delete |
Delete user |
POST | /users/list |
List users |
POST | /users/getuser |
Get user by ID |
GET | /users/getuserbyEmail/{email} |
Get user by email |
POST | /users/listUsersenrolledincourse |
Enrollment count in courses |
POST | /users/listUsersenrolledintest |
Enrollment count in tests |
POST | /users/listUsersenrolledinclass |
Enrollment count in classes |
Groups
Method | Endpoint | Action |
---|---|---|
POST | /groups/create |
Create group |
POST | /groups/addUser |
Add user to group |
POST | /groups/list |
List groups |
POST | /groups/listallusers |
List all users in group |
Courses
Method | Endpoint | Action |
---|---|---|
POST | /courses/create |
Create course |
PUT | /courses/update |
Update course |
DELETE | /courses/delete/{courseId} |
Delete course |
POST | /courses/list |
List courses |
GET | /courses/get/{courseId} |
Get course |
POST | /courses/enroll |
Enroll user |
POST | /courses/unenroll |
Unenroll user |
POST | /courses/publish/{courseId} |
Publish course |
POST | /courses/unpublish/{courseId} |
Unpublish course |
Live Classes
Method | Endpoint | Action |
---|---|---|
POST | /liveClasses/create |
Create live class |
POST | /liveClasses/enroll |
Enroll user in live class |
POST | /liveClasses/unenroll |
Unenroll user from live class |
POST | /liveClasses/list |
List live classes |
Bundles
Method | Endpoint | Action |
---|---|---|
POST | /bundles/enroll |
Enroll user in bundle |
POST | /bundles/unenroll |
Unenroll user from bundle |
POST | /bundles/list |
List bundles |
Tests
Method | Endpoint | Action |
---|---|---|
POST | /tests/create |
Create test |
PUT | /tests/{testId} |
Update test |
DELETE | /tests/{testId} |
Delete test |
POST | /tests/list |
List tests |
GET | /tests/{testId} |
Get test |
POST | /tests/enroll |
Enroll user |
POST | /tests/unenroll |
Unenroll user |
POST | /tests/publish/{testId} |
Publish test |
POST | /tests/unpublish/{testId} |
Unpublish test |
DELETE | /tests/removeFromCatalog/{testId} |
Remove test from catalog |
Products & Categories
Method | Endpoint | Action |
---|---|---|
GET | /products/list |
List products |
GET | /products/getproduct/{id} |
Get product by ID |
POST | /products/createProduct |
Create product |
PUT | /products/update/{id} |
Update product |
DELETE | /products/delete/{id} |
Delete product |
POST | /products/{id}/publish |
Publish product |
POST | /products/{id}/unpublish |
Unpublish product |
POST | /products/createProductCategory |
Create product category |
PUT | /products/product-categories/{id} |
Update product category |
DELETE | /products/product-categories/{id} |
Delete product category |
PUT | /products/{id}/price |
Update product price |
PUT | /products/{id}/shipping-charge |
Update shipping charge |
Shopping Cart & Pricing
Method | Endpoint | Action |
---|---|---|
POST | /shoppingCart/courses/addpricing |
Add course pricing |
POST | /shoppingCart/tests/addpricing |
Add test pricing |
POST | /shoppingCart/live-classes/addpricing |
Add live class pricing |
GET | /shoppingCart/courses/pricing/{id} |
List course pricing |
GET | /shoppingCart/tests/pricing/{id} |
List test pricing |
GET | /shoppingCart/live-classes/pricing/{id} |
List live class pricing |
DELETE | /shoppingCart/courses/deletepricing |
Remove course pricing |
DELETE | /shoppingCart/tests/deletepricing |
Remove test pricing |
DELETE | /shoppingCart/live-classes/deletepricing |
Remove live class pricing |
Discounts
Method | Endpoint | Action |
---|---|---|
GET | /discounts/globaldiscounts/list |
List global discounts |
GET | /discounts/courses/{id} |
List course discounts |
GET | /discounts/tests/{id} |
List test discounts |
GET | /discounts/live-classes/{id} |
List live class discounts |
POST | /discounts/addCourseDiscount |
Add course discount |
POST | /discounts/addTestDiscount |
Add test discount |
POST | /discounts/addLiveClassDiscount |
Add live class discount |
DELETE | /discounts/removeCourseDiscount/{id} |
Remove course discount |
DELETE | /discounts/removeTestDiscount/{id} |
Remove test discount |
DELETE | /discounts/removeLiveClassDiscount/{id} |
Remove live class discount |
Gamification
Method | Endpoint | Action |
---|---|---|
GET | /gamification/leaderboard |
Get leaderboard |
POST | /gamification/user-points |
Get user points |
POST | /gamification/user-badges |
Get user badges |
Authentication Example
Every request to the BrainCert LMS API must include two authentication headers:
-
Authorization: API_KEY
→ Your unique API key -
x-domain-id: DOMAIN_ID
→ The Domain ID of your LMS instance
Both must be sent with each request to ensure the API can verify who you are and which LMS instance you’re accessing.
Example: Create a User (cURL)
curl -X POST "https://lms.braincert.com/api/v1/users/create" \
-H "Authorization: API_KEY" \
-H "x-domain-id: DOMAIN_ID" \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"test@example.com"}'
{
"message": "User successfully created",
"id": 12345
}
Notes:
-
Always send requests over HTTPS to keep credentials secure.
-
Replace
API_KEY
andDOMAIN_ID
with your actual values from the LMS admin dashboard. -
Use
Content-Type: application/json
when sending data in the request body.
Error Reference
The API uses standard HTTP status codes with a JSON error body. The BrainCert LMS API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key or Domain ID is incorrect. |
403 | Forbidden -- You do not have permission to access this. |
404 | Not Found -- The requested resource could not be found. |
405 | Method Not Allowed -- You tried to access a resource with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't JSON. |
429 | Too Many Requests -- You have exceeded the rate limit. |
500 | Internal Server Error -- We had an issue on our server. |
503 | Service Unavailable -- We are temporarily offline for maintenance. |
Example error
{ "message": "Bad Request", "error": { "code": 400, "details": "<reason>" } }
API Basics: Getting Started
The BrainCert LMS API allows you to manage users, courses, tests, and more through simple REST endpoints. This section covers the fundamentals to help you quickly start building with the API.
API (Application Programming Interface)
An API is like a waiter in a restaurant. You (the client) tell the waiter what you want, and they bring your request to the kitchen (the server) and return your food (the response).
In software, an API lets different programs talk to each other. Instead of manually clicking in a web app, you send requests to the API, and it gives you structured data back.
Endpoint
An endpoint is a specific URL in the API that performs a certain function.
For example:
/users/create
→ Create a user/courses/list
→ Get a list of courses
Think of endpoints as doors leading to different services inside the LMS.
JSON (JavaScript Object Notation)
JSON is a lightweight format for sending data. It looks like a dictionary or a table, but written in a way computers can easily understand.
Example JSON:
This is easier for systems to exchange data than plain text.
HTTPS
HTTPS (HyperText Transfer Protocol Secure) is the secure way of sending requests over the internet. It encrypts your API calls so nobody can see your API key, Domain ID, or user data while it’s traveling between your app and BrainCert’s servers.
API Key
An API Key is like a secret password that proves you are allowed to use the API. Every request you send must include your key, or the API will reject you.
Domain ID
The Domain ID tells BrainCert which LMS instance you are working with (since BrainCert can host many). It’s like telling the post office which street your house is on, so they don’t deliver your mail to the wrong place.
Request vs. Response
Request → What you send to the API (includes endpoint, headers, and JSON data).
Response → What the API sends back (usually JSON).
Example request:
Example response:
Headers
Headers are extra information sent with a request. For BrainCert APIs you must always include:
Authorization: API_KEY
x-domain-id: DOMAIN_ID
These tell the server who you are and which LMS you belong to.
Status Codes
Every API response comes with an HTTP status code:
200
→ OK, success400
→ Bad request401
→ Unauthorized (wrong key/domain)404
→ Not found500
→ Server error
This helps you understand whether your request worked or failed.
Base URL
Most endpoints use the following base URL:
Note: In the examples provided, the base URL is shown explicitly within each section.
Authentication
API Key: Identify and authorize requests.
Domain ID: Route the request to your LMS instance.
Include both as headers on every request:
Authorization: <API_KEY>x-domain-id: <DOMAIN_ID>
Generate an API key in Global Settings → Basic Settings → API Key in your LMS admin.
Request/Response Format
Requests: JSON body unless noted.
Responses: JSON by default.
Recommended method:
POST
(even for reads) to protect secrets.
Canonical response envelope
{
"message": "Human-readable status",
"data": { /* object or array, endpoint-specific */ }
}
HTTP Status Codes
2xx on success; see Error Reference for failures.
Best Practices
Use Postman for exploration and collections.
Use a JSON formatter/extension when viewing responses in a browser.
Never expose API keys publicly or in URLs.
Common Headers
Header | Value | Required | Notes |
---|---|---|---|
Authorization | <API_KEY> | Yes | Your API key |
x-domain-id | <DOMAIN_ID> | Yes | Your LMS instance/domain identifier |
Content-Type | application/json | Yes* | Required when sending a JSON payload |
Response
curl -X POST "https://lms.braincert.com/api/v1/users/create" \
-H "Authorization: $API_KEY" \
-H "x-domain-id: $DOMAIN_ID" \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"test@example.com"}'