Summary
Update hyperlink metadata (destination, tooltip, target, rel) without changing display text.- Operation ID:
hyperlinks.patch - API member path:
editor.doc.hyperlinks.patch(...) - Mutates document:
yes - Idempotency:
conditional - Supports tracked mode:
no - Supports dry run:
yes - Deterministic target resolution:
yes
Expected result
Returns a HyperlinkMutationResult with the updated hyperlink address on success, or NO_OP if unchanged.Input fields
| Field | Type | Required | Description |
|---|---|---|---|
patch | object | yes | |
patch.anchor | string | null | no | One of: string, null |
patch.docLocation | string | null | no | One of: string, null |
patch.href | string | null | no | One of: string, null |
patch.rel | string | null | no | One of: string, null |
patch.target | string | null | no | One of: string, null |
patch.tooltip | string | null | no | One of: string, null |
target | object(kind=“inline”) | yes | |
target.anchor | InlineAnchor | yes | InlineAnchor |
target.anchor.end | Position | yes | Position |
target.anchor.end.blockId | string | yes | |
target.anchor.end.offset | integer | yes | |
target.anchor.start | Position | yes | Position |
target.anchor.start.blockId | string | yes | |
target.anchor.start.offset | integer | yes | |
target.kind | "inline" | yes | Constant: "inline" |
target.nodeType | "hyperlink" | yes | Constant: "hyperlink" |
Example request
{
"patch": {
"anchor": "example",
"href": "example"
},
"target": {
"anchor": {
"end": {
"blockId": "block-abc123",
"offset": 0
},
"start": {
"blockId": "block-abc123",
"offset": 0
}
},
"kind": "inline",
"nodeType": "hyperlink"
}
}
Output fields
Variant 1 (success=true)
| Field | Type | Required | Description |
|---|---|---|---|
hyperlink | object(kind=“inline”) | yes | |
hyperlink.anchor | InlineAnchor | yes | InlineAnchor |
hyperlink.anchor.end | Position | yes | Position |
hyperlink.anchor.end.blockId | string | yes | |
hyperlink.anchor.end.offset | integer | yes | |
hyperlink.anchor.start | Position | yes | Position |
hyperlink.anchor.start.blockId | string | yes | |
hyperlink.anchor.start.offset | integer | yes | |
hyperlink.kind | "inline" | yes | Constant: "inline" |
hyperlink.nodeType | "hyperlink" | yes | Constant: "hyperlink" |
success | true | yes | Constant: true |
Variant 2 (success=false)
| Field | Type | Required | Description |
|---|---|---|---|
failure | object | yes | |
failure.code | enum | yes | "NO_OP", "INVALID_TARGET", "TARGET_NOT_FOUND", "CAPABILITY_UNAVAILABLE" |
failure.details | object | no | |
failure.message | string | yes | |
success | false | yes | Constant: false |
Example response
{
"hyperlink": {
"anchor": {
"end": {
"blockId": "block-abc123",
"offset": 0
},
"start": {
"blockId": "block-abc123",
"offset": 0
}
},
"kind": "inline",
"nodeType": "hyperlink"
},
"success": true
}
Pre-apply throws
TARGET_NOT_FOUNDCAPABILITY_UNAVAILABLEINVALID_TARGETINVALID_INPUT
Non-applied failure codes
NO_OP
Raw schemas
Raw input schema
Raw input schema
{
"additionalProperties": false,
"properties": {
"patch": {
"additionalProperties": false,
"properties": {
"anchor": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"docLocation": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"href": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"rel": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"target": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"tooltip": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"type": "object"
},
"target": {
"additionalProperties": false,
"properties": {
"anchor": {
"$ref": "#/$defs/InlineAnchor"
},
"kind": {
"const": "inline"
},
"nodeType": {
"const": "hyperlink"
}
},
"required": [
"kind",
"nodeType",
"anchor"
],
"type": "object"
}
},
"required": [
"target",
"patch"
],
"type": "object"
}
Raw output schema
Raw output schema
{
"oneOf": [
{
"additionalProperties": false,
"properties": {
"hyperlink": {
"additionalProperties": false,
"properties": {
"anchor": {
"$ref": "#/$defs/InlineAnchor"
},
"kind": {
"const": "inline"
},
"nodeType": {
"const": "hyperlink"
}
},
"required": [
"kind",
"nodeType",
"anchor"
],
"type": "object"
},
"success": {
"const": true
}
},
"required": [
"success",
"hyperlink"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"failure": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
"NO_OP",
"INVALID_TARGET",
"TARGET_NOT_FOUND",
"CAPABILITY_UNAVAILABLE"
]
},
"details": {
"type": "object"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"success": {
"const": false
}
},
"required": [
"success",
"failure"
],
"type": "object"
}
]
}
Raw success schema
Raw success schema
{
"additionalProperties": false,
"properties": {
"hyperlink": {
"additionalProperties": false,
"properties": {
"anchor": {
"$ref": "#/$defs/InlineAnchor"
},
"kind": {
"const": "inline"
},
"nodeType": {
"const": "hyperlink"
}
},
"required": [
"kind",
"nodeType",
"anchor"
],
"type": "object"
},
"success": {
"const": true
}
},
"required": [
"success",
"hyperlink"
],
"type": "object"
}
Raw failure schema
Raw failure schema
{
"additionalProperties": false,
"properties": {
"failure": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
"NO_OP",
"INVALID_TARGET",
"TARGET_NOT_FOUND",
"CAPABILITY_UNAVAILABLE"
]
},
"details": {
"type": "object"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
},
"success": {
"const": false
}
},
"required": [
"success",
"failure"
],
"type": "object"
}

