TABLE OF CONTENTS
- NexSIS API Introduction
- Requests
- Responses
- Health Checks
- Courses
- Users
- Enrolments
- Course Groups
- Course Completions
- Grades
- Metalinks
- Programs
- Certifications
- Job Assignments
- Direct Managers
- Logs
- Errors
NexSIS API Introduction
MoodleUS NexSIS API is a RESTful API that facilitates realtime integrations between Moodle and 3rd party systems, especially management information systems such as student information systems (SIS), human resources information systems (HRIS), and customer relationship management systems (CRM).
Why not Moodle core external services?
It is true that Moodle comes with external services available out of the box. These work well for their specific purpose; however, we have found that they are neither well geared towards nor designed for integration with a management information system. For example, they do not facilitate bulk operations, and they operate on the unique identifiers of the Moodle system.
MoodleUS has designed the NexSIS API from the ground up. Some of the key differences with Moodle's built-in external services are:
Simpler, more streamlined API calls geared towards a management information system
Facilitation of both individual and bulk operations
Operations performed on the unique identifiers of the external system
Requests
Authentication
Header authentication example:
GET /enrol/nexsis/api/index.php/ping HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Query parameter example:
GET /enrol/nexsis/api/index.php/ping?token={token} HTTP/1.1
Host: example.moodle.com
Accept: */*
NexSIS uses API keys to allow access to the API. You can enable the API and generate an API Key in the plugin's Moodle administration area.
NexSIS expects for the API key to be included in all API requests to the service. You have the option of passing the key in an Authorization header or as a query parameter named token.
The authorization header must follow the following format, where {token} is your API key:
Authorization: Bearer {token}
You must replace {token} with your API key.
HTTP Verbs
NexSIS API is a RESTful API and operates using the standard HTTP verbs. A brief description of each follows:
NexSIS considers the management information system to be the master record of some resources. Therefore, those resources do not support the POST verb. Since the resources already exist and have a unique identifier, and Moodle just has a copy of the resource, both Moodle creation and update use the PUT verb.
Sending Data
Example request (JSON):
PUT /enrol/nexsis/api/index.php/enpoint HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"param1": "value1",
"param2": "value2",
}
Example request (URL-encoded):
PUT /enrol/nexsis/api/index.php/enpoint HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/x-www-form-urlencoded
param1=value1¶m2=value2
When sending data to the API, you can choose whether to send data in JSON or in URL-encoded format.
When sending JSON data, be sure to set the Content-Type header to application/json.
Responses
Unless otherwise noted or specified, all responses from the NexSIS API are JSON encoded format.
Health Checks
Ping
Endpoint:
GET /enrol/nexsis/api/index.php/ping
Example request:
GET /enrol/nexsis/api/index.php/ping HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"message": "pong"
}
This endpoint can be used to ping the API in order to determine its operational status.
Courses
Get a Course
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}
Example request:
GET /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"courseid": "C789",
"fullname": "Principles of API Design",
"shortname": "TECH-231"
"startdate": "2017-08-16T21:09:30+00:00",
"categorypath": "/Technology/Design/Modern Programming"
}
This endpoint retrieves a course.
URL Parameters:
Create/Update a Course
Endpoint:
PUT /enrol/nexsis/api/index.php/course/{courseid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"fullname": "Principles of API Design",
"shortname": "TECH-231"
"startdate": "2017-08-16T21:09:30+00:00",
"categorypath": "/Technology/Design/Modern Programming"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"courseid": "C789",
"fullname": "Principles of API Design",
"shortname": "TECH-231"
"startdate": "2017-08-16T21:09:30+00:00",
"categorypath": "/Technology/Design/Modern Programming"
}
This endpoint creates or updates a course.
URL Parameters
Body/JSON Parameters
Delete a Course
Endpoint:
DELETE /enrol/nexsis/api/index.php/course/{courseid}
Example request:
DELETE /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes a course.
URL Parameters
List Enrollments in a Course
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/enrol
Example request:
GET /enrol/nexsis/api/index.php/course/C789/enrol HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"userenrol_id": "6",
"enrol": "manual",
"enrolstatus": "0",
"enrolstartdate": "0",
"enrolenddate": "0",
"firstname": "Test",
"lastname": "User",
"email": "tuser@example.com",
"idnumber": "U19913",
"role": "Student"
},
{
"userenrol_id": "4",
"enrol": "nexsis",
"enrolstatus": "0",
"enrolstartdate": "0",
"enrolenddate": "0",
"firstname": "Test2",
"lastname": "User",
"email": "t2user@example.com",
"idnumber": "U14845",
"role": "Student"
}
]
URL Parameters
Get Category Grades
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/categorygrade/{catid}
Example request:
GET /enrol/nexsis/api/index.php/course/C789/categorygrade/6 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"user_idnumber": "u12345",
"itemid": "2",
"internal_userid": "5",
"rawgrade": null,
"rawgrademax": "100.00000",
"rawgrademin": "0.00000",
"rawscaleid": null,
"usermodified": null,
"finalgrade": "80.00000",
"hidden": "0",
"locked": "0",
"locktime": "0",
"exported": "0",
"overridden": "0",
"excluded": "0",
"feedback": null,
"feedbackformat": "0",
"information": null,
"informationformat": "0",
"timecreated": null,
"timemodified": "1590008438",
"aggregationstatus": "used",
"aggregationweight": "0.50000",
"gradeid": "6",
"categoryid": "2"
},
{
"user_idnumber": "u67890",
"itemid": "2",
"internal_userid": "4",
"rawgrade": null,
"rawgrademax": "100.00000",
"rawgrademin": "0.00000",
"rawscaleid": null,
"usermodified": null,
"finalgrade": "40.00000",
"hidden": "0",
"locked": "0",
"locktime": "0",
"exported": "0",
"overridden": "0",
"excluded": "0",
"feedback": null,
"feedbackformat": "0",
"information": null,
"informationformat": "0",
"timecreated": null,
"timemodified": "1590518968",
"aggregationstatus": "used",
"aggregationweight": "0.50000",
"gradeid": "12",
"categoryid": "2"
}
]
URL Parameters
Optional GET Parameters
Example using GET parameter to filter by user IDs:
GET /enrol/nexsis/api/index.php/course/C789/categorygrades/3?userid[]=u12345&userid[]=u67890
Override Category Grades
Endpoint:
PUT /enrol/nexsis/api/index.php/course/{courseid}/categorygrade/{catid}/{userid}/{grade}
Example request:
GET /enrol/nexsis/api/index.php/course/C789/categorygrade/6/U12345/80 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"user_idnumber": "eli",
"id": "8",
"itemid": "4",
"internal_userid": "5",
"rawgrade": null,
"rawgrademax": "100.00000",
"rawgrademin": "0.00000",
"rawscaleid": null,
"usermodified": null,
"finalgrade": "80.00000",
"hidden": "0",
"locked": "0",
"locktime": "1590520163",
"exported": "0",
"overridden": "1590520163",
"excluded": "0",
"feedback": null,
"feedbackformat": "0",
"information": null,
"informationformat": "0",
"timecreated": null,
"timemodified": "1590008571",
"aggregationstatus": "used",
"aggregationweight": "0.50000"
}
URL Parameters
Optional GET Parameters
Example using an optional GET parameter to lock the grade:
PUT /enrol/nexsis/api/index.php/course/C789/categorygrades/3/U12345/80?lock=true
Users
Get a User
Endpoint:
GET /enrol/nexsis/api/index.php/user/{userid}
Example request:
GET /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"userid": "S123",
"username": "student123",
"firstname": "Student",
"lastname": "Smith",
"email": "studentsmith@inst.edu"
}
This endpoint retrieves a user.
URL Parameters
Create/Update a User
Endpoint:
PUT /enrol/nexsis/api/index.php/user/{userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"username": "student123",
"firstname": "Student",
"lastname": "Smith",
"email": "studentsmith@inst.edu"
}
Example request (URL-encoded):
PUT /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/x-www-form-urlencoded
username=student123&firstname=Student&lastname=Smith&email=studentsmith%40inst.edu
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"userid": "S123",
"username": "student123",
"firstname": "Student",
"lastname": "Smith",
"email": "studentsmith@inst.edu"
}
This endpoint creates or updates a user.
URL Parameters
Body/JSON Parameters
Delete a User
Endpoint:
DELETE /enrol/nexsis/api/index.php/user/{userid}
Example request:
DELETE /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes a user.
URL Parameters
Enrolments
List User Enrolments
Endpoint:
GET /enrol/nexsis/api/index.php/user/{userid}/enrol
Example request:
GET /enrol/nexsis/api/index.php/user/S123/enrol HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"courseid": "C789",
"fullname": "Principles of API Design",
"shortname": "TECH-231"
"startdate": "2017-08-16T21:09:30+00:00",
"roles": [
"student"
]
},
{
"courseid": "C889",
"fullname": "Principles of API Design II",
"shortname": "TECH-331"
"startdate": "2017-08-16T21:09:30+00:00",
"roles": [
"student"
]
}
]
This endpoint retrieves all enrolments for a user.
URL Parameters
Optional GET Parameters
Example using GET parameter to list only NexSIS enrollments:
GET /enrol/nexsis/api/index.php/user/{userid}/enrol?plugin=nexsis
Enrol a User in a Course
Endpoint:
PUT /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}
Example request:
PUT /enrol/nexsis/api/index.php/user/S123/enrol/C789 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/x-www-form-urlencoded
{
"roleid": "student"
}
This endpoint creates or updates a user enrolment in a course.
URL Parameters
Body/JSON Parameters
Unenrol a User from a Course
Endpoint:
DELETE /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}
Example request:
DELETE /enrol/nexsis/api/index.php/user/S123/enrol/C789 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
This endpoint unenrols a user from a course.
URL Parameters
Optional GET Parameters
Example using optional GET parameter to delete only NexSIS enrolments:
DELETE /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}?plugin=nexsis
Course Groups
List Course Groups
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/group
Example request:
GET /enrol/nexsis/api/index.php/course/C789/group HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"groupid": "G1",
"name": "Group 1",
"description": "Group 1..."
},
{
"groupid": "G2",
"name": "Group 2",
"description": "Group 2..."
},
{
"groupid": "G3",
"name": "Group 3",
"description": "Group 3..."
}
]
This endpoint retrieves all groups for a given course.
URL Parameters
Get a Course Group
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
Example request:
GET /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"groupid": "G1",
"name": "Group 1",
"description": "Group 1..."
}
This endpoint retrieves a group for a given course.
URL Parameters
Create/Update a Course Group
Endpoint:
PUT /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"name": "Group 1",
"description": "Group 1..."
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"groupid": "G1",
"name": "Group 1",
"description": "Group 1..."
}
This endpoint creates or updates a course group.
URL Parameters
Body/JSON Parameters
Delete a Course Group
Endpoint:
DELETE /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
Example request:
DELETE /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes a course group.
URL Parameters
Add/Update a Course Group User
Endpoint:
PUT /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}/user/{userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/course/C789/group/G1/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint adds a user to a course group.
URL Parameters
Remove a Course Group User
Endpoint:
DELETE /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}/user/{userid}
Example request:
DELETE /enrol/nexsis/api/index.php/course/C789/group/G1/user/S123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint removes a user from a course group.
URL Parameters
Course Completions
Get User Course Completion
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/user/{userid}/completion
Example request:
GET /enrol/nexsis/api/index.php/course/C789/user/U123/completion HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "24227",
"userid": "16860",
"course": "118",
"timeenrolled": "0",
"timestarted": "0",
"timecompleted": "1667289600",
"reaggregate": "0
}
This endpoint retrieves the user's course completion.
URL Parameters:
Add Course Completion
Endpoint:
POST /enrol/nexsis/api/index.php/course/{courseid}/user/{userid}/completion/{timestamp_course_completion}
Example request (JSON):
POST /enrol/nexsis/api/index.php/course/C789/user/U123/completion/2026-11-01T08:00:00.000Z HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
This endpoint adds a course completion timestamp for a user in a course if a course completion timestamp does not already exist for the user in the course.
URL Parameters
Grades
The NexSIS API retrieves course level grades. These typically correspond to the course "final" grade.
Get User Grades
Endpoint:
GET /enrol/nexsis/api/index.php/user/{userid}/grade
Example request:
GET /enrol/nexsis/api/index.php/user/S123/grade HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"userid": "S123",
"courseid": "C789",
"rawfinalgrade": 92.00,
"rawgrademax": 100.00,
"gradeletter": "A-",
"gradepercent": 0.92,
"feedback": "Great effort!",
"timemodified": "2017-08-16T21:09:30+00:00"
},
{
"userid": "S123",
"courseid": "C799",
"rawfinalgrade": 950.00,
"rawgrademax": 1000.00,
"gradeletter": "A",
"gradepercent": 0.95,
"feedback": "Keep it up!",
"timemodified": "2017-08-15T18:12:21+00:00"
},
{
"userid": "S123",
"courseid": "C850",
"rawfinalgrade": 8.40,
"rawgrademax": 10.00,
"gradeletter": "B",
"gradepercent": 0.84,
"feedback": "",
"timemodified": "2017-10-02T09:43:54+00:00"
}
]
This endpoint retrieves a user's grades.
URL Parameters
Query String Parameters
Get Course Grades
Endpoint:
GET /enrol/nexsis/api/index.php/course/{courseid}/grade
Example request:
GET /enrol/nexsis/api/index.php/course/C789/grade?pagesize=3 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"userid": "S123",
"courseid": "C789",
"rawfinalgrade": 92.00,
"rawgrademax": 100.00,
"gradeletter": "A-",
"gradepercent": 0.92,
"feedback": "Great effort!",
"timemodified": "2017-08-16T21:09:30+00:00"
},
{
"userid": "S234",
"courseid": "C789",
"rawfinalgrade": 82.00,
"rawgrademax": 100.00,
"gradeletter": "B-",
"gradepercent": 0.82,
"feedback": "",
"timemodified": "2017-08-16T21:10:30+00:00"
},
{
"userid": "S345",
"courseid": "C789",
"rawfinalgrade": 96.00,
"rawgrademax": 100.00,
"gradeletter": "A",
"gradepercent": 0.96,
"feedback": "Great work!",
"timemodified": "2017-08-16T21:11:30+00:00"
}
]
This endpoint retrieves a course's grades.
URL Parameters
Query String Parameters
Metalinks
Get a Metalink
Endpoint:
GET /enrol/nexsis/api/index.php/course/{parent_courseid}/metalink/{metalink_courseid}
Example request:
GET /enrol/nexsis/api/index.php/course/C554/metalink/C553 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "64",
"enrol": "meta",
"status": "0"
"courseid": "2",
"sortorder": "8",
"name": null,
"enrolperiod": "0",
"enrolstartdate": "0",
"enrolenddate": "0",
"expirynotify": "0",
"expirythreshold": "0",
"notifyall": "0",
"password": null,
"cost": null,
"currency": null,
"roleid": "0",
"customint1": "17",
"customint2": "2",
"customint3": null,
"customint4": null,
"customint5": null,
"customint6": null,
"customint7": null,
"customint8": null,
"customchar1": null,
"customchar2": null,
"customchar3": null,
"customdesc1": null,
"customdesc2": null,
"customtext1": null,
"customtext2": null,
"customtext3": null,
"timecreated": "1764196640",
"timemodified": "1764196640"
}
This endpoint retrieves a metalink.
URL Parameters:
Create a Metalink
Endpoint:
PUT /enrol/nexsis/api/index.php/metalink/{parent_courseid}/metalink/{metalink_courseid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/course/C554/metalink/C553 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"group": "new",
"groupname": "Math Students"
"groupid": "M1"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "64",
"enrol": "meta",
"status": "0"
"courseid": "2",
"sortorder": "8",
"name": null,
"enrolperiod": "0",
"enrolstartdate": "0",
"enrolenddate": "0",
"expirynotify": "0",
"expirythreshold": "0",
"notifyall": "0",
"password": null,
"cost": null,
"currency": null,
"roleid": "0",
"customint1": "17",
"customint2": "2",
"customint3": null,
"customint4": null,
"customint5": null,
"customint6": null,
"customint7": null,
"customint8": null,
"customchar1": null,
"customchar2": null,
"customchar3": null,
"customdesc1": null,
"customdesc2": null,
"customtext1": null,
"customtext2": null,
"customtext3": null,
"timecreated": "1764196640",
"timemodified": "1764196640"
}
This endpoint creates a metalink.
URL Parameters
Body/JSON Parameters
Delete a Metalink
Endpoint:
DELETE /enrol/nexsis/api/index.php/course/{parent_courseid}/metalink/{metalink_courseid}
Example request:
DELETE /enrol/nexsis/api/index.php/course/C554/metalink/C553 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes a metalink.
URL Parameters
Programs
Get Program Allocation
Endpoint:
GET /enrol/nexsis/api/index.php/program/{programid}/user/{userid}
Example request:
GET /enrol/nexsis/api/index.php/program/P12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"programid": "6",
"userid": "15261",
"certificationid": "0",
"startdate": "1767193200",
"startdatelocked": "1",
"duedate": "1798729200",
"duedatelocked": "1",
"enddate": "1798729200",
"enddatelocked": "1",
"status": "0",
"timesuspended": "1768924417",
"allocationtype": "0",
"id": "20",
"timecreated": "1768924417",
"timemodified": "1768924417",
"usermodified": 0
}
This endpoint retrieves a program.
URL Parameters:
Add or Update Program Allocation
Endpoint:
PUT /enrol/nexsis/api/index.php/program/{programid}/user/{userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/program/P12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"startdate": "2025-12-31T10:00:00",
"duedate": "2026-12-31T10:00:00",
"enddate": "2026-12-31T10:00:00",
"status": "0",
"resetprogram": "0"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"programid": "6",
"userid": "15261",
"certificationid": "0",
"startdate": 1767193200,
"startdatelocked": 1,
"duedate": 1798729200,
"duedatelocked": 1,
"enddate": 1798729200,
"enddatelocked": 1,
"status": "0",
"timesuspended": "1768921917",
"allocationtype": "0",
"id": "18",
"timecreated": "1768878566",
"timemodified": 1768922311,
"usermodified": "14755"
}
This endpoint creates a new program allocation for a user or updates an existing one.
URL Parameters
Body/JSON Parameters
Remove Program Allocation
Endpoint:
DELETE /enrol/nexsis/api/index.php/program/{programid}/user/{userid}
Example request:
DELETE /enrol/nexsis/api/index.php/program/P12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint drops a user from a specific program, removing their allocation and associated records.
URL Parameters
Certifications
Get Certification Allocation
Endpoint:
GET /enrol/nexsis/api/index.php/certification/{certificationid}/user/{userid}
Example request:
GET /enrol/nexsis/api/index.php/certification/C12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"certificationid": "5",
"userid": "15261",
"status": "0",
"timesuspended": "1768925120",
"allocationtype": "0",
"currentprogramid": null,
"isrecertification": "0",
"graceperiodends": 0,
"graceperiodendslocked": 0,
"nextstartdate": 0,
"id": "14",
"timecreated": "1768925120",
"timemodified": 1768925210,
"usermodified": "14755"
}
This endpoint retrieves the current certification allocation details for a specific user.
URL Parameters:
Add or Update Certification Allocation
Endpoint:
PUT /enrol/nexsis/api/index.php/certification/{certificationid}/user/{userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/certification/C12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"startdate": "2025-12-31T10:00:00",
"duedate": "2026-12-31T10:00:00",
"expirydate": "2026-12-31T10:00:00",
"certifieddate": "2026-12-31T10:00:00",
"suspendstatus": "0",
"revokedcertification": "0"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"certificationid": "5",
"userid": "15261",
"status": "0",
"timesuspended": "1768925120",
"allocationtype": "0",
"currentprogramid": null,
"isrecertification": "0",
"graceperiodends": 0,
"graceperiodendslocked": 0,
"nextstartdate": 0,
"id": "14",
"timecreated": "1768925120",
"timemodified": 1768925210,
"usermodified": "14755"
}
This endpoint creates a new certification allocation for a user or updates an existing one if it already exists.
URL Parameters
Body/JSON Parameters
Remove Certification Allocation
Endpoint:
DELETE /enrol/nexsis/api/index.php/certification/{certificationid}/user/{userid}
Example request:
DELETE /enrol/nexsis/api/index.php/certification/C12/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint drops a user from a specific program, removing their allocation and associated records.
URL Parameters
Job Assignments
Get User Job Assignments
Endpoint:
GET /enrol/nexsis/api/index.php/organisation/user/{idnumber}/job
Example request:
GET //enrol/nexsis/api/index.php/organisation/user/U123/job HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "4",
"tenantid": "1",
"userid": "U123",
"positionid": "P3",
"departmentid": "D5",
"startdate": "1767193200",
"enddate": "1798729200",
"timecreated": "1771298867",
"timemodified": "1771298867",
"usermodified": 0,
}
]
This endpoint retrieves list of jobs assigned to the user.
URL Parameters:
Add or Update User Job Assignment
Endpoint:
PUT /enrol/nexsis/api/index.php/organisation/user/{userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/organisation/user/U123 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"departmentid": "D5",
"positionid": "P4",
"startdate": "2025-12-31T10:00:00",
"enddate": "2026-12-31T10:00:00"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "4",
"tenantid": "1",
"userid": "U123",
"positionid": "P3",
"departmentid": "D5",
"startdate": 1767193200,
"enddate": 1798729200,
"timecreated": "1771298867",
"timemodified": 1771299100,
"usermodified": "14755"
}
This endpoint creates a new certification allocation for a user or updates an existing one if it already exists.
URL Parameters
Body/JSON Parameters
Remove User Job Assignment
Endpoint:
DELETE /enrol/nexsis/api/index.php/organisation/user/{userid}/department/{departmentid}/position/{positionid}
Example request:
DELETE /enrol/nexsis/api/index.php/organisation/user/U123/department/D5/position/P4 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes a user's job assignment.
URL Parameters
Direct Managers
Get Organisation User Manager
Endpoint:
GET /enrol/nexsis/api/index.php/organisation/user/{userid}/manager
Example request:
GET /enrol/nexsis/api/index.php/organisation/user/U123/manager HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "12191",
"userid": "U123",
"managerid": "M123",
"tenantid": "1",
"permissions": "4",
"timecreated": "2026-03-03T10:21:15-05:00",
"timemodified": "2026-03-03T10:21:15-05:00",
"usermodified": 0
}
]
This endpoint retrieves list of jobs assigned to the user.
URL Parameters:
Assign Manager to Organisation User
Endpoint:
PUT /enrol/nexsis/api/index.php/organisation/user/{userid}/manager/{reportsto_userid}
Example request (JSON):
PUT /enrol/nexsis/api/index.php/organisation/user/U123/manager/M456 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Content-Type: application/json
{
"keepexisting": 1,
"perm_allocate_programs": 0,
"perm_view_reports": 0,
"perm_be_notified": 1
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": 12191,
"userid": “U123”,
"managerid": “M456”,
"tenantid": 1,
"permissions": 4,
"timecreated": "2026-03-03T10:21:15-05:00",
"timemodified": "2026-03-03T10:21:15-05:00",
"usermodified": "14755"
}
This endpoint assigns a manager to a specific organisation user within a tentant and sets the manager's permissions.
URL Parameters
Body/JSON Parameters
Remove an Organisation User Manager
Endpoint:
DELETE /enrol/nexsis/api/index.php/organisation/user/{userid}/manager/{reportsto_userid}
Example request:
DELETE /enrol/nexsis/api/index.php/organisation/user/U123/manager/M12 HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
This endpoint deletes the relationship between a user and a manager.
URL Parameters
Logs
Get Logs
Endpoint:
GET /enrol/nexsis/api/index.php/logs
Example request:
GET /enrol/nexsis/api/index.php/logs?limit=10&offset=0&level=fatal,error,warning,info HTTP/1.1
Authorization: Bearer {token}
Host: example.moodle.com
Accept: */*
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "2122",
"date_created": "2025-12-26 14:36:33",
"level": "info",
"message": "Course completion already exists",
"detail": "Time completed for course 118 already exists for student 16860",
"params": "",
"request_method": "",
"request_url": "",
"request_body": "",
"response_body": "",
"response_status_code": null,
"ip": "127.0.0.1",
"user_agent": "Unknown User Agent"
}
This endpoint retrieves a filtered list of NexSIS logs.
URL Parameters:
Errors
The NexSIS API uses the following error codes: