LEIA Docs

Batch generate lesson content

POST
/courses/{courseId}/lessons/generate-all

Starts an async background job that generates AI content for all specified lessons in a course.

Authorization

AuthorizationBearer <token>

LEIA API key passed as Bearer token (recommended). Keys start with leia_sk_.

In: header

Path Parameters

courseId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/courses/string/lessons/generate-all" \  -H "Content-Type: application/json" \  -d '{    "lessonIds": [      "lesson_1",      "lesson_2"    ],    "customInstructions": "Use concise examples with practical code snippets.",    "languageConfig": {      "contentLanguage": "en",      "tutorLanguage": "en",      "supportedLanguages": [        "en"      ]    }  }'
{
  "id": "string",
  "type": "LESSON_GENERATION",
  "status": "QUEUED",
  "progress": 0,
  "errorReason": "string",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}
Empty
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Valid LEIA API key required"
  }
}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "API key service user must be a CREATOR user"
  }
}
{
  "error": {
    "code": "IDEMPOTENCY_CONFLICT",
    "message": "Idempotency-Key was reused with a different request body"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}