Skip to content

Compliance and required training

The compliance module turns a course into required training: a person is assigned the course with a due date, is reminded, and, when they are late, their manager is told. Certificates can expire and the course is offered again before they do. Everything is available through the API (/api/admin/compliance, permission compliance_manage); there is no admin screen yet.

PUT /api/admin/compliance/courses/{course}/settings:

Field Meaning
mandatory Marks the course as required training.
validity_days How long a new certificate stays valid. Empty: it never expires.
recertify_before_days Start recertification this many days before the certificate expires. Default 30; 0 turns it off.
default_due_days Due date for assignments created without one.
reminder_days Days before a due date or expiry on which a reminder is sent. Default 30, 7, 1.
escalation_days Days after the due date on which the manager is told. Default 1, 7.

Only courses with saved settings are recertified. Certificates already issued keep the expiry they were issued with.

POST /api/admin/compliance/assignments with course_id, user_ids and an optional due_at:

  • The person gets access to the course and the due date becomes their course deadline, so the existing deadline reminder and their course list stay in step.
  • Assigning again does not create a second assignment; a new, earlier due date is used.
  • A person who already holds a valid certificate for the course is marked completed at once.
  • If their certificate expired, their progress in the course is cleared so they can take it again.
  • The assignment closes when the person finishes the course and is linked to the certificate that was issued.
  • DELETE /api/admin/compliance/assignments/{id} cancels an open assignment.

Learners read their own list at GET /api/compliance/my-assignments. A manager reads their direct reports at GET /api/compliance/team/assignments.

Escalations go to the manager linked to the person: PUT /api/admin/compliance/managers/{user} with {"manager_id": 12} (or null to clear). Until an HRIS import exists, links are kept here. Without a manager an escalation waits and is sent after one is linked.

php artisan compliance:process runs every day at 06:00 (scheduler) and does, in this order:

  1. Opens a recertification assignment, due on the expiry date, for each certificate inside its recertification window.
  2. Sends certificate expiring reminders, certificate expired notices (up to 7 days after expiry).
  3. Sends training due soon, training overdue and, to the manager, training escalated.

Each notice is recorded once, so running the command again, or late, never repeats one. If several reminder days have passed, only the most urgent is sent. The e-mails are editable under Configuration → Templates like any other e-mail template.

Finishing a required course sends one more notice, training completed, to the learner, with a link to their training record (the certificate’s verification page once it is linked to the assignment). When the course is marked mandatory and the learner has a manager, the manager gets training completed (manager) as well. Both are sent once per assignment. A course that was already covered by a valid certificate when it was assigned is completed without a notice, because nothing was finished.

Every notice picks its template by language: the language of the course, then the academy’s default language, then English, then a template without a language. The path notices (enrolled, completed) have no course, so they use the academy’s default language. The default texts are written in English and Polish (other languages show the English text until they are translated); a template you have edited is never replaced.

Notices about a course that is a step of the learner’s learning path carry the path. The variables are @VarPathTitle, @VarStepNumber, @VarStepCount, @VarNextStep (the next course still to do, empty on the last step) and @VarPathContext, a ready sentence in the language of the course (“Step 2 of 4 of the learning path “Onboarding” is now open.” on the e-mail of an unlocked step, “This course is step 2 of 4 of the learning path …” on the others). Outside a path they are empty. They are available in the assigned, due soon, overdue, escalated and completed e-mails; the default texts of a new academy already contain @VarPathContext. Templates that were saved earlier keep their text: add @VarPathContext to them where you want it.

The same events are available to other systems as webhooks: training.assigned, training.completed, training.overdue, path.completed and certificate.revoked.

A learning path is an ordered set of courses with prerequisites: POST /api/admin/compliance/paths with a title and steps (course_id and the prerequisites, course ids of the same path). A path cannot list a course twice, name a prerequisite outside the path or contain a cycle.

