Skip to main content
Alpha: Document API is currently alpha and subject to breaking changes.

Summary

Rename an existing bookmark.
  • Operation ID: bookmarks.rename
  • API member path: editor.doc.bookmarks.rename(...)
  • Mutates document: yes
  • Idempotency: idempotent
  • Supports tracked mode: no
  • Supports dry run: no
  • Deterministic target resolution: yes

Expected result

Returns a BookmarkMutationResult indicating success with the updated bookmark address or a failure.

Input fields

FieldTypeRequiredDescription
newNamestringyes
targetobject(kind=“entity”)yes
target.entityType"bookmark"yesConstant: "bookmark"
target.kind"entity"yesConstant: "entity"
target.namestringyes

Example request

{
  "newName": "example",
  "target": {
    "entityType": "bookmark",
    "kind": "entity",
    "name": "example"
  }
}

Output fields

Variant 1 (bookmark.kind=“entity”)

FieldTypeRequiredDescription
bookmarkobject(kind=“entity”)yes
bookmark.entityType"bookmark"yesConstant: "bookmark"
bookmark.kind"entity"yesConstant: "entity"
bookmark.namestringyes
successtrueyesConstant: true

Variant 2 (success=false)

FieldTypeRequiredDescription
failureobjectyes
failure.codestringyes
failure.detailsanyno
failure.messagestringyes
successfalseyesConstant: false

Example response

{
  "bookmark": {
    "entityType": "bookmark",
    "kind": "entity",
    "name": "example"
  },
  "success": true
}

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • INVALID_INPUT
  • CAPABILITY_UNAVAILABLE

Non-applied failure codes

  • None

Raw schemas

{
  "additionalProperties": false,
  "properties": {
    "newName": {
      "type": "string"
    },
    "target": {
      "additionalProperties": false,
      "properties": {
        "entityType": {
          "const": "bookmark"
        },
        "kind": {
          "const": "entity"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "entityType",
        "name"
      ],
      "type": "object"
    }
  },
  "required": [
    "target",
    "newName"
  ],
  "type": "object"
}
{
  "oneOf": [
    {
      "additionalProperties": false,
      "properties": {
        "bookmark": {
          "additionalProperties": false,
          "properties": {
            "entityType": {
              "const": "bookmark"
            },
            "kind": {
              "const": "entity"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "entityType",
            "name"
          ],
          "type": "object"
        },
        "success": {
          "const": true
        }
      },
      "required": [
        "success",
        "bookmark"
      ],
      "type": "object"
    },
    {
      "additionalProperties": false,
      "properties": {
        "failure": {
          "additionalProperties": false,
          "properties": {
            "code": {
              "type": "string"
            },
            "details": {},
            "message": {
              "type": "string"
            }
          },
          "required": [
            "code",
            "message"
          ],
          "type": "object"
        },
        "success": {
          "const": false
        }
      },
      "required": [
        "success",
        "failure"
      ],
      "type": "object"
    }
  ]
}
{
  "additionalProperties": false,
  "properties": {
    "bookmark": {
      "additionalProperties": false,
      "properties": {
        "entityType": {
          "const": "bookmark"
        },
        "kind": {
          "const": "entity"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "kind",
        "entityType",
        "name"
      ],
      "type": "object"
    },
    "success": {
      "const": true
    }
  },
  "required": [
    "success",
    "bookmark"
  ],
  "type": "object"
}
{
  "additionalProperties": false,
  "properties": {
    "failure": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "details": {},
        "message": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    },
    "success": {
      "const": false
    }
  },
  "required": [
    "success",
    "failure"
  ],
  "type": "object"
}