API reference
The Learn API: addresses, authentication, errors and limits.
On this page
API: https://learn.api.sypnia.com/v1 Cloud, or your engine’s address followed by /v1 Engine.
Authentication
Authorization: Bearer <token>. Every record in Learn belongs to a person, so there are no secret keys for apps. The token is one of:
| Token | Who | Can |
|---|---|---|
| your Sypnia session | you, in App or a Sypnia command line | everything you can do |
| a personal access token | you, from a script | its scopes: learn (your lessons, exercises, progress, explanations), read (courses), admin (publish and remove courses) |
| an agent’s token | an agent acting for you | learner actions, except those reserved to people |
| the engine’s root token | the engine’s operator Engine | everything, on that engine |
Reserved to people: answering questions, deleting progress, changing the level and publishing courses. An agent’s token gets 403 person_required. No one can mark a lesson as done by hand: only passing checks do.
Errors
{ "error": { "code": "check_running", "message": "The checks of this exercise are already running. Wait for them, or follow them at GET /v1/exercises/ex_7Hq2/checks." } }| Status | Codes |
|---|---|
| 400 | invalid_request, invalid_lesson |
| 401 | unauthorized |
| 402 | insufficient_credits |
| 403 | forbidden, person_required |
| 404 | not_found, lesson_not_found, project_not_found |
| 409 | exercise_exists, check_running |
| 413 | too_large |
| 422 | no_match, repository_unreachable |
| 429 | rate_limited (with retry-after) |
| 503 | runner_unavailable |
A failed check is not an error: POST /exercises/{id}/check answers 202, and the result says which checks failed.
Limits are in Limits.
Courses, lessons, exercises and checks, progress, explanations, offers and settings.