Enrolling people (POST /api/admin/compliance/paths/{id}/enrollments, with an optional due_at) assigns the courses that can be started. Each time a learner finishes a course, the courses it unlocks are assigned, with the same due date, so the usual reminders, overdue notices and manager escalation apply to every step. When the last course is finished the path is complete. Learners see their paths and each step as done, available or locked at GET /api/compliance/my-paths. A learner is enrolled in a path once; courses they have already finished (with a valid certificate) are not assigned again.

A rule enrols everyone whose attributes match into a path, due in N days: POST /api/admin/compliance/rules with name, path_id, due_days and conditions, for example department equals Finance:

{"name": "Finance onboarding", "path_id": 3, "due_days": 30,
"conditions": [{"attribute": "department", "operator": "equals", "value": ["Finance"]}]}
Attribute What it reads
group The names of the user’s groups.
a user column or custom field e.g. email, or a field you added in Configuration (department, role, location).

Operators: equals, not_equals, in, contains, starts_with, ends_with, exists. Comparisons ignore case and every condition of a rule must hold. Rules are checked whenever a user is created or changed and once a day (which also catches new group members). POST /api/admin/compliance/rules/{id}/evaluate shows who a rule would enrol (dry_run, the default) or enrols them now.

/api/admin/compliance/competencies holds the competency framework: a tree of areas and skills (name, optional code, parent_id). Administrators change it; authors can read it.

Courses are tagged with competencies:

  • An author (or administrator) tags a course directly: PUT /api/admin/compliance/courses/{course}/competencies/{competency}.
  • POST .../competencies/suggest asks the AI which competencies the course teaches. It returns suggestions, each with a one-line reason and the lessons that teach it. Nothing is tagged until the author confirms a suggestion with the same PUT; DELETE rejects it. Suggestions never count towards anyone’s skills. Each call is logged with model, tokens and cost like every other AI call, and the course text is treated as data, never as instructions.

A learner’s skill profile (GET /api/compliance/my-skills) lists the confirmed competencies of the courses they have done, with the courses that prove them, when they were earned and when they lapse (an expired or revoked certificate removes the skill). Administrators read anyone’s profile at /api/admin/compliance/users/{user}/skills. Enrolment rules can use it: the attribute competency with not_equals and a competency name enrols everyone who lacks that skill.

GET /api/admin/compliance/report?dataset=... (permission compliance_report) returns a paginated table; the same URL under /report/export downloads every matching row as CSV (or JSON lines with format=jsonl).

Dataset Answers
assignments Who had to do which course, by when, whether they did (and when), days overdue, escalation level, and the certificate with its status, expiry and course version.
certificates Every certificate: holder, issue and expiry date, valid, expired or revoked, revocation reason, course version.
audit The tamper-evident Living Course audit entries (course versions, who changed what), when Living Course is installed.

Filters: course_id, user_id, status (assignments: assigned, overdue, completed, cancelled; certificates: valid, expired, revoked), from and to (assigned or issued dates). Every export is recorded with who ran it, the dataset, the filters and the number of rows. In CSV, text that a spreadsheet could read as a formula is prefixed with an apostrophe.

GET /api/admin/compliance/dashboard (permission compliance_report, optional course_id) returns the numbers a dashboard needs: open, overdue and completed assignments, the completion rate and average days to complete, certificates that are valid, expiring within 30 or 90 days, expired or revoked, and the same per course with the most overdue course first. Struggle and recovery rates from Learner Insights are not included yet.

POST /api/admin/compliance/schedules sets up a report that is e-mailed as an attachment every day, week or month at 06:00: name, dataset, frequency, optional format (csv or jsonl) and filters, and recipient_ids. Recipients are users of this academy, never free-text addresses. A failing schedule is skipped and tried again at its next time.

A schedule can also send a saved report of the report builder: give saved_report_id instead of dataset.

BI tools can read the same data through the API: create a scoped access token with the reports:read scope and call /api/admin/compliance/report (paginated JSON) or /report/export (CSV or JSON lines). The report and the schedules are in the reports token area, the rest of the compliance API is under certificates. The datasets behind the report are listed by the report builder.