Source document retention
Set discardSourceDocuments: true to use source documents during generation and delete Coassemble's processing copies afterwards. This optional boolean defaults to false: by default, documents stay with the course for later editing. There is no workspace setting.
With this option on, source documents are held while the course is built and queued for deletion when it finishes, or within 24 hours if a build is abandoned. The finished course contains material based on them, and database backups are kept for 7 days.
Where to send the flag
- Agent REST generation:
POST /v1/headless/generate/course/agent, in the JSON body. - Classic REST generation:
POST /v1/headless/generate/course, in the JSON body. - Consumer MCP: the
start_course_generationtool input. - Authoring embed issue: the top-level JSON body on
POST /v1/headless/embed/course,/agent,/screenor/scorm. For endpoints with anaction, the flag applies toeditonly. It belongs besideidentifier, outsideoptions.
REST paths above are relative to the API base, which ends in /api. Send a JSON boolean, not the string "true". The embedded builder inherits the signed flag automatically.
{
"mode": "create",
"identifier": "your-user-id",
"discardSourceDocuments": true
} An embed issued with the flag carries it in its signed token. All source uploads, generation and attachment turns inside that embed inherit it, including the handoff to the builder. The iframe cannot switch it off. A flagged upload or session also keeps its policy when later requests omit the flag or send false. This choice does not become a course setting: a later session started without the flag retains its new uploads as usual, even on the same course.
Deletion timing and scope
Cleanup is scheduled five minutes after a build is explicitly completed or cancelled, or after an API/MCP build fails permanently. Editing attachments in an already completed build session use the same five-minute delay. Other attachments and abandoned uploads are scheduled 23 hours after the first source is registered for cleanup, targeting deletion within 24 hours. Failed in-app builds remain retryable and keep this deadline; recent build activity defers cleanup. Request errors do not shorten that deadline. Live processing defers cleanup. A source file that the course itself links to is kept as course content and recorded as skipped, without retries. Service outages or other live references can delay disposal; bounded retries alert on failure. Deletion records show what was deleted and when.
Cleanup removes source text and references from session memory, source-bearing transcript messages, Classic contexts and SCORM ingest jobs before deleting private source objects and every stored version. This includes uploaded originals, conversion copies, extracted text, agent artifacts, SCORM conversion zips and imported Google Drive or OneDrive copies. Partner document URLs are removed from the stored build context. Ordinary builder chat is preserved. Classic REST generation is prompt-only: the flag discards its temporary source brief and AssistantContext payload, including generated outline and conversation copies, while keeping the course.
The finished course and images placed in it stay. Extracted images are not added to the workspace media library. Externally hosted originals and assets independently used by other content are not deleted.
Course content and library documents
The flag only applies to documents used as a source for generation or the assistant. Files that authors add to a Document block, or attach as a file link, are course content: they keep their normal public storage and are never queued for deletion, even inside a flagged embed.
Documents in the workspace media library belong to the workspace, so a flagged request can't use them as a source. Agent REST generation, consumer MCP (including documentId references) and requests inside a flagged embed return HTTP 400, naming the document:
{
"message": "\"Staff handbook.pdf\" is in your workspace library, so it can't be used as a source when discardSourceDocuments is set. Upload it directly instead.",
"error": { "code": "BAD_REQUEST", "status": 400 }
}Upload the document directly, or pass a partner URL, to give the build a disposable processing copy.
Database backups (7 days), server logs (about 3 months), Google's request cache (up to 24 hours) and ConvertAPI file retention (up to 3 hours) keep their separate policies. Processing uses temporary storage: this option does not mean that documents are never written to storage.
Editing trade-off
The assistant cannot refer back to discarded sources. When an edit needs them, it explains that source documents are not kept for this course or request and asks the author to paste or attach the relevant part. It must not invent missing content. New attachments within the flagged session follow its disposal policy; uploads in later unflagged sessions are retained. Durable assistant memory is unavailable during flagged requests.