Generate Document Content
The "Align" panel's AI-draft actions — a real LLM call (same OpenRouter context model @align's grounded Q&A uses), not a canned response.
Two distinct modes, split on whether the request references the document's own existing text (useExisting, e.g. "Summarize this" / "Write an introduction" / "Improve this content"):
- useExisting on a non-blank document: generates ONLY the new
content the request asks for and APPENDS it (generate_document_addition
- append_document_content) — this used to run the exact same from-scratch generation as the branch below and save that over the whole document, silently destroying whatever the user had already written the moment any "summarize"/"improve" style action ran.
- Otherwise (a blank/new document, or a from-scratch request): generates a whole new document and saves it in full — there's nothing existing to lose. Either way this bumps current_version and records a version snapshot like a manual save would, so a bad generation is still one click away from Version history — but that's a safety net now, not the only thing standing between a user and a wiped document.
Also feeds in whatever the Context panel has attached — the panel's actual promise ("Add context so Align can help you better"), not just a list of links. Always on, not opt-in: an attached item with nothing feeding into generation would make the panel decorative.
post/api/me/documents/{document_id}/generate
Request
- Base URL: https://api.meet-align.com (the document declares no server; this is the origin it was published from)
- URL: https://api.meet-align.com/api/me/documents/{document_id}/generate
- Auth: none declared
Path parameters
document_idstring required
Request body
object required
Response
Successful Response
object required
Changes
No recorded changes to this operation across all 1 revision of this API.