API

The Learnt API lets your own tools and AI agents build and run almost everything in a workspace: the course and its modules, branding, client organizations, learners and progress. Signing up, billing, creating API keys and connecting a custom domain are done by a person in the Course Editor. It uses the same rules as the Course Editor, so anything the API writes is checked exactly as if you'd typed it in.

Keys

Create a key in the Course Editor under Developer access. Learnt shows the whole key once, when you create it, so store it straight away. Keys start with lt_live_.

Send it on every request:

Authorization: Bearer lt_live_…

Errors

A refused request returns a 4xx status and a body like this:

{
  "error": "This API key is read-only",
  "code": "read_only_key",
  "fix": "Use a key created with write access for this call.",
  "docs": "https://learnt.tech/docs/errors#read_only_key"
}

The code never changes, so code and agents can rely on it. Every code is listed on the errors page.

Course

Each workspace has one course. More than one course per workspace is planned.

Modules

Modules are the course's pages, in order. Write them in markdown ("markdown") or HTML ("html"). Either way the text is cleaned the same way the editor cleans it: scripts and outside images are removed. YouTube and Vimeo embeds are kept when sent as HTML iframes from www.youtube-nocookie.com/embed/… or player.vimeo.com/video/…; other video links stay plain links.

Import a whole course from markdown

POST /import/markdown takes "markdown", one document in which each # heading starts a new module. The modules are added after any you already have.

{ "markdown": "# Welcome\nWhat this course covers.\n\n# Your first week\n## Three things to do\n- Meet everyone\n- Write down how work gets done" }

Pictures

POST /images is a multipart/form-data request with file (JPG, PNG, WEBP or GIF, up to 4 MB) and course_id (from GET /course). It returns the picture's url, which you can use in a module's markdown: ![Alt text](url). Pictures hosted anywhere else are removed from modules.

Branding

Your own web address is set up in the Course Editor, because it needs DNS records at your domain provider. See Branding and domains.

Client organizations

These are the companies that buy your training. Each one groups its learners, has its own progress report, and can have an access end date (access ends after that date, in UTC).

Learners

Reminders

Learners get up to two automatic reminders in your name: 7 days after the invitation if they haven't opened the course, and when progress stops for 3 to 6 days. Details: Learners and client organizations.

Questions

Questions learners ask from a module page. Details: Learners and client organizations.

Progress

Export