Document apiReferenceHyperlinks
hyperlinks.wrap
Wrap an existing text range with a hyperlink.
mutates documentdry runconditional
doc.hyperlinks.wrap(…)Expected result
Returns a HyperlinkMutationResult with the created hyperlink address on success, or a failure code on no-op.
Inputs
targetTextAddressrequiredFields
kind"text"requiredblockIdstringrequiredrangeRangerequiredFields
startintegerrequiredendintegerrequiredstoryStoryLocatorStory scope. Defaults to document body when omitted. Use {kind:'story', storyType:'body'} for body, or other storyType values for headers, footers, footnotes, endnotes.
body
kind"story"requiredstoryType"body"requiredheaderFooterSlot
kind"story"requiredstoryType"headerFooterSlot"requiredsectionSectionAddressrequiredheaderFooterKind"header" | "footer"requiredvariant"default" | "first" | "even"requiredresolution"effective" | "explicit"onWrite"materializeIfInherited" | "editResolvedPart" | "error"headerFooterPart
kind"story"requiredstoryType"headerFooterPart"requiredrefIdstringrequiredfootnote
kind"story"requiredstoryType"footnote"requirednoteIdstringrequiredendnote
kind"story"requiredstoryType"endnote"requirednoteIdstringrequiredtextbox
kind"story"requiredstoryType"textbox"requiredtextboxIdstringrequiredlinkobjectrequiredFields
destinationobjectrequiredFields
hrefstringanchorstringdocLocationstringtooltipstringtargetstringrelstringResult
Output fields
true
successtruerequiredhyperlinkobjectrequiredFields
kind"inline"requirednodeType"hyperlink"requiredanchorInlineAnchorrequiredFields
startPositionrequiredendPositionrequiredfalse
successfalserequiredfailureobjectrequiredFields
code"NO_OP" | "INVALID_TARGET" | "TARGET_NOT_FOUND" | "CAPABILITY_UNAVAILABLE"requiredmessagestringrequireddetailsobjectFailures
Pre-apply throws
TARGET_NOT_FOUNDCAPABILITY_UNAVAILABLEINVALID_TARGET
1 more codes
INVALID_INPUT
Non-applied receipt codes
NO_OP
Raw schemas
Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.
View raw JSON schemas