Docs

Generate

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

Generate a course with the create-course agent Build and above

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 defaults to formative knowledge checks only. 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.
  • 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—
documentsobject[]NoSource documents to ground the course in—
fidelityLevelstringNoverbatimstructuredadaptive
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—
assessmentstring[]NoAssessment opt-ins for the generated course. Defaults to formative knowledge checks only.—

Generate a course Build and above

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—
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 Build and above

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 Build and above

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—