API · Docs · Create a long-form document
Create a new long-form document rendered in the Quill editor. Content is stored as Quill Delta JSON (ops array). Used by AI-writer skills (Essay Writer, Article Writer) to persist generated markdown content into an editable document.
The returned document is immediately openable at
/ai-writer/document/{space_or_organization}/{id} in the Simplified web app.
To convert markdown content into the required Quill Delta
shape, call markdown_to_quill_delta from the writers toolkit
before passing to this endpoint.
Authentication
Header authentication of the form Api-Key <token>
Bearer authentication of the form Bearer <token>, where token is your auth token.
Request
Document title shown in the editor and the document list. For AI-writer skills, use the essay/article title from the originating show_article tool call.
Document form type enum. Use 1 for LONG_FORM (Quill-editor-backed documents — the standard for essays, articles, and any rich-text content). 0 = SHORT_FORM (AI templates, not used by these skills).
Quill Delta JSON representing the document body.
Contains an ops array of operations. Each op is a dict
with insert (string or embed object) and optional
attributes (formatting like bold, italic, header, list,
link, code-block, blockquote).
For markdown-sourced content, call markdown_to_quill_delta
to produce a compliant Delta before passing to this field.
Optional document metadata. Can be left empty (). Supported fields: description, tone, keywords, voice_id, output. Used for AI template context — not required for skill-generated content.
Optional parent document id for creating a sub-document. Not used by AI-writer skills in v1.
Response
Document created — returns document id plus workspace context
