API to access the "Rename heading" functionality?

If you open the context menu while the cursor is on a heading, there’s an option to “Rename heading”, which has the benefit of updating links to that heading. Is there a way to access that functionality via API?

(I am the author of the number-headings-obsidian plugin GitHub - onlyafly/number-headings-obsidian: Automatically number headings in a document in Obsidian and would like to add some functionality to update links to headings when the numbering is updated.)