API reference

Create a course

POST /api/v1/courses — async course creation endpoint reference. Request body, response shape, and error codes.

POST /api/v1/courses

Submit a course for generation. Returns immediately with a jobId; the worker generates the course in the background (typically 60–120 seconds). To get notified on completion without polling, pass a callbackUrl.

Request

Body parameters

Field Type Required Description
subject string (1–200) yes Topic of the course.
format "onepage" | "classic" no Layout. Default "onepage".
languageId enum no Locale code (e.g. "en-US", "pt-BR"). Default "en-US".
outline string[] (≤ 9) no Optional chapter titles. Auto-generated if omitted.
addOns string[] no Extra content blocks (see below). Default [].
callbackUrl string (URL) no HTTPS webhook fired when the job finishes. See Webhooks.

addOns values

  • practical-exercises — hands-on exercises after each lesson.
  • wrapup — closing summary block.
  • assessment — final assessment quiz.
  • articles — auto-generated supporting articles.
  • videos — embedded YouTube videos relevant to each lesson.
  • agreement — sign-off agreement block (compliance use cases).

Example request

curl -s https://learningstudioai.com/api/v1/courses \
  -H "Authorization: Bearer $LS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Workplace safety basics",
    "format": "classic",
    "outline": ["Hazards", "PPE", "Emergency procedures"],
    "addOns": ["assessment"],
    "callbackUrl": "https://yourapp.com/hooks/learningstudio"
  }'

Response

202 Accepted

{
  "jobId": "8aF2k...Xq",
  "status": "pending",
  "pollUrl": "/api/v1/courses/jobs/8aF2k...Xq"
}
Field Description
jobId Stable identifier for the job. Use it to poll status.
status Always "pending" immediately after creation.
pollUrl Convenience path to GET. Relative to the API base URL.

The actual course object arrives later — either via GET job status once it reaches "completed", or via the course.created webhook if you supplied a callbackUrl.

Errors

This endpoint may return:

Quota and rate-limit checks run before the job is queued, so an over-quota request returns 403 immediately without consuming credits or producing a job. See Errors for response shape and full code definitions.