POST /v1/prompt requires a nonempty prompt. Use it without a target for text requests, or supply one document with the access your workflow needs.
For read or comment requests, set
export_document: true if you also need an exported document. Comment/edit access and export require a target; to draft a new document, upload a starting file first.
Inputs and outputs
Prompt targets support DOCX, UTF-8 Markdown, HTML, and plain text, including.markdown and .htm aliases. Uploading other formats does not make them readable by a prompt: convert PDF, images, RTF, or ODT to DOCX first.
Supply inputs: [{"role":"target","file_id":"file_…"}], or use an eligible artifact_id. Exactly one target is supported. Remote URLs and additional reference files are not REST inputs; the TypeScript Source.fromUrl helper downloads and uploads on your application’s behalf.
Document exports always contain two DOCX artifacts:
clean: pending revisions accepted.tracked_changes: revisions kept, for review in Word or another compatible editor.
variant, not array order. Convert the chosen artifact separately if you need PDF, Markdown, HTML, or text. Tracked output can include revisions already present in the input; clean output accepts those pending revisions too.
Edit a document
First upload the file, then submit its ID:GET /v1/prompt/{id}. A succeeded job can be partial. Inspect incomplete, stop_reason, and the assistant’s message.content before treating the instruction as complete. stop_reason identifies spending_limit or time_limit when applicable.
The same edit in TypeScript:
Review without editing
comments is a flat list of native comment records; replies identify their parent with parentId. changes lists pending tracked changes, including IDs, kinds, affected blockIds, and available inserted/deleted text. These native objects use camelCase fields. The DOCX carries document anchors and review markup.
To reduce JSON response size, set response_options.include_comments or include_changes to false. This omits those fields from receipts without removing comments or revisions from the document. Omitted options inherit from a predecessor or reused artifact; otherwise both default to true.
Continue or branch
A continuation must use the current successful conversation head, with no other request active. A stale or busy predecessor returns
409 stale_or_busy_conversation; error.details.current_head_prompt_id identifies the current head. Do not combine previous_prompt_id with inputs. Access still defaults to read, so repeat document_access: "edit" for further edits.
Inspect continuation to see whether reasoning state was reused, reset, or compacted. Provider/model choices inherit from the predecessor when omitted; explicitly changing them can affect continuity.
Only artifacts with input_eligible: true can be reused directly. Request content must still be retained. Encrypted output disables both continuation and direct artifact reuse; see output encryption.