Generate
Generate courses, course screens, and quizzes inside a course using Coassemble AI.
Generate a course with the create-course agent Scale and above
Use this endpoint to run the create-course agent server-side and return a completed Builder 2 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 needsname,url(public or signed), and optionallymimeType.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
{
"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
}/v1/headless/generate/course/agentBody parameters
| Field | Type | Required | Desc | Options |
|---|---|---|---|---|
prompt | string | No | The topic, learning objective, or source brief for the course | — |
identifier | string | Yes | Your stable identifier for the course owner | — |
clientIdentifier | string | No | The client this course belongs to | — |
documents | object[] | No | Source documents to ground the course in | — |
fidelityLevel | string | No | verbatimstructuredadaptive | |
selectedImages | string[] | string | No | Document 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). | — |
audience | string | No | Who the course is for | — |
learningOutcomes | string[] | No | Learning outcomes the course should cover | — |
language | string | No | Language for the course content | — |
tone | string | No | Tone of voice for the generated course | — |
timeEstimateMinutes | number | No | Target course duration in minutes | — |
useBrandVoice | boolean | No | Whether configured brand voice should be applied | — |
folderId | number | No | Folder ID for the generated course | — |
assessment | string[] | No | Assessment opt-ins for the generated course. Defaults to formative knowledge checks only. | — |
Generate a course Scale 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.
/v1/headless/generate/courseBody parameters
| Field | Type | Required | Desc | Options |
|---|---|---|---|---|
prompt | string | Yes | The topic or learning objective to generate a course from | — |
audience | string | Yes | Who the course is for (e.g. "new hires") | — |
familiarity | string | Yes | How familiar the audience is with the topic (e.g. "beginner") | — |
tone | string | Yes | Tone of voice for the generated content (e.g. "professional") | — |
screenCount | number | Yes | Approximate number of screens to generate | — |
identifier | string | Yes | Your stable identifier for the course owner | — |
clientIdentifier | string | No | The client this course belongs to | — |
Generate a course screen Scale 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.
/v1/headless/generate/course/{id}/screenPath parameters
| Field | Description | Options |
|---|---|---|
id | Course ID to add the generated screen to | — |
Body parameters
| Field | Type | Required | Desc | Options |
|---|---|---|---|---|
type | string | Yes | Screen layout type to generate | textprocesschecklistflashcardslist |
title | string | null | No | Title for the screen | — |
prompt | string | null | No | Prompt describing what the screen should cover | — |
content | string | null | No | Source content to summarise into the screen | — |
Generate a course quiz Scale and above
Use this endpoint to generate a complete quiz screen, including quiz intro content and persisted questions, inside an existing course.
/v1/headless/generate/course/{id}/quizPath parameters
| Field | Description | Options |
|---|---|---|
id | Course ID to add the generated quiz to | — |
Body parameters
| Field | Type | Required | Desc | Options |
|---|---|---|---|---|
prompt | string | null | No | Prompt describing what the quiz should cover | — |
content | string | null | No | Source content to draw questions from | — |
questionCount | number | No | How many questions to generate | — |
questionTypes | string[] | No | Question types to use (subset of: multipleChoiceImg, multipleResponse, trueFalse, writeAnswer, dropDown, matchCorresponding, matchSequence) | — |
scored | boolean | No | Whether the quiz contributes to a pass/fail grade | — |
passingGrade | number | No | Pass mark (percentage 0–100) when scored is true | — |