# Learnt API endpoints

Generated from the API itself. Base URL `https://learnt.tech/api/v1`, header `Authorization: Bearer $LEARNT_API_KEY`.
Fields for each endpoint: https://learnt.tech/docs/api. Machine-readable: https://learnt.tech/docs/openapi.json.

| Method | Path | Does | Needs a write key |
|---|---|---|---|
| GET | `/course` | Get the course | no |
| PATCH | `/course` | Update the course (title, description, published) | yes |
| GET | `/modules` | List modules in order | no |
| POST | `/modules` | Create a module from markdown or HTML | yes |
| POST | `/modules/reorder` | Reorder all modules | yes |
| PATCH | `/modules/{id}` | Update a module | yes |
| DELETE | `/modules/{id}` | Delete a module | yes |
| POST | `/import/markdown` | Import a whole course from one markdown document | yes |
| POST | `/images` | Upload a picture for use in modules (multipart) | yes |
| GET | `/branding` | Get branding | no |
| PATCH | `/branding` | Update branding | yes |
| POST | `/branding/logo` | Upload the logo (multipart) | yes |
| POST | `/branding/background` | Upload the page background picture (multipart) | yes |
| POST | `/branding/cover` | Upload the course cover picture (multipart) | yes |
| GET | `/client-orgs` | List client organizations | no |
| POST | `/client-orgs` | Create a client organization | yes |
| PATCH | `/client-orgs/{id}` | Rename a client organization or set its end date | yes |
| DELETE | `/client-orgs/{id}` | Delete a client organization | yes |
| GET | `/learners` | List learners with progress | no |
| POST | `/learners` | Invite learners (branded invitation, daily limit applies) | yes |
| DELETE | `/learners/{id}` | Remove a learner's access | yes |
| POST | `/learners/{id}/restore` | Restore a removed learner | yes |
| POST | `/learners/{id}/resend` | Resend a learner invitation | yes |
| POST | `/learners/{id}/remind` | Send a learner a reminder now (daily limit applies) | yes |
| GET | `/limits` | Today's invitation limit and use | no |
| GET | `/settings/reminders` | Whether learners get automatic reminders | no |
| PATCH | `/settings/reminders` | Switch automatic reminders on or off | yes |
| GET | `/questions` | List learners' questions (open, or all with ?status=all) | no |
| PATCH | `/questions/{id}` | Mark a learner's question answered, or open again | yes |
| GET | `/settings/questions` | Whether learners can ask questions, and where they go | no |
| PATCH | `/settings/questions` | Switch learner questions on or off | yes |
| GET | `/progress` | Progress per learner | no |
| GET | `/progress.csv` | Progress as CSV | no |
| GET | `/export/markdown` | Download the whole course as one markdown file | no |
