Docs

Generate

Generate courses, course screens, and quizzes inside a course using Coassemble AI.

To delete source processing copies after generation, send discardSourceDocuments: true. See source document retention for embed inheritance, accepted requests, deletion timing and the editing trade-off.

Generate a course with the create-course agent

Use this endpoint to run the create-course agent server-side and return a built course. Provide a prompt, one or more source documents, or both. Document-heavy courses can take several minutes.

Authenticate with your workspace API key. Required body field: identifier (stable course-owner id). Either prompt or documents (non-empty) is required. When exactly one document is supplied, fidelityLevel is required.

Fidelity (fidelityLevel)

Controls how closely a single source document is followed:

  • verbatim — 1:1 document-to-course conversion. Visible text stays as in the source; no pedagogical rewrite.
  • structured — Follows the document’s structure and content, but reshapes it into a proper learning experience (sections, clearer wording).
  • adaptive — Uses the document as supporting material; learning outcomes / brief drive structure and authorship.

Documents and images

  • documents — Array of source documents. Each item needs name, url (public or signed), and optionally mimeType.
  • selectedImages — For structured/verbatim document generation: an array of document image URLs to include, or the literal string "all" to include every image the conversion extracts.

Assessment (assessment)

Optional array of assessment opt-ins. When omitted, the agent reads the prompt for assessment requests and falls back to formative knowledge checks. A single-document verbatim build adds no assessments unless explicitly requested. Pass one or more of:

  • formative — Unscored knowledge checks (single-question screens) after key concepts through the course.
  • summative — A scored end-of-course quiz (typically before any recap).
  • flashcards — Unscored flip-card practice screens (not knowledge checks or quizzes).
  • none — No knowledge checks, quizzes, or flashcards.

For verbatim generation, only a summative opt-in adds an authored end-of-course quiz; formative/flashcards are not applied the same way as on adaptive/structured builds.

Other optional fields

  • language — Language for the course content.
  • tone — Tone of voice for the generated course.
  • audience — Who the course is for.
  • learningOutcomes — Array of learning outcomes the course should cover.
  • timeEstimateMinutes — Target course duration in minutes.
  • useBrandVoice — Whether configured brand voice should be applied.
  • aiImages — Set to true to generate AI images for screens that need one. Each image uses one generation from the workspace image allowance. Defaults to false, so no AI images are generated unless you ask for them.
  • folderId — Folder ID for the generated course.
  • clientIdentifier — Tenant/client the course belongs to.

Example: verbatim from a document with a summative quiz

Request body
{
  "identifier": "user@example.com",
  "fidelityLevel": "verbatim",
  "assessment": ["summative"],
  "documents": [
    {
      "name": "Kitchen Safety Induction.pdf",
      "url": "https://example.com/kitchen-safety-induction.pdf",
      "mimeType": "application/pdf"
    }
  ],
  "selectedImages": "all",
  "language": "en",
  "tone": "professional",
  "audience": "new kitchen staff",
  "timeEstimateMinutes": 20,
  "useBrandVoice": true
}
POST/v1/headless/generate/course/agent

Body parameters

FieldTypeRequiredDescOptions
promptstringNoThe topic, learning objective, or source brief for the course—
identifierstringYesYour stable identifier for the course owner—
clientIdentifierstringNoThe client this course belongs to—
discardSourceDocumentsbooleanNoDelete source documents after the build completes, is cancelled or fails. Default false. Editing cannot refer back to discarded sources. A workspace library document URL is refused with a 400.—
documentsobject[]NoSource documents to ground the course in—
fidelityLevelstringNoControls how closely generation follows the source (`verbatim`, `structured`, or `adaptive`), required with exactly one source document and otherwise optional with `adaptive` as the default.verbatimstructuredadaptive
selectedImagesstring[] | stringNoDocument image URLs to include when using structured/verbatim document generation. Pass the literal string "all" to include every image the conversion extracts (useful for testing image placement without pre-curating URLs).—
audiencestringNoWho the course is for—
learningOutcomesstring[]NoLearning outcomes the course should cover—
languagestringNoLanguage for the course content—
tonestringNoTone of voice for the generated course—
timeEstimateMinutesnumberNoTarget course duration in minutes—
useBrandVoicebooleanNoWhether configured brand voice should be applied—
folderIdnumberNoFolder ID for the generated course—
aiImagesbooleanNoGenerate AI images for screens that need one, using the workspace image generation allowance. Defaults to false: no AI images are generated unless this is true.—
assessmentstring[]NoAssessment choices are final for brief-only, Structured and Adaptive builds. Omitted or empty reads only the prompt, falling back to formative knowledge checks. Verbatim preserves source text and supports only an added scored quiz: summative (including combined choices) adds it; formative/flashcards-only, none, omitted or empty adds no assessment. Formative and flashcards are not authored in Verbatim, matching the app.—

Generate a course

Use this endpoint to create a full course from a prompt. It returns the created course using the same response shape as the legacy course generation endpoint.

POST/v1/headless/generate/course

Body parameters

FieldTypeRequiredDescOptions
promptstringYesThe topic or learning objective to generate a course from—
discardSourceDocumentsbooleanNoDo not retain the source brief or generation context after completion. Default false.—
audiencestringYesWho the course is for (e.g. "new hires")—
familiaritystringYesHow familiar the audience is with the topic (e.g. "beginner")—
tonestringYesTone of voice for the generated content (e.g. "professional")—
screenCountnumberYesApproximate number of screens to generate—
identifierstringYesYour stable identifier for the course owner—
clientIdentifierstringNoThe client this course belongs to—

Generate a course screen

Use this endpoint to generate a single screen and persist it into an existing course. The generated screen is appended to the end of the course.

POST/v1/headless/generate/course/{id}/screen

Path parameters

FieldDescriptionOptions
idCourse ID to add the generated screen to—

Body parameters

FieldTypeRequiredDescOptions
typestringYesScreen layout type to generatetextprocesschecklistflashcardslist
titlestring | nullNoTitle for the screen—
promptstring | nullNoPrompt describing what the screen should cover—
contentstring | nullNoSource content to summarise into the screen—

Generate a course quiz

Use this endpoint to generate a complete quiz screen, including quiz intro content and persisted questions, inside an existing course.

POST/v1/headless/generate/course/{id}/quiz

Path parameters

FieldDescriptionOptions
idCourse ID to add the generated quiz to—

Body parameters

FieldTypeRequiredDescOptions
promptstring | nullNoPrompt describing what the quiz should cover—
contentstring | nullNoSource content to draw questions from—
questionCountnumberNoHow many questions to generate—
questionTypesstring[]NoQuestion types to use (subset of: multipleChoiceImg, multipleResponse, trueFalse, writeAnswer, dropDown, matchCorresponding, matchSequence)—
scoredbooleanNoWhether the quiz contributes to a pass/fail grade—
passingGradenumberNoPass mark (percentage 0–100) when scored is true—