Alpha: Document API is currently alpha and subject to breaking changes.
Summary
Insert a new citation mark at a target location.- Operation ID:
citations.insert - API member path:
editor.doc.citations.insert(...) - Mutates document:
yes - Idempotency:
non-idempotent - Supports tracked mode:
no - Supports dry run:
no - Deterministic target resolution:
yes
Expected result
Returns a CitationMutationResult indicating success with the citation address or a failure.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
at | TextTarget | yes | TextTarget |
at.kind | "text" | yes | Constant: "text" |
at.segments | TextSegment[] | yes | |
sourceIds | string[] | yes |
Example request
Output fields
Variant 1 (citation.kind=“inline”)
| Field | Type | Required | Description |
|---|---|---|---|
citation | object(kind=“inline”) | yes | |
citation.anchor | InlineAnchor | yes | InlineAnchor |
citation.anchor.end | Position | yes | Position |
citation.anchor.end.blockId | string | yes | |
citation.anchor.end.offset | integer | yes | |
citation.anchor.start | Position | yes | Position |
citation.anchor.start.blockId | string | yes | |
citation.anchor.start.offset | integer | yes | |
citation.kind | "inline" | yes | Constant: "inline" |
citation.nodeType | "citation" | yes | Constant: "citation" |
success | true | yes | Constant: true |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | string | yes | |
failure.details | any | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
Pre-apply throws
TARGET_NOT_FOUNDINVALID_TARGETINVALID_INPUTCAPABILITY_UNAVAILABLE
Non-applied failure codes
- None
Raw schemas
Raw input schema
Raw input schema
Raw output schema
Raw output schema
Raw success schema
Raw success schema
Raw failure schema
Raw failure schema

