Skip to content

API reference

The Learn API: addresses, authentication, errors and limits.

Applies to EngineCloud
View as Markdown
On this page
  1. Authentication
  2. Errors

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:

TokenWhoCan
your Sypnia sessionyou, in App or a Sypnia command lineeverything you can do
a personal access tokenyou, from a scriptits scopes: learn (your lessons, exercises, progress, explanations), read (courses), admin (publish and remove courses)
an agent’s tokenan agent acting for youlearner actions, except those reserved to people
the engine’s root tokenthe engine’s operator Engineeverything, 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

JSON
{ "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." } }
StatusCodes
400invalid_request, invalid_lesson
401unauthorized
402insufficient_credits
403forbidden, person_required
404not_found, lesson_not_found, project_not_found
409exercise_exists, check_running
413too_large
422no_match, repository_unreachable
429rate_limited (with retry-after)
503runner_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.

  • Endpoints

    Courses, lessons, exercises and checks, progress, explanations, offers and settings.

  1. Authentication
  2. Errors

    Search pages, sections and terms